# CSCI251 Advanced Programming Assignment 1 solution

\$30.00

Original Work ?

5/5 - (1 vote)

## Description

This program is used to simulate the process of a crowdsourcing system, and we simplify
some steps here. The Tasks.txt and Workers.txt file save the information of individual tasks
and workers, respectively.

Each task (one line record from in Tasks.txt) represents a task which needs to be assigned to
a worker to finish. The crowdsourcing system attempts to assign the task through a list of
workers in the same line in Tasks.txt. All workers in the list will try the task in order. Each
worker can try five times. Whether this worker is successful depends on the average
performance over five times.

The next worker can try only when the current worker fails. If the current worker y succeeds,
you should output something like “Assignment of Task x to worker y succeeds” where x is
the taskID and y is the workerID. Otherwise, output something like “Assignment of Task x to
worker y fails”.

Now, let us define the inputs in Tasks.txt and Workers.txt, ‘worker performance’ at a
time, ‘worker average performance’ and the ‘successful condition’ of a worker.

Example:
123,image labelling,5,10,workers:0,1
2. Workers.txt
workerId,name,variability,ability
Example:
0,Michael,-2,50

Worker Performance and her/his average performance:
The performance score is a sample drawn from a normal distribution. In this normal
distribution, “mean = worker ability – task difficulty” and “standard deviation = task
uncertainty +worker variability”. E.g, given the task and the worker in the example above.

Mean=50-10, and standard deviation=5+(-2). The average performance is the average score
of five independent draws from this distribution.

Successful condition of a worker
We say the worker is successful if and only if the average performance score is greater than
50. Otherwise (i.e., the score <= 50), it fails.

Output:
The tasks from the “Tasks.txt” file are to be processed in the order they are given, and each
task is independent. You should output the information of each task (i.e., all attribute
information in the input file) being processed and the evaluation results for the workers in the
list (i.e., Assignment of Task x to worker y succeeds or not). You should output something
(like below) into the “Output.txt” file.

Note:
1. Do not change Tasks.txt and Workers.txt. Report results for tasks in order.
2. Use structs to store information for tasks and workers.
3. Name your executable file as “run”. It should run like: