Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

The Requirements: This will include a driver that tests a class namedAccount. This class has a member variable that is of classMoneyInCents. The .h and .cpp files forMoneyInCentsis attached to...

1 answer below »




The Requirements:








This will include a driver that tests a class namedAccount. This class has a member variable that is of classMoneyInCents. The .h and .cpp files forMoneyInCentsis attached to the assignment. There are three types of transaction: withdrawal, deposit, and show balance. All output will be collected in a text file.





Class Member Variables:




MoneyInCents balance;






    • This will hold the balance of the account







string holder;






    • A string object containing the account holder's name








Class Member Functions:


constructors:




Account(string accountHolder, MoneyInCents startingBalance);






Account();






    • Note: an account cannot exist without a holder or an initial balance of at least 1 cent. The default constructor should protect against this.





other member functions:


Note: use the functions ofMoneyInCentsas appropriate.




bool withdrawal(MoneyInCents);





    • This function accepts a MoneyInCents value

    • The function return false if anything goes wrong with the withdrawal

    • Otherwise, it updates the balance and returns true






bool deposit (MoneyInCents)





    • This function accepts a MoneyInCents value

    • The function return false if anything goes wrong with the deposit

    • Otherwise, it updates the balance and returns true






string convertAccount();





    • This function will convert the member variables into a display string

    • Example: balance is 12345 and holder is John Smith









Driver Program:


  • Write a program that will test the class.

  • The program should create an output file to collect the text output of the program.

  • There should be a controlling nested loop structure to allow for multiple accounts with multiple transactions. Only the inner loop should be menu driven.


For each account:


  • Display initial account information or an error message (in which case there are no transactions)

  • For each transaction:

    • Display the type of transaction

    • Call the transaction function

    • Display the account information or an error message









The submission to Blackboard will include three (3) program files, 1 Word file, and 1 text file (output) all uploaded to Blackboard separately (
NOT IN A ZIP FILE
) so that I can give you feedback directly in Blackboard:





  • CS3_YourLastName.cpp

    • Introductory comments should include

      • Your name

      • The title (Case Study Part 2)

      • The date

      • The purpose of the contents



    • Clean indenting and white space as needed

    • Separation comments to indicate the functions

    • Commenting when necessary to explain structure or algorithm selection






  • Account.h

    • Introductory comments should include

      • Your name

      • The title (Case Study Part 2)

      • The date

      • The purpose of the contents



    • Clean indenting and white space as needed

    • Separation comments to indicate the functions

    • Commenting when necessary to explain structure or algorithm selection




  • Account.cpp

    • Introductory comments should include

      • Your name

      • The title (Case Study Part 2)

      • The date

      • The purpose of the contents



    • Clean indenting and white space as needed

    • Separation comments to indicate the functions

    • Commenting when necessary to explain structure or algorithm selection






  • CS3_Console.docx



    • Test data and expected results









  • CS3_Output_YourLastName.txt


    • The output from the testing




Note: Do not include any Visual Studio files
Answered 1 days After Dec 11, 2022

Solution

Vikas answered on Dec 12 2022
45 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here