Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Goal: This program will give you a chance practice array, sorting, searching, and function overloading. Write a program to help you organize your To-Do List

Goal: This program will give you a chance practice array, sorting, searching, and function overloading. Write a program to help you organize your To-Do List organized. The program will get a month worth of To-Do tasks from a file and print it out in the ascending order by the value of day. Each To-Do task include the day (int) and the thing to do (string). The data type of the To-Do task is: typedef struct ToDoTask { int day; string task; }; Your program will: In the main() function:

Step1: Create a container list . (ref to listBookShelf.cpp and cplusplus.com) (5 pts)

Step2: Call a void function: loadList() with two parameters. The first parameter is the list created from step1 (this parm should be passed by reference). The second parameter is a string which is provided from the command line. The function will i. read in event/appointment from the data file provided through the parameter into the task field. A sample data file might look like: Meet Cindy for group study Dinner with my family Diner with Dian at Golden Coral @6:00 pm Finish take home test and submit by 9:00 am Note: You are expected to create your own data file (with at least 10 records) . For testing purpose, just use any text file and pretending they are daily tasks. You must type the file name on the command prompt (by passing it to argv). ii. Use rand() function to generate a correspondent day ranging from 1-31. We will simplify this program by using 1 31 only. Do not worry about the months that has less than 31 days. iii. There is no need to keep track the size of the input data. Container list knows its size automatically. (10 pts)

Step3: Call a void function: printList() with one single parameter (the container list declared in main()). (5 pts) The function will (all output should be descriptive) i. Create an iterator object and loop from the begin to end. ii. In the loop, the function will print all events in the toDo list

Step4: Sort the list with a user defined comparing function. (5 pts)

Step5: Call the printList() again to print the sorted list of events. (5 pts)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting Information For Decisions

Authors: Robert Ingram, Thomas L. Albright, Bruce A. Baldwin, John Hill

1st Edition

0538815388, 978-0538815383

More Books

Students also viewed these Accounting questions

Question

Describe a time you have performed a what if-analysis.

Answered: 1 week ago

Question

Explain the steps involved in training programmes.

Answered: 1 week ago