Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

The below information is listed for this program need before 3/9 thanks Requirements Each menu option should call a function to perform the work. Do

The below information is listed for this program need before 3/9 thanks

Requirements

Each menu option should call a function to perform the work. Do not use C++ arrays or vectors in this program

See if you can figure out another method to update information using file(s). When displaying information, the data should appear in table format and each field should be delimited by using a tab. For example, the following record displays the appointment information for Todd Smith.

Todd Smith 5/30/1980 2:00

Your code should contain proper commenting and be formatted properly with readable code blocks and proper spacing.

Specifications

Youve been contracted to create a medical appointment program for a doctors office. This program should offer the following services in menu form.

1. Book an appointment

2. Change an appointment

3. Cancel an appointment

4. View appointment by last name

5. View all appointments

The menu should perform data validation and only accept an integer associated with one of the options. Use a switch statement to construct your menu.

Booking an appointment

Booking an appointment requires the user to enter their first and last name, date of birth, and appointment time. No need to worry about scheduling conflicts with other appointments. All appointments should be written to a text file named appointments.txt. Each appointment should be stored as a record in this file in the following format: firstName lastName DOB apptTime

No need to perform data validation on the name, date of birth, or appointment time. You can assume valid entries. Once an appointment is booked, a message should be displayed to the user indicating so.

Changing an appointment

Changing an appointment requires that the user enter their last name, date of birth, and new appointment time. This information should be updated in the appointments.txt file. When the appointment is changed, the updated information should be displayed to the user.

Cancelling an appointment

Cancelling an appointment requires that the user enter their last name and date of birth. The cancellation should cause the appointments.txt file to be updated so that the appointment no longer appears. When the appointment is cancelled, the updated message should be displayed to the user.

View appointments by last name This option should ask the user for their last name. If there are multiple records with the same last name, all should be shown. For example, if there are 2 appointments with the last name Jones, the output should look like this:

Bob Jones 10/3/87 8:30

Sara Jones 7/5/90 11:00

Viewing all appointments This option should show all appointments that are stored in the appointments.txt file. No sorting is necessary.

When displaying information, the data should appear in table format and each field should be delimited by using a tab. For example, the following record displays the appointment information for Todd Smith.

Todd Smith 5/30/1980 2:00

Your code should contain proper commenting and be formatted properly with readable code blocks and proper spacing.

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_2

Step: 3

blur-text-image_3

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

More Books

Students explore these related Databases questions

Question

Question What is a Roth 401(k) feature?

Answered: 3 weeks ago