Question

In: Computer Science

Create a Software Application for XYZ Bank that allows its members to access their bank account...

Create a Software Application for XYZ Bank that allows its members to access their bank account information through an “ATM like” interface. The Menu Options should include: checking the account balance, debiting the account and crediting the account, along with an option to exit the program.

Create an Account Class to represent the customers’ bank accounts. Include a data member of type float to represent the account balance. Provide a constructor that receives an initial balance and uses it to initialize the data member.

  1. The constructor should validate the initial balance to ensure that it’s greater than or equal to $1000.00. If not, set the balance to 0 and display an error message to the user indicating that the initial balance was invalid.
  2. Provide three member functions.
  1. Member function Credit() should add an amount to the current balance.

    1. Member function Debit() should withdraw money from the Account and ensure that the debit amount does not exceed the Account’s balance. If it does, the balance should be left unchanged and the function should print a message indicating "Debit amount exceeded account balance."
    1. Member function GetBalance() should return the current balance.

Can someone please help me in Creating a console application in C++ that meet the requirements outlined above. With comments Lines

Solutions

Expert Solution

Full C++ Program for the given problem statement is as follows:

#include<iostream>
using namespace std;
class Account{
    public:
        float balance;
        Account(){
            cout<<"\nEnter the initial balance : ";
            cin>>balance;
            if (balance<1000){
                balance = 0.0;
                cout<<"\nInitial balance was invalid ";
            }
            else
                cout<<"Account Created";
        }
        void Debit(){
            float debit;
            cout<<"\nEnter the amount to be debited : ";
            cin>>debit;
            if (debit>balance)
            {
                cout<<"\nDebit amount exceeded account balance.";
            }
            else{
                balance=balance-debit;
                cout<<"\n Remaining Account balance : "<<balance;
            }
        }
        void Credit(){
            float credit;
            cout<<"\nEnter the amount to be credited : ";
            cin>>credit;
            balance=balance+credit;
            cout<<"Current Balance : "<<balance;
        }
        void GetBalance(){
            cout<<"Current Balance : $"<<balance;
        }
};

int main(){
    Account person;
    int i;
    while (1){
        cout<<"\nAccount Operations ";
        cout<<"\n-------------------";
        cout<<"\n1. Credit Balance \n2. Debit Balance \n3. Show Balance \n4. Exit";
        cout<<"\n--------------------\nEnter your choice : ";
        cin>>i;
        switch(i){
            case 1: person.Credit();
                    break;
            case 2: person.Debit();
                    break;
            case 3: person.GetBalance();
                    break;
            case 4: exit(0);
        }
    }
    return 0;
}

Output:

I hope you find this solution helpful.

Keep Learning!


Related Solutions

Create an application that allows the user to enter the total for an order and the...
Create an application that allows the user to enter the total for an order and the name of the customer. If the order is less than 500 dollars, the customer gets no discount. If the order is greater than or equal to 500 and less than 1000 dollars, the customer gets a 5 percent discount. If the order is greater than or equal to 1000 dollars, the customer gets a 10 percent discount. The application should display the name of...
Create an application that allows the user to enter the total for an order and the...
Create an application that allows the user to enter the total for an order and the name of the customer. If the order is less than 500 dollars, the customer gets no discount. If the order is greater than or equal to 500 and less than 1000 dollars, the customer gets a 5 percent discount. If the order is greater than or equal to 1000 dollars, the customer gets a 10 percent discount. The application should display the name of...
Create a web page using PHP that allows the users to create an account (a username...
Create a web page using PHP that allows the users to create an account (a username and a password). There should be a login page that allows users to create an account by entering their preferred username and password. The same page should also let users login if they already have an account. If a user is logged in successfully , they should be able to enter a comment and also read the comments entered by others previously.
Show: Create an application that allows the user to enter the number of calories and fat...
Show: Create an application that allows the user to enter the number of calories and fat grams in a food. The application should display the percentage of the calories that come from fat. If the calories from fat are less than 30% of the total calories of the food, it should also display a message indicating the food is low in fat. One gram of fat has 9 calories, so: Calories from fat = fat grams *9 The percentage of...
Create an application that allows the user to place an order at a coffee shop named...
Create an application that allows the user to place an order at a coffee shop named Zips Coffee. Create a coffee order form that looks like a table with columns for coffee type, price and quantity. Provide values for at least three rows of data. Provide a row for the total cost of your order. Create Javascript code to calculate the total of your order and present the total to the user. Provide a button to initiate the Javascript described...
(In C++) Bank Account Program Create an Account Class Create a Menu Class Create a main()...
(In C++) Bank Account Program Create an Account Class Create a Menu Class Create a main() function to coordinate the execution of the program. We will need methods: Method for Depositing values into the account. What type of method will it be? Method for Withdrawing values from the account. What type of method will it be? Method to output the balance of the account. What type of method will it be? Method that will output all deposits made to the...
Android Studio. Java. Please create an application that -> An activity that allows user to enter...
Android Studio. Java. Please create an application that -> An activity that allows user to enter name, gender, date of birth, state of residence (selected from a pre-defined list: CA, AZ, NV, OR), email address and favorite website. This activity has a button "Show Data" that displays detail entered
Create a C# application for Cricket Team that allows you to enter data for player of...
Create a C# application for Cricket Team that allows you to enter data for player of Cricket Team and saves the data to a file named Players.txt. Create a Player class that contains fields for of participant's first name, last name, age, salary and position (wicketkeeper, bawler, striker, midwicket), and To String() method. The fields of records in the file are separated with semicolon (. Expecting sentinel value for ending the process of writing to file is *. E.g. of...
Create a C# application for Library that allows you to enter data for books and saves...
Create a C# application for Library that allows you to enter data for books and saves the data to a file named Books.txt. Create a Book class that contains fields for title, author, number of pages, and price of the book and ToString() method. The fields of records in the file are separated with asterisk (*). Expecting sentinel value for ending the process of writing to file is "000"
Using Repl.it In this assignment you will create a Java program that allows a Bank customer...
Using Repl.it In this assignment you will create a Java program that allows a Bank customer to do the following: 1) Create a bank account by supplying a user id and password .2) Login using their id and password 3) Quit the program. Now if login was successful the user will be able to do the following: 1) Withdraw money. 2) Deposit money. 3) Request balance. 4) Quit the program. If login was not successful (for example the id or...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT