I am doing this program for a cs class. I am trying to create menu based system that will allow the user to input the number that corresponds to the option they want to choose. Then based on that option they will input their customer id (this is a banking type question and all the customer have a .dat file that will be read and written to) then display the info from the file to the console. I am getting a message that says my file that I am trying to open is undefined. I was wondering if someone could help me resolve this or if there is a good example I could look at. the code is not finished as I am tackling it part by part
/*
Team#: 8
Team Member-1: Joe Mendoza Member’s Contribution (in %) 50%
Team Member-2: Omear Gonzalez Member’s Contribution (in %) 50%
Problem statement: Write a C++ program that reads a customer’s checking account information from a dat file and calculates his/her account balance. In particular, a menu-based application should be developed to perform the following functionalities iteratively until the user request to quit the program:
1. Display the account summary: This option allows the user to enter a 3-digit customer ID (e.g., 007 for the customer name James Bond). The program should read-in an appropriate dat file (e.g., Cust_007.txt) corresponds to the customer ID and displays the account information including the total account balance on the console. [10 points]
2. Deposit the amount into the account: This option allows the user to enter a 3-digit customer ID, adds the requested amount at the end of the file, and saves the file. The option should display the account information including the total account balance on the console. [20 points]
3. Withdraw the amount from the account: This option allows the user to enter a 3-digit customer ID, reads the customer’s dat file, verifies that the requested withdrawal is less than the account balance and then add the withdrawal amount at the end of the file. The option should display the account information including the total account balance on the console.
In case, if the requested withdrawal is greater than the account balance, the program should display an error message and terminate the transaction. [25 points]
4. Quit the program: This option terminates the program. [5 points]
Four test files are provided to test your program. The dat files are named based on the customer id. For instance, the first customer of the bank is the author of the book, Tony Gaddis and his customer ID is Cust_001. The dat file of his checking account is Cust_001.dat.
Input validations: The menu based option should not allow any options other than 1 to 4 [10 points]. The program should not allow the user to enter any negative numbers [10 points].
*/
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
char user_choice, cust_id;
ifstream inputFile;
string filename, cust_data;
cout << "Please enter the number that corresponds to the option you want to choose" << endl;
cin >> user_choice;
switch (user_choice)
{
case '1':
{
cout << "Please enter your 3-digit customer id" << endl;
cin >> cust_id;
switch (cust_id)
{
case'001':
inputFile.open(Cust_001.dat);
while (inputFile >> cust_data)
{
cout << cust_data << endl;
inputFile.close();
}
case'007'
case'020'
case'400'
}
break;
}
case '2':
cout << "Please enter your 3-digit customer id" << endl;
break;
case '3':
cout << "Please enter your 3-digit customer id" << endl;
break;
case '4':
cout << "Please enter your 3-digit customer id" << endl;
break;
}
}