I am writing what I hear is a very basic program. However, I am still learning how to decipher these hieroglyphics so you may be able to relate to my madness when you were just beginning. I actually got a good portion of it written through pointers in the book I am using but I'm having trouble coming up with code for each case. Any pointers or suggestions would be greatly appreciated.
Thank you
#include <iostream>
#include <iomainip> // for 'fixed' and 'setprecision'
// function main begins program execution
int main ()
{
double account1 = 100;
double account2 = 50;
// display initial balance of each account
std::cout << "Account 1 balance: $500" << std::setprecision (2) << std::fixed << account1 <<
std::endl;
std::count << "Account 2 balance: $1000" << std::setprecision (2) << std::fixed <<account2 <<
std::endl;
// a variable to hold their choice
int selection = 0;
// a variable to track the number of transactions
int transactions = 0;
while (selection != 5)
{
// Display a menu to the user
// You MUST use thee integer values (1-5) for the auto evaluator to work
std::cout << "(1) to debit account 1" << std::endl;
std::cout << "(2) to debit account 2" << std::endl;
std::cout << "(3) to transfer from account 1 to 2" << std::endl;
std::cout << "(4) to transfer from account 2 to 1" << std::endl;
std::cout << "(5) to exit" << std::endl; // sentinel value
// Ask the user for their choice
std::cout << "What would you like to do? ";
std:cin >> selection;
// Use a switch statement to detect their option switch (selection)
{
case 1;
// Write code to debit account1
// Aske the user for an amount
// debit the account if possible
// done
break;
case 2:
// Write code to transfer from account 1 to account 2
// Write code to transfer from account 1 to account 2
// Ask the user for an amount
// transfer the amount if possible
// done
break;