Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Provided is a text file schedule.txt. It determines what I am doing at any given time during the day. Your code will read those files,

Provided is a text file schedule.txt. It determines what I am doing at any given time during the day. Your code will read those files, saving into 2 arrays the time and activity. Then a user can (1) put in a time, and the code will find and print the activity or (2) put in an activity, and print the time. Your task is in the following parts.

1) Write your search algorithm in pseudocode or a flowchart.

2) Write the code based on the pseudocode/flowchart.

3) Test the algorithm.

Along with this document, there are 2 files. The first is the daily schedule. The second is a template you can use. Abridge the template as you want. You must use the command line environment to run and test the code.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
Dreaming Sleeping Snoring Nightmaring Stirring Snoozing Alarming Grooming Eating Driving Sitting Teaching Scarfing Whittling Lecturing Grading Napping Commuting Grilling Chilling Maxing Relaxing Snacking Dozing
#include  #include  #include  using namespace std; void printMenu(){ //DO NOT TOUCH THIS PART cout << endl << "---------------- "; cout << "Enter 0 to exit "; cout << "Enter 1 to search by number "; cout << "Enter 2 to search by activity "; } int main(){ //YOU EDIT THIS ifstream infile("Lab2_Schedule.txt"); int choice = 0; int hour[24] = {0}; //Fill both arrays, even though one will just be index values string activity[24] = {"Empty"}; //populate the arrays here do{ printMenu(); } while(choice != 0); }

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

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago