The correct answer is B.UPS
A UPS or Uninterruptable Power supply makes
sure that you have backup in case there is a power outage in your area. It
provides ample time for you to save all files before shut down.
Answer:
"Option 1: To the end of an array." is the correct answer.
Explanation:
The word "Append" means adding to the end of a document.
Appending means whatever new content is added, it is added at the end of the document or data structure.
Similarly,
Appending an array means adding new elements to the end of the array.
Hence,
"Option 1: To the end of an array." is the correct answer.
Answer:
- import java.util.Arrays;
- import java.util.Scanner;
-
- public class Main {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- double distances [] = new double[7];
-
- for(int i=0; i < distances.length; i++){
- System.out.print("Input running distance for day " + (i+1) + ": ");
- distances[i] = input.nextDouble();
- }
-
- System.out.println(Arrays.toString(distances));
- }
- }
Explanation:
The solution code is written in Java.
Firstly, create a Scanner object to get user input for running distance (Line 6). Next, declare a distances array and set the array size to 7 because we intend to use this array to hold running distance for 7 days per week.
Next, use the for loop that run for 7 times to repeatedly prompt user to input running distance for each day and store each value to the array distances (Line 9 -12).
At last, display the array to console terminal (Line 14).