Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am using C++ to write up a credit card simulator. I have already written the file and it compiles, however the code is not

I am using C++ to write up a credit card simulator. I have already written the file and it compiles, however the code is not running like the sample run below. A link to the completed project file is below. Data is stored in text files by account number so that you may run the program multiple times with the same account. The program should run like the following.

A sample/session might be (items in bold are user inputs):

Welcome to the Credit Card simulator!

Existing account or new (E/N): N

Your account number will be: 999999999

Your Credit Limit: $1000.00

Account: 99999999

Outstanding Balance: 0.00

Credit Limit: 1000

Available Credit: 1000

Transaction Options:

0.Quit

1.New Charge

2.Payment

3.Credit Increase Request

4.Card History

Choice: 1

Charge Amount: 100.00

Charge Description: Gas

Account: 99999999

Outstanding Balance: 100.00

Credit Limit: 1000.00

Available Credit: 900.00

Transaction Options:

0.Quit

1.New Charge

2.Payment

3.Credit Increase Request

4.Card History

Choice: 2

Payment Amount: 25

Account: 99999999

Outstanding Balance: 75.00

Credit Limit: 1000

Available Credit: 925.00

Transaction Options:

0.Quit

1.New Charge

2.Payment

3.Credit Increase Request

4.Card History

Choice: 3

Requested Increase: 250

Sorry, but your credit increase cannot be granted at this time.

Account: 99999999

Outstanding Balance: 75.00

Credit Limit: 1000

Available Credit: 925.00

Transaction Options:

0.Quit

1.New Charge

2.Payment

3.Credit Increase Request

4.Card History

Choice: 4

Transaction Log History:

Account 99999999 created, 8/1/2008 10:00:00am

Charge: 100, Gas, 8/1/2008 10:05:00am

Payment: 25, 8/5/2008 4:00:00pm

Limit Increase: 250, declined, 8/6/2008 8:00:00

Account: 99999999

Outstanding Balance: 75.47

Credit Limit: 1000

Available Credit: 924.53

Transaction Options:

0.Quit

1.New Charge

2.Payment

3.Credit Increase Request

4.Card History

Choice: 0

Thanks for using the credit card simulator!

The CREDIT CARD class should handle the normal activities related to a credit card: a) creating the account, b) making charges and payments, and c) updating the credit balance and credit limits. In addition, the Credit Card class will keep account status and transaction histories in text files.

Develop the Credit Card class according to the following guidelines:

1)The class should either create a new account or load an old account if a valid account number is given. This would involve 2 constructors: one that takes no account number (and generates a new account) or one that accepts an account number and reads in the current values for the account. In the case of a new account, the Credit Card number should be a randomly generated value while the starting credit limit will be $1000. In the case of an existing account, you must verify that the account actually exists (i.e., there is already a non-empty account status file). The account status (only) data should be stored in a text file named as follows: CC + Account Number + .txt.

2) Methods for processing transactions must be included. These increase and decrease the credit card balance along with the remaining credit. Make sure that the operator cannot exceed his/her credit limit with any given charge amount. Each transaction should be stored in a credit card log file, with name as follows: CCL + account number + .txt

3)Allow for a request for a credit increase; increases are granted in $100 increments. Use a random number generator to determine whether a credit increase request is granted or denied.

4)The display of the transaction log is to be done in the view program (the program with main()) there should not be any screen output done by the Credit Card Class. Each transaction log entry is time-stamped when posted to the file (as seen from the sample run).

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Here is a link to my file.

https://1drv.ms/u/s!AjLswKvo9tl3hC2zaa6pkyiVbKRj

When you first run the program, the option of New or Existing acount is brought up. Hit N for new and write down the account number. Re-run the program and hit E for existing account number and enter the account number the program generated the last time you ran it. That will bring up the menu options. One thing is that when a new account is given, the account information should be displayed and not have to be re-run to view the display of the account info to the user. When a payment is made, it should reflect the available credit and account balance like the sample run above. Again, these are small fixes and should not take long at all to sort out. Be sure you post a screenshot of the output of the program so that it matches the sample run above. Thank you in advance.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions