subject

1. type a statement that reads a user-entered integer into variable numusers. assume scnr already exists.

2.write a statement that outputs variable numcars as follows. end with a newline.
there are 99 cars.
note: whitespace (blank spaces / blank lines) matters; make sure your whitespace exactly matches the expected output.
public class outputexample {
public static void main (string [] args) {
int numcars = 99;
scannerscnr=new scanner(system. in);
numcars=scnr. nextint();
system. out. println(numcars);
return;
}
}

3. type the statements. then, correct the one syntax error in each statement. hints: statements end in semicolons, and string literals use double quotes.

system. out. printl("predictions are hard.");
system. out. print("especially ');
system. out. println("about the future.").
system. out. println("num is: " - usernum);
import java. util. scanner;

public class errors {
public static void main(string [] args) {
int usernum = 5;

system. out. println ("predictions are hard. ");
system. out. print("especially '");
system. out. print("about the future.");
system. out. println("num: "- usernum);
return;
}
}

errors. java: 10: operator - cannot be applied to java. lang. string, int system. out. println("num: "- usernum); ^ 1 error

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:00
When is it appropriate to use an absolute reference
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Why is an outfitting a workspace with video games in a technology development company considered a strategic use of money
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
(, urgent need): how do i change my username
Answers: 1
You know the right answer?
1. type a statement that reads a user-entered integer into variable numusers. assume scnr already ex...
Questions
question
Mathematics, 09.12.2019 03:31
question
Social Studies, 09.12.2019 03:31
Questions on the website: 13722363