re-arrange the shuffled code segments in the correct order.
Given a problem and correct (shuffled) program, re-arrange the shuffled code segments in the correct order.
Pin number should be of 4 digits, an exception should be thrown if the user enters more than 4 digits(refer to sample input and output)
The maximum amount that can be withdrawn is Rs.20000, an exception should be thrown if the user enters more than Rs.20000(refer to sample input and output.)
Consider a class named Atm with the following data members
Data type | Variable name |
int | pin |
double | amount |
The class Atm has the following constructor and method
Member Function | Description |
Atm(int pin,double amount) | Sets the values passed by parameters. |
void display() | This method displays the success message. |
Input and Output Format:
Refer sample input and output for formatting specifications
[All text in bold corresponds to input and the rest corresponds to output]
Sample Input and Output 1:
Welcome to IndusLand Bank ATM
Enter your pin number
12345
Exception: Pin number should be of 4 digit
Enter your valid pin number
1234
Enter the transaction amount
30000
Exception: Transaction amount exceeded, the limit is Rs.20000
Enter the transaction amount again
20000
Transaction successful, visit again
Sample Input and Output 2:
Welcome to IndusLand Bank ATM
Enter your pin number
4556
Enter the transaction amount
19000
Transaction successful, visit again
------------------ SHUFFLED PROGRAM PROVIDE IN ATTACH IMAGE KINDLY SEE . AND DON'T ADD ANY EXTRA CODE JUST RE-ARRANGE WITH PROVIDED SHUFFLED PROGRAM IN ATTACH IMAGE -------------------------
Step by step
Solved in 2 steps