No Global Variables (you can have global constants) No use of the stdio library
ID: 3543895 • Letter: N
Question
No Global Variables (you can have global constants)
No use of the stdio library (use iostream and fstream)
Instead of the string class, you will be using arrays of characters and the cstring library
Things You Should Do:
Your programs should always guard against bad data being entered by mistake
You can always do more than the assignments require
Goals for This Lab:
Breaking tasks down into functions
More about using character arrays
Use struct to model composite data type
Use array of objects to model a collection
File input/output
Problem You Need to Solve for This Lab:
You have noticed that there is a lot to do this term as we get familiar with C++ and programming on a larger scale. With a full load of classes, you may have many due dates to meet. Keeping track of everything is important. You have decided to write a program that reads tasks from the user and saves them in a data file to keep track of.
What Your Program Should Do:
Write an interactive text based menu interface (using a loop) that will allow the user to
Enter a task or assignment
Display all of the tasks that are in the file
Find a task by Course
Quit
For each task, you need to keep track of:
Course Name that it is for (e.g., CS162)
Description of the assignment (e.g., Finish Lab 2)
Due date (e.g., 9/26/2009)
Allow the program to keep looping until user wants to quit. When the program starts, it should load the tasks from external file ("tasks.txt") into memory. When user enters the three items of a task, the program needs to read them in, save them in memory and eventually write them to the external data file ("tasks.txt"). The file format could look like: (The ';' is used as a delimiter or field seperator.)
CS162;Finish Lab 2;9/26/2009
CS201;Take Quiz 1;9/28/2009
Some Implementation Requirements:
Write at least four functions WITH arguments for this assignment.
Use struct named Task to model task
Use array of structs to model the collection of tasks.
Hint: In this assignment, the description and course name may have multiple words in it. Therefore, you now SHOULD read using the 3 argument version of get.
Watch out. When using the 3 argument version of get you need to make sure to remove the delimiter or newline. Therefore, anytime you read (even a confirmation message), make sure to eat the newline!
Make sure to have a delimiter written between each item in the file
Explanation / Answer
see here
http://pastebin.com/P9TjRkTP
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.