Answer:
Explanation:
One group of students did an experiment to study the movement of ocean water. The steps of the experiment are listed below.
Fill a rectangular baking glass dish with water.
Place a plastic bag with ice in the water near the left edge of the dish.
Place a lighted lamp near the left edge of the dish so that its light falls directly on the plastic bag.
Put a few drops of ink in the water.
The student did not observe any circulation of ink in the water as expected because the experiment had a flaw. Which of these statements best describes the flaw in the experiment? (2 points)
Not enough ink was added.
Not enough water was taken.
The dish was too small for the experiment.
The lamp and the ice bag were at the same place.
Answer:
The complete program is:
import java.util.Scanner;
class Main
{
public static void main (String [] args) {
int numObjects;
Scanner scnr = new Scanner(System.in);
numObjects = scnr.nextInt(); // Program will be tested with values: 15, 40.
System.out.println(numObjects);
}
}
Explanation:
The program is as mentioned above, And we can check with inputs 15, and 40. And it was found that correct answer is obtained on running the program.
Answer:
import java.util.Scanner;
class Main {
public static int calcSeries(int n) {
int sum = 0;
for(int i=10; i>=n; i--) {
sum += i;
}
return sum;
}
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
int n = 0;
do {
System.out.print("Enter n: ");
n = reader.nextInt();
if (n >= 10) {
System.out.println("Please enter a value lower than 10.");
}
} while (n >= 10);
reader.close();
System.out.printf("sum: %d\n", calcSeries(n));
}
}
Library books and items bought in stores are 2 different applications that make use of barcodes.