subject
Computers and Technology, 01.05.2021 19:50 mccdp55

For this assignment you will write a program that reads in a list of job assignments, puts them in a calendar and generates a report. The report
includes the day-by-day calendar assignments as well as a list of errors from
the data.
The objective of this assignment is to practice using the following concepts:
- reading data from a file
- structs
- arrays
- character arrays for strings
- user-defined functions
- multiple files for compilation
Your program will be evaluated based on both how it runs as well as how it was
designed and coded.
Along with these instructions, I have provided data files and the EXACT
expected output that corresponds to some of those data files. It is important
that your program output matches EXACTLY. This includes spelling, whitespace,
and punctuation.
The rest of this document provides more details about the assignment.

Details
The following sections provides details about the requirements for the
assignment.
data storage
As described in the overview, this program reads in data and needs to store it
in a calendar. This means that we need to have variables to store this
data. The central structure is going to be the calendar. Since the calendar
has a fixed number of days (CAL_DAYS from the sizes. h file), we can use an
array with that number of slots.
The next question is what type of data should be in the array. Each day needs
to hold task information for up to three assignments. The task information
includes the task name, the duration of the task, and who it's assigned
to. The best option for this is to use a struct.
Putting these two items together, that means you have an array of structs. If
your struct was defined as "struct day { ...stuff... };" then declaring the
calendar array would look like this:
day calendar[CAL_DAYS];
That creates an array called "calendar" that holds "day" variables. It holds
CAL_DAYS of those variables.
The data we are dealing with it presented as strings
Since the report requires us to print out errors, we will probably want to
have some arrays to keep the errors. Since errors are strings and strings are
character arrays, we will end up with something like this:
char overlapErrors[MAX_ERRS][MAX_STR]; That is, an array that holds at most MAX_ERRS error messages and each message
is at most MAX_STR characters long.
Now that we have a concept of the variables that we'll use, we can look at the
main algorithm.
main
The main algorithm has two phases. In the first phase, the assignment data is
read from the input file and inserted into the calendar array. Since each day
in the array can only hold up to three assignments, if more than three
assigments are provided for a day, the program keeps track of the extra ones
so it can report an error at the end and it DOES NOT insert them into the
calendar.
The format of the data in the input file is:
;;;
For example:
5;Replace ventalation filters;2;Robbie Mitchell
Any blank lines in the data file should be ignored and any line starting with
a # should be ignored.
The data in the input file can not be assumed to be in any sort of order. You
do not have to deal with an improperly formatted data file.
The second phase of the main algorithm generates the calendar and prints the
errors. See the assignments. txt. out for the exact format of this output. Your
program needs to print the data in the exact same way.
One more thing, since you may not have dealt with command line arguments
before, I have provided a sample_main. cpp file that shows how to make sure
that a filename is passed on the command line and how to get that
filename.
reading data
Reading the data from the file requires following this process:
- read a line from the file (the whole line)
- get the day number part
- get the task name
- get the duration
- get the who name
- add that data to the correct day entry in the calendar
Getting the individual parts of the line of input will require you to have
another variable to copy the data into and then you will use a loop to go one
character at a time over the original line of data, copying one character at
a time until you hit the delimeter. Here's an example of doing something
similar. In this example I'm copying the xth through yth characters from "line" into
"other".
char other[MAX_STR];
int otherIdx = 0;
for (int i=x;i<=y;i++) {
other[otherIdx] = line[i];
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
What is the process in which the software development team compiles information to determine the final product.
Answers: 3
question
Computers and Technology, 22.06.2019 05:00
Modern businesses use different technologies to accomplish work tasks
Answers: 2
question
Computers and Technology, 23.06.2019 00:00
Suppose you have 9 coins and one of them is heavier than others. other 8 coins weight equally. you are also given a balance. develop and algorithm to determine the heavy coin using only two measurements with the of the balance. clearly write your algorithm in the form of a pseudocode using the similar notation that we have used in the class to represent sorting algorithms
Answers: 1
question
Computers and Technology, 24.06.2019 06:00
Hey i really need some solving this problem: 1. encrypt this binary string into cipher text: 110000. include in your answer the formula the decoder would use to decrypt your cipher text in the format (coded answer) x n mod (m) = y & 2. decrypt this cipher text into a binary string: 106 you.
Answers: 2
You know the right answer?
For this assignment you will write a program that reads in a list of job assignments, puts them in...
Questions
question
Mathematics, 10.07.2021 07:30
question
Mathematics, 10.07.2021 07:30
question
English, 10.07.2021 07:30
Questions on the website: 13722367