Write a C++ program which takes 5 students’ information (records) as inputs from the user and save them on a file. Your program should have two options: writing and searching. When a user selects writing option, you are required to take three inputs from the user: student name (string type), student age (int type). After reading these data-items write to the file named “student.txt”. Please note: write data using append mode otherwise previous information will be lost. Your program should have a search function. The search function should provide three options for searching: by name, by age, or by registration number. After selection of the search option by the user, please take input (name, age, or registration number) and search that student from the file and display its record on the screen.
Write a C++
save them on a file. Your program should have two options: writing and searching.
When a user selects writing option, you are required to take three inputs from the user: student
name (string type), student age (int type). After reading these data-items write to the file named
“student.txt”. Please note: write data using append mode otherwise previous information will be
lost.
Your program should have a search function. The search function should provide three options
for searching: by name, by age, or by registration number. After selection of the search option
by the user, please take input (name, age, or registration number) and search that student from the
file and display its record on the screen.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images