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
Which would be the most efficient way to store files on your computer?
lorasvet [3.4K]

Answer:

Best way to store all your files is a external storage device, like a hard drive or a usb stick, copy all your files to the device and keep it in a safe place.

3 0
3 years ago
In order to print multiple worksheets, what needs to happen before printing?
ryzh [129]

Answer:

Explanation:

Click the File tab.

Click Print, or press the control p keyboard command.

On the Print screen, select the printer and other settings.

Click Print.

7 0
3 years ago
DSSS uses a chipping code to encode redundant data into the modulated signal. Which two of the following are examples of chippin
Schach [20]

Answer:

Option A and Option D

Explanation:

5 0
4 years ago
Its inventiveness uncertainty and futuristic ideas deals with science and technology,what is it?
Sedaia [141]

Answer:

Capital FM

Explanation:

8 0
3 years ago
Which technology is used to uniquely identify a wlan network?
expeople1 [14]
The answer is SSID

SSID which in full stands for Service Set Identifier is used to identify a network. It ensures that clients are able to locate a WLAN in which they are attached to. In Layman’s terms, it’s the username or the primary name in a WiFi setup in which a user joins and is connected to.






8 0
3 years ago
Other questions:
  • When a number gets assigned to a variable that already has a value __________?
    6·1 answer
  • Rest or take a break every __ minutes when typing. Please help!
    5·2 answers
  • You just recently opened a business that will be selling items on the Internet. You don’ t actually have a physical store that p
    13·1 answer
  • Differences of a desktop computer and a laptop
    13·1 answer
  • Tuesday
    10·1 answer
  • Which of the following statements about security in the network is true?
    15·1 answer
  • A computer has __________processing device
    13·1 answer
  • explain why the database system would not allow a tuple to be inserted into the database through this view
    12·1 answer
  • What are two reasons to tie cables up and out of the way inside a computer case?
    9·1 answer
  • In C++ please (read the image below for instructions)
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!