Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

help programing in C. Bank Balance - Get the cost from the user, print if they h

ID: 3746058 • Letter: H

Question

help programing in C.

Bank Balance - Get the cost from the user, print if they have enough funds. 1 Finclude The user will start out with $100.00 in their bank. The program should read the cost of item they are buying. If the cost of the itenm is more than the funds in the bank Then the program should print insufficient funds. Otherwise The program should print the balance in their bank. For example, if the input value is 110.00, then the output of the program should be 3 int main(void) f 4 double bankValue 6 //initialize the value in the bank Insufficient Funds 9 10 // get the cost of the item from the user double itemCost; if the input value is 65.00, then the output of the program should 12 13 14 15 16 17 //use a decision statement to check if the amount is greater than the bankValue //if so, print insufficient funds //otherwise, print the balance Your bank balance 1s $35.00 Hints You will need to use an if statement to check if the cost of the item is greater than the amount in the bank . return e;

Explanation / Answer

#include int main() { double bankValue; bankValue = 100; double itemCost; scanf("%lf", &itemCost); if(itemCost > bankValue) { printf("Insufficient Funds"); } else { printf("Your bank balance is $%.2f", bankValue-itemCost); } return 0; }