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
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);
}
}
Step by Step Solution
3.40 Rating (141 Votes )
There are 3 Steps involved in it
Here are the issues with the code and suggested fixes 1 doubleM... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
663e56be298ff_957811.pdf
180 KBs PDF File
663e56be298ff_957811.docx
120 KBs Word File
