1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Amanda [17]
3 years ago
6

Modify the provided code file to create a workout tracking program that lets the user enter (from the console) the distance they

ran each day of the week. Store each value into an array of doubles named distances
Computers and Technology
1 answer:
koban [17]3 years ago
3 0

Answer:

  1. import java.util.Arrays;
  2. import java.util.Scanner;
  3. public class Main {
  4.    public static void main(String[] args) {
  5.        Scanner input = new Scanner(System.in);
  6.        double distances [] = new double[7];
  7.        for(int i=0; i < distances.length; i++){
  8.            System.out.print("Input running distance for day " + (i+1) + ": ");
  9.            distances[i] = input.nextDouble();
  10.        }
  11.        System.out.println(Arrays.toString(distances));
  12.    }
  13. }

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).

You might be interested in
Why is the cpu the most important component in a computer?
german
CPU (Central Processing Unit) is also known as the brain of the computer because this is the place which actually runs the programs. The programs are the set of instructions needed to perform a task.
4 0
3 years ago
What department is cyber security
Paul [167]

Answer:

United States Department of Homeland Security

The National Cyber Security Division (NCSD) is a division of the Office of Cyber Security & Communications, within the United States Department of Homeland Security's Cybersecurity and Infrastructure Security Agency.

<em>Give</em><em> </em><em>me</em><em> </em><em>brainliest</em><em> </em>

8 0
3 years ago
Read 2 more answers
The two major types of system software programs are utility programs and the ________. Select one: A. user interface B. supervis
Scrat [10]

Answer:

operating system

Explanation:

System software are those programs that many refer to as computer programs. The most basic function of system software is to manage the computer systems. It acts as an interface between the computer’s hardware and the end user. System software converts instructions that end users give to the computer into a machine understandable language. Examples of system software include operating systems, utility programs, device drivers, and windows systems. The operating system is responsible for the functioning of all the computer’s hardware parts. It is the software loaded into the system when the computer boots up. It manages everything, from the memory, to the CPU, and many other different tasks.

8 0
3 years ago
Frank lives in an area that experiences frequent thunderstorms. What precautionary measure should he adopt?
Sonja [21]

Answer:

I would go with A

Explanation:

6 0
3 years ago
Which of the following is true about the Purpose of the Page and the Page Quality (PQ) rating? Select all that apply. True False
aleksandr82 [10.1K]

Answer:

Explanation:

Harmful or malicious pages should always get a page quality (PQ) rating of Lowest. True

Pages with an informational or educational purpose should always be given higher page quality (PQ) ratings than entertainment or gossip pages. False

There is no relationship between the purpose of the page and the page quality (PQ) rating. False

If you cannot determine the purpose of the page after extensive effort, the page quality (PQ) rating should be Lowest. True

7 0
3 years ago
Other questions:
  • Blood alcohol level is the ratio between the alcohol consumed and the blood in the body
    10·1 answer
  • What is the digital divide? What does the digital divide mean for the world?
    9·1 answer
  • A collection of methods that can be used by any class, as long as the class provides a definition to override the collection's a
    5·1 answer
  • The ____ command is used to disconnect a datatable object from the database. (
    15·2 answers
  • A user reports that a workstation is continually rebooting. What can a technician do to stop the rebooting in order to troublesh
    12·1 answer
  • Write a c++ program to print even numbers from 1 to 20​
    15·1 answer
  • Which of the following would not be stored in a cell ?
    14·1 answer
  • Which transform function would you use to operate the filename values into two separate columns, one for the filename and the ot
    15·1 answer
  • What two functions does tcp/ip perform?
    15·1 answer
  • The involvement of the United States in the ______ and ______ resulted in _______ .
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!