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
What is an independent data mart?
steposvetlana [31]

Answer: Independent data mart is the subset of data that is obtained from the data warehouse in independent form. Various traits are used for the display of the independent data marts.They are built in the independent manner from each other .

It is utilized by the organization for the analysis of the certain unit of data in compact form. Independent data mart does not persist the central data warehouse. The operational sources gets distributed in the independent section known as data marts. It is usually preferred by small organizations.

7 0
4 years ago
Constraints are a. quantities to be minimized in a linear programming model. b. quantities to be maximized in a linear programmi
svetoff [14.1K]

Answer: D

Explanation:

Constraints are associations between multiple variables which set boundaries for the values these variables can take at the same time. They put limit on values that variables can accommodate.

4 0
4 years ago
Which of the following is the process of writing the step-by-step instructions that can be understood by a computer?
Aleks04 [339]

Answer:

computer programming

Explanation:

says the answer in the question

5 0
3 years ago
"which type of network connects smart devices or consumer electronics within a range of about 30 feet (10 meters) and without th
Dimas [21]
The answer is PAN (Personal Area Network)

With the simple reference to Personal, this kind of network serves one individual rather than several users. It is an interconnection of IT devices within a range of an individual person. It could be used to sync data from a portable device like a PDA to a PC or a desktop computer or transfer data wirelessly to a printer.

 

 

 

 

 






7 0
3 years ago
Write a programme to find the sum of first three cube number?
aleksandrvk [35]

// Simple Java program to find sum of series

// with cubes of first n natural numbers

import java.util.*;

import java.lang.*;

class GFG {

/* Returns the sum of series */

public static int sumOfSeries(int n)

{

int sum = 0;

for (int x = 1; x <= n; x++)

sum += x * x * x;

return sum;

}

// Driver Function

public static void main(String[] args)

{

int n = 5;

System.out.println(sumOfSeries(n));

}

}

// Code Contributed by Mohit Gupta_OMG <(0_o)>

7 0
3 years ago
Other questions:
  • A dropped packet is often referred to as a _____________.
    7·1 answer
  • Which of the following is an occupation management group? Select the choice that best answers the question.
    15·1 answer
  • A user states that when they power on their computer, they receive a "Non-bootable drive" error. The user works with external st
    8·1 answer
  • What is the role of programmers in an organization?
    6·1 answer
  • A bitmap picture can be represented by hexadecimal numbers. Each two-digit hexadecimal number represents a row. To convert a num
    14·1 answer
  • How can you tell that you're driving in the right direction?
    14·1 answer
  • The velocity dimension of Big Data refers to _____.
    15·1 answer
  • Two strings, and , are called anagrams if they contain all the same characters in the same frequencies. For example, the anagram
    13·1 answer
  • Adobe reader is a type of​
    14·2 answers
  • In java I need help on this specific code for this lab.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!