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

1 Expert Approved Answer
Step: 1 Unlock

Here are the issues with the code and suggested fixes 1 doubleM... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (2 attachments)

PDF file Icon

663e56be298ff_957811.pdf

180 KBs PDF File

Word file Icon

663e56be298ff_957811.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!