Question: QUESTION 3 (7 MARKS) Write a program which simulates four transactions on a Visa credit card account. Initially the account has a balance of-$113. Each

 QUESTION 3 (7 MARKS) Write a program which simulates four transactions

on a Visa credit card account. Initially the account has a balance

of-$113. Each transaction is either a negative amount (a credit card purchase)

QUESTION 3 (7 MARKS) Write a program which simulates four transactions on a Visa credit card account. Initially the account has a balance of-$113. Each transaction is either a negative amount (a credit card purchase) or a positive amount (a payment). The amount of each transaction (purchase or payment) is a random integer between 15 and 200 inclusive. Below are the three statements which initialise the variables. Copy and paste them into your program. initial balance-113 transaction min15 transaction max 201 #1 bigger than the maximum In the output, the amount of each transaction is displayed inside parentheses following the balance (after the transaction has been applied). The final two lines of output show the final balance and the overall sum of the four transactions. Note that there are 35"symbols in the two lines enclosing the final two lines of output. Hint: in order to create a transaction which is either a purchase or a payment you will find it useful to generate a random number which is either-1 or 1The random transaction amount is then multiplied by this number Below are two example outputs using the completed program. Your program must give a correct output in exactly the same format as the outputs in the two examples below: Initial visa balance(dollars):-11.3 1 294 (-181) 2: -119 (175) 3 65 (184) 4 254 (189) Final Visa balance (dollars) : 254 Sum of transactionst $367 Initial Visa balance (dollars113 1 -295 (-182) 2 -274 (21) -129 (145) -289 (-160) Final Visa balance (dollars) :-289 Sum of transactions: $-176

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!