what is wrong with this code? identifier errors and fix it import java.util.Scanner; public class HandsOn
Question:
what is wrong with this code? identifier errors and fix it
import java.util.Scanner;
public class HandsOn {
public static void main(String[] args){
int val = 0;
int count = 0;
Scanner in = new Scanner(System.in);
System.out.println("Enter a value: ");
val = in.nextInt();
System.out.println("Enter a number to multiply the doubled Value by: ");
count = in.nextInt();
static int doubleMe(int val) {
return val*2;
}
static int quadrupleMe(int val) {
int quad = doubleMe(val);
return quad*2;
}
static int doubleMeTimes(int val, int count) {
for(int i = 1; i <= count; i++) {
times = doubleMe(val);
}
return times;
}
System.out.println("Value: " + val);
System.out.println("Value Doubled: " + val);
System.out.println("Value Quadrupled: " + quad);
System.out.println("Value Doubled and Multiplied by count: " + times);
}
}
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates