Question
Please solve using c++ plus There are two text files with the following information stored in them: The instructor.txt file where each line stores the
Please solve using c++ plus
There are two text files with the following information stored in them: The instructor.txt file where each line stores the id, name and affiliated department of an instructor separated by a comma The department.txt file where each line stores the name, location and budget of the department separated by a comma
You need to write a C++ program that reads these text files and provides user with the following menu: 1. Enter the instructor ID and I will provide you with the name of the instructor, affiliated department and the location of that department. 2. Enter the department name and I will provide you with the location, budget and names of all instructors that work for the department. 3. Insert a record about a new instructor. 4. Exit
The above menu should continue to be displayed in a loop until the user selects option 4.
When the user selects option 1 above, the following should be displayed: Enter the instructor ID: If the user enters an instructor id that is not present in the text file, display "The ID doesnot appear in the database.", otherwise, display the name of the instructor, affiliated department and the location of that department.
When the user selects option 2 above, the following should be displayed: Enter the department name: If the user enters a name that is not present in the text file, display "The department name doesnot appear in the database.", otherwise, display the location, budget and names of all instructors that work for the department.
If the user selects option 3 above, display the following: Enter the instructor id: Enter the instructor name: Enter the affiliated department name: Once the user enters the above information, store the information in the instructor file
Use vectors instead of arrays whereever needed.
The program should work for any number of rows in the two text files.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started