Question
I want help for my c++ project. Project Description Each student can open an account in the cafeteria. It has the following features: The system
I want help for my c++ project.
Project Description
Each student can open an account in the cafeteria. It has the following features:
- The system can hold data for 20 students.
- The student can deposit any amount in his/her account.
- The student can use the available amount in his/her account to buy lunches or snacks.
- Menu price list is as below:
Item | Cost in PKR |
Lunch | 150 |
Snack | 100 |
Drink | 50 |
- Each student account should have the following details stored:
- Roll no (Data type: int, format: BBRRRR, e.g. 201406)
- Account No (Data type: int)
- Balance (Data type: double)
- Student Name (Data type: char array)
{Hint: Use 2D arrays for storing student first and last names: char Student_Name [20][30]}
Functions to be Implemented
The following functions should be implemented in your system. Decide for yourself the arguments and return type for each function.
| Required Functions | Functionality |
1. | Create_Account() | Assign each student a unique account number. Get student Roll No and Name. Ask the user for the initial Deposit amount. |
2. | Display() | Gives all details of a single Account. |
3. | Deposit_amount() | Updates the Account Balance. |
4. | Purchase_Item() | Following functionality must be implemented:
|
5. | Store_in_File () | Writes data of the accounts in use into a file Record_sys.txt |
| Bonus Functions | Implementing these functions will earn bonus marks |
6. | Display_Sorted() | Sort the entire data on the basis of Roll No. and display it in an ascending order |
7. | Read_from_file()
| At the beginning of your program update all the previously saved data from the file Record_sys.txt |
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