Question: Hello! I just need some help debugging my getNewDep method. Essentially, I am trying to get user to input deposit amount and store this value
Hello! I just need some help debugging my getNewDep method. Essentially, I am trying to get user to input deposit amount and store this value into array DEPOSIT so I can output deposit values and sum of values later. Basically, if user selects to add a new deposit then they should be able to add one value at that time before they are brought back to main menu. I've only ever done this in C but Im having trouble converting the concept to JAVA. All help is appreciated!!!
static String userChoice;
public static void mainString args
final int MAXDEPS ;
double DEPOSIT new doubleMAXDEPS;
double count;
System.out.printlnHello please review the menu below and make a selection!";
do
userChoice getChoiceuserChoice;
switch userChoice
case A:
addNewDepDEPOSIT MAXDEPS, count;
break;
case V:
depHistoryDEPOSIT count;
break;
case E:
System.out.printlnYou are now exiting the program, have a great day!";
break;
default:
System.out.printlnInvalid selection. Please make a valid selection";
break;
whileuserChoice.equalsE;
public static String getChoiceString userChoice
System.out.println;
System.out.println MAIN MENU ;
System.out.printlnAdd New Deposit";
System.out.printlnView Deposit History";
System.out.printlnExit;
System.out.println;
Scanner choice new ScannerSystemin;
userChoice choice.next;
return userChoice;
public static void addNewDepdouble DEPOSIT, int MAXDEPS, double count
Scanner sc new ScannerSystemin;
System.out.printlnPlease enter in the amount to deposit: ;
double userDeposit scnextDouble;
ifuserDeposit
DEPOSITcount userDeposit.nextDouble;
count;
System.out.printlnDeposit successful!";
if userDeposit
System.out.printlnInvalid value entered";
return;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
