Answer to Question #217179 in C++ for Chirag

Question #217179

Kamal would like to withdraw X Rs from an ATM. The cash machine will

only accept the transaction if X is a multiple of 100, and kamal's account balance has enough cash to

perform the withdrawal transaction. For each

successful withdrawal the bank charges 50 Rs. Calculate Kamal's account

balance after an attempted transaction.


1
Expert's answer
2021-07-14T18:30:35-0400
#include<iostream>
using namespace std;
int main(){
	int karmal_original_amount = 10000; //The originL value can be modified
	int X;
	cout<<"Enter amount for withdrawal "<<endl;
	cin>>X;
	int account_balance;
	if(X% 100==0){
		 account_balance = karmal_original_amount - X;
	}
	else{
		cout<<"The amount for withdrawal is not a multiple of 100 \n";
		account_balance = karmal_original_amount;
	}
	cout<<"Kamal's account balance after the attempted transaction is \t"<<account_balance;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS