152: A bank in your town updates its customers' accounts at the end of each month. The bank offers two types of accounts: savings and checking. Every customer must maintain a minimum balance. If a customer's balance falls below the minimum balance, there is a service charge of $10.00 for savings accounts and $25.00 for checking accounts. If the balance at the end of the month is at least the minimum balance, the account receives interest as follows: a. Savings accounts receive 4% interest. b. Checking accounts with balances of up to $5,000 more than the minimum balance receive 3% // interest; otherwise, the interest is 5%. Write a program that reads a customer's account number (int type), account type (char; s for savings, c for checking), minimum balance that the account should maintain, and current balance. The program should then output the account number, account type, current balance, and an appropriate message. Test your program by running it five times, using the following data: // 46728 S 1000 2700 // 87324 C 1500 7689 // 79873 S 1000 800 // 89832 C 2000 3000 // 98322 C 1000 750

 

// A bank in your town updates its customers' accounts at the end of each month. The bank offers
// two types of accounts: savings and checking. Every customer must maintain a minimum balance. If
// a customer's balance falls below the minimum balance, there is a service charge of $10.00 for
// savings accounts and $25.00 for checking accounts. If the balance at the end of the month is at least
// the minimum balance, the account receives interest as follows:

// a. Savings accounts receive 4% interest.
// b. Checking accounts with balances of up to $5,000 more than the minimum balance receive 3%
// interest; otherwise, the interest is 5%.
// Write a program that reads a customer's account number (int type), account type (char; s for
// savings, c for checking), minimum balance that the account should maintain, and current balance.
// The  program  should  then  output  the  account  number,  account  type,  current  balance,  and  an
// appropriate message. Test your program by running it five times, using the following data:
// 46728 S 1000 2700
// 87324 C 1500 7689
// 79873 S 1000 800
// 89832 C 2000 3000
// 98322 C 1000 750

#include <iostream>
using namespace std;
int main()
{
    float minimum_balance, current_balance;
    int account_number;
    char account_type;

    cout << "___________________________________\n";
    cout << "| Enter your account number: ";
    cin >> account_number;
    cout << "|**********************************\n";
    cout << "|\n| Choose account type\n| c for checking\n| s for saving\n| Enter your choice: ";
    cin >> account_type;
    cout << "|**********************************\n";
    cout << "|\n| Enter minimum balance to maintain in account: $";
    cin >> minimum_balance;
    cout << "|*****************************************************\n";
    cout << "|\n| Enter your current balance: $";
    cin >> current_balance;
    cout << "************************************\n";
   
    cout << "\nAccount number: " << account_number << endl;
    cout << "Account Type: " << account_type << endl;

    if (account_type == 's' || account_type == 'S')
    {
        if (current_balance < minimum_balance)
        {
            current_balance -= 10;
            current_balance += (current_balance * 0.04);
            cout << "Current balance: $" << current_balance << endl;
            cout << "You have been charged $10.00 as service charges\nYou have been given interest 4%" << endl;
        }
        else
        {
            current_balance += (current_balance * 0.04);
            cout << "Current balance: $" << current_balance << endl;
            cout << "You have been given interest 4%" << endl;
        }
    }
    else if (account_type == 'c' || account_type == 'C')
    {
        if (current_balance < minimum_balance)
        {
            current_balance -= 25;
            current_balance += (current_balance * 0.03);
            cout << "Current balance: $" << current_balance << endl;
            cout << "You have been charged $25.00 as service charges\nYou have been given interest 3%" << endl;
        }
        else
        {
            if (current_balance >= (minimum_balance + 5000))
            {
                current_balance += (current_balance * 0.05);
                cout << "Current balance: $" << current_balance << endl;
                cout << "You have been given interest 5%" << endl;
            }
            else
            {
                current_balance += (current_balance * 0.03);
                cout << "Current balance: $" << current_balance << endl;
                cout << "You have been given interest 3%" << endl;
            }
        }
    }
    else
    {
        cout << "Invalid account type" << endl;
    }

    return 0;
}


Comments

Popular posts from this blog

88: Using switch statement Write a C program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and Computer. Calculate percentage and grade according to following: // Percentage >= 90% : Grade A Percentage >= 80% : Grade B Percentage >= 70% : Grade C Percentage >= 60% : Grade D Percentage >= 40% : Grade E Percentage < 40% : Grade F

205: Book Catalog: Define a struct to represent a book with attributes like title, author, and publication year. Write a program to create a catalog of books by taking user input and display books published after a certain year.

15: Take input of age and name of 3 people by user and determine oldest and youngest among them with his age. -_-_-_-_-_-_-_-_-(line with spaces input concept)-_-_-_-_-_-_-_-_