Provide a simple text based interface for train schedule

Assignment Help C/C++ Programming
Reference no: EM131565229

Train Station C++ Program

Create a C++ program will provide a simple text based interface that will allow a user to create, edit, search, or delete a train schedule.

The program will manage these attributes in an object, which will consist of a single linked list stored in memory. The linked list can be a global variable for simplicity. The program must use the "list" API in the C++ standard template library (STL). The program must implement at least one class that will hold the following variables:

• scheduleId -An integer variable to hold the schedule identifier. This must be a randomly generated 10-digit number. The scheduleId is a unique identifier for each train schedule in the linked list and repeats are not allowed.

• scheduleDate - A string variable to hold the date that the schedule will take effect. The date must be in the form mm/dd/yyyy. Where mm is the two- digit month, dd is the two-digit day, and yyyy is a four-digit year. Input Validation Required: The program must re-prompt the user to re-enter the date if it is not the valid format provided above.

• scheduleDays -An integer variable to hold the number of days that the schedule will be valid.
Input Validation Required: The program must re-prompt the user to re-enter the number if it is not greater than 0.

• trainNumber -An integer variable to hold the train number.

• originStation - A string variable to hold the name of the station of origin. Note that spaces must be allowed in the string.

• origDepartureTime - A string variable that will hold the time that the train will depart from the station of origin. This variable must be in the form HHMM, where HH is a number from 00-23 and MM is a number from 00- 59.

• destinationStation - A string variable to hold the name of the destination station. Note that spaces must be allowed in the string.

• arrivalTime - A string variable that will hold the time that the train will arrive that the destination station. Input validation is recommended but is not required. This variable should be in the form HHMM.

• departureTime - A string variable that will hold the time that the train will depart from the station. Again, input validation is recommended but not required here. This variable should be in the form HHMM.

Provide the appropriate methods to set and get the data for each of these class variables. For example setScheduleDate(string scheduleDate) and string getScheduleDate().

The main program must provide the following functionality:

1. When the program is first started, it must read a data file called schedule.dat. The program will not prompt the user for the name of the data file. The name of the file must be hard-coded in the program. If the file exists, the program will load the data for each schedule into the global linked list. If the file does not exist, the program will start with an empty linked list.

2. The program will provide a simple text-based user interface that manages the all of the train schedules within a linked list. Each schedule must be placed in the linked list as an object that holds all of the attributes associated with it as mentioned above. The user interface will allow the user to perform the following:

a) EnterSchedule - allows the user to enter all of the fields associated with a given train schedule, except for the scheduleId, which will be automatically generated by the program as previously mentioned. After the fields are entered, the program will place the schedule object in the global linked list.

b) DisplayAllSchedules - displays all of the schedules within the linked list along with their associated fields. In addition, this option must print the total number of schedules in the linked list.

c) SearchforSchedule - allows the user to find a schedule by its schedule identifier. The program will prompt the user to enter the scheduleId and will display all of the fields associated with the given schedule, if it is found. The program must display an error message if the schedule is not found in the linked list.

d) Edit Schedule - allows the user to edit the fields for a given schedule that is in the linked list. The program must prompt the user to enter the scheduleId as the key to find the schedule to edit. For simplicity, the program may re-prompt the user to re-enter all of the fields associated with the schedule; but, it must reuse the scheduleId value.

e) DeleteSchedule - allows the user to delete a schedule from the linked list using the scheduleId as the key.

f) ExitSystem - before the program exits, it must save all of the data in the linked list to the data file. I recommend using a standard text file with one field in the object per line. At this point, if the file does not exist, the program will create it.

Verified Expert

The project ‘Train Schedule’ helps the user in maintaining different train schedules. This project provides simple interface to user for train scheduling. The interface provides facility to user to create new train schedule, and then program provides unique scheduleId to user through which he can delete, search and edit certain schedule. The program also provides option to user through which he/she can see all train schedules. In scheduling, user can enter date of starting schedule, days of schedule validation, train number, origin station and its departure time, Destination station and time of arrival and departure of train from destination station. The program automatically load data and save data in some external file for user future usage. The project is C++ language program.

Reference no: EM131565229

Questions Cloud

Determine number of units of widgets for bravo to breakeven : During FY 2016, Bravo Company plans to sell Widgets for $5.00 a unit. Use this information to determine the number of units of Widgets for Bravo to breakeven
How fast is the length of the beam increasing : A searchlight is 225 ft from a straight wall. As the beam moves along the wall, the angle between the beam and the perpendicular to the wall is increasing.
Describe a human capital management goal : Describe a human capital management goal that Shawn can recommend to change the global organizational culture of AGC.
Short descriptive essay- an american childhood : compose a short descriptive essay about someone you know very well, using several anecdotes
Provide a simple text based interface for train schedule : Create a C++ program will provide a simple text based interface that will allow a user to create, edit, search, or delete a train schedule.
Determine number of units of widgets that bravo must sell : Use this information to determine the number of units of Widgets that Bravo must sell in FY 2016 to meet this goal
What is the speed of the car : A car passes directly under a police helicopter 450 ft above a straight and level highway. After the car travels another 50.0 ft, the angle of depression.
What role is played by government : How do the social determinants of health impact? What other external factors might influence healthcare?Deliberate on the roles of professional obligation.
Determine the dollar amount of alpha fixed costs : Alpha Company publishes & sells a calendar for $6.50 each. Use this information to determine the dollar amount of Alpha's fixed costs

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program that skip s leading whitespace character

a) Write a program that skip s leading whitespace character s in each line of the pro vided data file CPPHumor .txt . Save the results in a new file

  Memory values and a one-address machine with an accumulator

Given the following memory values and a one-address machine with an accumulator, what values do the following instructions load into the accumulator?

  Write a program that obtains two integer numbers from users

Pseudo code is an informal high-level and compact description of a computer programming algorithm that uses structural conventions of a programming language. Write a program that obtains two integer numbers from the user

  State diagram to recognize one form

Design a state diagram to recognize one form of the comments of the C-based programming languages, those that begin with /* and end with */. and also Write and test the code to implement the state diagram.

  Show what is output by the following segment of code.

Show what is output by the following segment of code.

  Write a program that reads in babynames

Write a program that reads in babynames.txt and produces two files - Separate the data for the boys and girls. You may enter any names

  Write an abstract data type

Write an abstract data type in C++ or Java (find which language you used) for rational numbers (a numerator and a denominator, both in integers).

  C write a function which adds the two numbers

1. In C write a function which adds the two numbers. Test this function by calling from the main. In main, the user should be asked to provide the two numbers.

  Write a pseudocode and draw flowchart for the program

Please help with a pseudocode and flowchart for the program, that follows the guidelines of good program design, like meaningful variable names and thoroughly commented code.

  How do cin and cout relate to ostream and istream

How are input and output accomplished in C++? How do cin and cout relate to ostream and istream? Write a program that asks the user to enter the name of a file. The program should display the number of characters in the file.

  Describe how an element in an array is accessed in memory

Describe how an element in an array is accessed in memory. For example, where is myArray[25] stored in memory?

  Write an interactive c program to process the exam scores

Write an interactive C program to process the exam scores for a group of students in a C programming course. Begin by specifying the number of exam scores for each student.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd