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

How to error check and bring back the loop back to the question,if the user inpu

ID: 440699 • Letter: H

Question

How to error check and bring back the loop back to the question,if the user inputs a letter instead of a number ? case 2: System.out.println ("Enter the amount you want to withdraw:"); withdraw = keyboard.nextInt(); /////////////////////////////////////////////////////////// switch(checkOrSave) { case 1: if(che > withdraw) { System.out.println ("Your Receipt" ); System.out.println (" Previous balance: $ " + che); balWith = che - withdraw; System.out.println (" Current balance: $ " + balWith); System.out.println (" You made a withdrawal of : $ " + withdraw); } else { System.out.println ("Not enough balance cannot withdraw"); }

Explanation / Answer

include #include #include void main(void) { int val_a; int val_b; int result; printf("Write a number A="); scanf("%d", &val_a); if(isdigit(val_a)) { printf(" Write a number B="); scanf("%d", &val_b); } else printf(" I said number. "); result = val_a + val_b; printf("%d + %d = %d", val_a, val_b, result); getch(); printf(""); \ to clear the screen } please rate me
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote