Answer:
Question 1:
int numUsers = scnr.nextInt();
Question 2:
public class OutputExample {
public static void main (String [] args) {
int numCars = 99;
Scannerscnr=new Scanner(System.in);
numCars=scnr.nextInt();
System.out.println("There are "+numCars+" cars");
return;
}
}
Question 3:
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 is: "+userNum);
return;
}
}
Explanation:
In Question 1, the statement int numUsers = scnr.nextInt(); reads a new integer value from the keyboard and assigns it to the variable numUsers.
In question 2, Concatenation is used to format the print output.
In question 3, care is taken to fix each of the syntax errors (missing double quotes, semi-colon, concatenation)
Answer:
a combined device for modulations and demodulations
Answer:
Following are the code to this question:
list_val = input()#defining a integer variable for input value
test_grades = list(map(int, list_val.split()))#defining test_grades as a list
sum_extra = -999 #defining sum_extra that holds negative integer value
sum_extra = 0#defining sum_extra that holds value
for y in range(len(test_grades)):#defining a for loop to check range of list
if(test_grades[y] > 100):# defining if block that check list value is greater then 100
sum_extra = sum_extra + (test_grades[y] - 100)#use sum_extra variable to hold extra value and add this value
print('Sum extra:', sum_extra)#print value
Output:
101 83 107 90
Sum extra: 8
Explanation:
In the above code a, "list_val" variable is declared, that uses an input method to input the values and declared a "test_grades" variable that uses a list method to add all values in the list.
In the next step, the "sum_extra" variable is declared, which holds some values and defines a for loop to check the range of the "test_grades", and define a if block, that checks list value is greater than 100. If the condition is true, it will remove the extra value, and add it into the sum_extera variable and add its value, and at the last use, print variable to print its value.
I think it should be Java of package instead
Answer: (B) Router
Explanation:
A router is one of the type of virtual and the physical networking device which helps in forwarding the message in the form of data packets in the computer system.
- The main function of the router is that it sends the message over the internet in the form of email and web page.
- The router sending the data packets by assigning each device a local internet protocol address in the networking.
According to the given question, the router is refers to the Device-B so that it can communicate in normal circumstances in workstation. Therefore, Option (B) is correct.