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, 23.06.2019 00:00
Which is the correct sequence of steps to set up a document in landscape orientation? a. select page setup from the file menu. then click the margins tab and select landscape. b. select page setup from the edit menu. then click the margins tab and select landscape. c. select page setup from the insert menu. then click the margins tab and select landscape. d. select page setup from the format menu. then click the margins tab and select landscape
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
Why is investing in a mutual fund less risky than investing in a particular company's stock? a. mutual funds only invest in blue-chip stocks. b. investments in mutual funds are more liquid. c. mutual funds hold a diversified portfolio of stocks. d. investments in mutual funds offer a higher rate of return.
Answers: 2
question
Computers and Technology, 23.06.2019 14:00
How are stop motion special effects in animated films created
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
In the blank libreoffice writer document, to start the process of entering a date field into a letter, click on the insert menu. edit menu. file menu. fields menu.
Answers: 3
You know the right answer?
1. type a statement that reads a user-entered integer into variable numusers. assume scnr already ex...
Questions