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
Using the _______ list, you can select the number of photos that will appear on each slide.
Svetach [21]

Answer:

Picture Layout

Explanation:

There 4 options for this question:

A. Theme

B. Frame shape

C. Picture layout

D. Pictures in album

We can do an images design with the option (Picture Layout) we can add different images with text and some default layout when you click on picture layout, you will see all the example and if you pass the mouse over the examples, you will see a preview of the layout, this option helps us to make a design with different picture in one slide.

4 0
4 years ago
Im drinking coffee. and working on school and watching a show. Whos with me?
Keith_Richards [23]

Answer:

me, americano and treasure box

Explanation:

4 0
3 years ago
Write a converter program for temperatures. This program should prompt the user for a temperature in Celsius. It should then con
Aleksandr [31]

Answer:

c = float(input("Enter the temperature in Celsius: "))

f = c * 1.8 + 32

print("The temperature in Fahrenheit: " + str(f))

k = (f - 32) / 1.8 + 273.15

print("The temperature in Kelvin: " + str(k))

Explanation:

*The code is in Python.

Ask the user to enter the temperature in Celsius

Convert the Celsius to Fahrenheit using the conversion formula and print it

Convert the Fahrenheit to Kelvin using the conversion formula and print it

3 0
3 years ago
Which of the following is a disadvantage of using face-to-face communication over other communication channels? A) There is lag
Tems11 [23]

Answer:

Option B is correct.

Explanation:

The drawback to choosing face-to-face contact across certain platforms of interactions is that it is always impracticable to plan a schedule for face-to-face conversation because mostly the time of both participants should not be the same, sometime the one person wait for the other person or the other person wait for 1st one.

  • The following problems occur through the internet, the system configuration or the browsers, application configuration.
  • So, the following are the reasons that describe the other options are not appropriate according to the scenario.
7 0
3 years ago
You view a portion of a document on the screen through a ____.
alekssr [168]

You view a portion of a document on the screen through a C. Document window

- Mabel <3

8 0
3 years ago
Other questions:
  • What does the "configure dhcp options for proxy dhcp" option do?
    13·1 answer
  • Which is true about POP3 and IMAP for incoming email?
    6·1 answer
  • Which scientific law states that if a light source radiates isotropically, the light intensity falls off the further you get fro
    5·1 answer
  • Answer the following questions which are based on the study "Patients' Engagement with Sweet Talk." Submit your answers to the e
    9·1 answer
  • Ada lovelace designed the first computer
    7·1 answer
  • Please help. 15 points!!!!
    8·2 answers
  • Moore's Law postulates that:This task contains the radio buttons and checkboxes for options. The shortcut keys to perform this t
    6·1 answer
  • You are asked to write a program that prompts the user for the size of two integer arrays, user input for the size must not exce
    13·1 answer
  • How do you give people a brianly i am knew as u can tell
    6·2 answers
  • Assignment 1:
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!