(Solved) : 219 Lab Divide X Write Program Using Integers User Num X Input Output Usernum Divided X Th Q44081258 . . .
please help i wrote and ran the code but i amstill getting errors
2.19 LAB: Divide by x Write a program using integers user Num and x as input, and output userNum divided by x three times. Ex: If the input is: 2000 2 the output is: 1000 500 250 Note: In Java, integer division discards fractions. Ex 6/4 is 1 (the 0.5 is discarded). LAB ACTIVITY 2.19.1: LAB: Divide by x LabProgram.java 1 import java.util.Scanner: 51 3 public class LabProgram [[ public static void main(String[] args) { scanner sehr new Scanner(System.in); int userNumscnr .nextInt(): int X – scnr.nextInto; System.out.println(userNun/x+” ” userNum/(2x)” ” userNum/(4x): ) 10 11 ) WOLL.Jurer, public class LabProgram! public static void main(String[] args) { scanner sehr new Scanner(System.in); int user u ser.nextInto: int X – scnr.nextInto; System.out.println(userNum/x.” “-userNum/(2*x)+””+ user Num/(4x)); Ne Develop mode Submit mode Run your program as often as you’d like, before submitting for grading Below, type any nee input values in the first box, then click Run program and observe the program’s output in th second box Enter program input (optional) 2000 2 Run program Input (from above) – La Program.java Your program) – Output (shown below) Program errors displayed here LabProgram.java:4: error: illegal start of expression public static void main(String[] args) Lerror Feedback? Show transcribed image text 2.19 LAB: Divide by x Write a program using integers user Num and x as input, and output userNum divided by x three times. Ex: If the input is: 2000 2 the output is: 1000 500 250 Note: In Java, integer division discards fractions. Ex 6/4 is 1 (the 0.5 is discarded). LAB ACTIVITY 2.19.1: LAB: Divide by x LabProgram.java 1 import java.util.Scanner: 51 3 public class LabProgram [[ public static void main(String[] args) { scanner sehr new Scanner(System.in); int userNumscnr .nextInt(): int X – scnr.nextInto; System.out.println(userNun/x+” ” userNum/(2x)” ” userNum/(4x): ) 10 11 )
WOLL.Jurer, public class LabProgram! public static void main(String[] args) { scanner sehr new Scanner(System.in); int user u ser.nextInto: int X – scnr.nextInto; System.out.println(userNum/x.” “-userNum/(2*x)+””+ user Num/(4x)); Ne Develop mode Submit mode Run your program as often as you’d like, before submitting for grading Below, type any nee input values in the first box, then click Run program and observe the program’s output in th second box Enter program input (optional) 2000 2 Run program Input (from above) – La Program.java Your program) – Output (shown below) Program errors displayed here LabProgram.java:4: error: illegal start of expression public static void main(String[] args) Lerror Feedback?
Expert Answer
Answer to 2.19 LAB: Divide by x Write a program using integers user Num and x as input, and output userNum divided by x three time…
OR