subject

LAB: Divide input integers Write a program using integers userNum and divNum as input, and output userNum divided by divNum three times. Note: End with a newline.
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).
import java. util. Scanner;
public class LabProgram {
public static void main(String[] args) {
/* Type your code here. */
}
}
(My professor wants us to use this temple and I'm not sure how I should start typing the code were it says "type code here". I've tried differnt forms like the one provided below but they all have errors according to the program. it tells me that i have to place ; .
import java. util. Scanner;
public class LabProgram {
public static void main(String[] args) {
userNum= int(input())
divNum= int(input())
# calculating the division three times
userNum=userNum//divNum
#i have used end=' ' so that it does not produce new line
# instead of that it produce space
print(userNum, end=' ')
userNum=userNum//divNum
print(userNum, end=' ')
userNum=userNum//divNum
print(userNum, end=' ')
}
}
Errors:
Program errors displayed here
LabProgram. java:5: error: '.class' expected userNum= int(input()) ^ LabProgram. java:5: error: ';' expected userNum= int(input()) ^ LabProgram. java:6: error: '.class' expected divNum= int(input()) ^ LabProgram. java:6: error: ';' expected divNum= int(input()) ^ LabProgram. java:7: error: illegal character: '#' # calculating the division three times ^ LabProgram. java:7: error: ';' expected # calculating the division three times ^ LabProgram. java:7: error: ';' expected # calculating the division three times ^ LabProgram. java:9: error: illegal character: '#' #i have used end=' ' so that it does not produce new line ^ LabProgram. java:9: error: ';' expected #i have used end=' ' so that it does not produce new line ^ LabProgram. java:9: error: ';' expected #i have used end=' ' so that it does not produce new line ^ LabProgram. java:9: error: ';' expected #i have used end=' ' so that it does not produce new line ^ LabProgram. java:9: error: ';' expected #i have used end=' ' so that it does not produce new line ^ LabProgram. java:9: error: ';' expected #i have used end=' ' so that it does not produce new line ^ LabProgram. java:10: error: illegal character: '#' # instead of that it produce space ^ LabProgram. java:10: error: ';' expected # instead of that it produce space ^ LabProgram. java:10: error: ';' expected # instead of that it produce space ^ LabProgram. java:10: error: ';' expected # instead of that it produce space ^ LabProgram. java:11: error: ';' expected print(userNum, end=' ') ^ LabProgram. java:12: error: ';' expected userNum=userNum//divNum ^ LabProgram. java:13: error: ';' expected print(userNum, end=' ') ^ LabProgram. java:14: error: ';' expected userNum=userNum//divNum ^ LabProgram. java:15: error: ';' expected print(userNum, end=' ') ^ 22 errors

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:20
Cengagenowv2 is a comprehensive online learning tool. using cengagenowv2, you may access all of the following except: 2. each time you log in, cengagenowv2 automatically performs a system check and informs you if your computer does not meet the cengagenowv2 system requirements. 3. which tab/page allows you to easily track your assignment scores, number of submissions, time spent, as well as the ability view assign
Answers: 3
question
Computers and Technology, 22.06.2019 17:40
Consider the simple 3-station assembly line illustrated below, where the 2 machines at station 1 are parallel, i.e., the product only needs to go through one of the 2 machines before proceeding to station 2.what is the throughput time of this process?
Answers: 2
question
Computers and Technology, 23.06.2019 06:20
Which text function capitalizes the first letter in a string of text? question 10 options: upper capital first proper
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Now, open this passage to read about fafsa requirements. describe the information you will need to provide in order to complete a fafsa. list at least three of the required documents you must include.
Answers: 3
You know the right answer?
LAB: Divide input integers Write a program using integers userNum and divNum as input, and output u...
Questions
question
Mathematics, 11.03.2021 19:40
question
Mathematics, 11.03.2021 19:40
question
Mathematics, 11.03.2021 19:40
question
English, 11.03.2021 19:40
question
Computers and Technology, 11.03.2021 19:40
question
Mathematics, 11.03.2021 19:40
question
Mathematics, 11.03.2021 19:40
Questions on the website: 13722367