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 does c++ programming mean?
cestrela7 [59]

Answer:

It's an internal joke to say the language is basically C with some extra stuff (like classes)

the "++" is short for

C += 1 or

C = C + 1 which is a common calculation among programmers so they named it C++ to be a more commercial and attractive name than "C with classes"

Explanation:

8 0
2 years ago
Define power supply and types of power supply<br>​
emmainna [20.7K]

Answer:

hope you like it

Explanation:

Two types of power supplies exist, DC-DC and AC-DC. DC-DC power supplies allow you to plug in electrical devices into car outlets or similar sources that supply direct current, or DC, power. These power supplies are not the most commonly used, though.

Classification of Power Supply and Its Different Types

OUTPUT = DC OUTPUT = AC

INPUT = AC Wall wart Bench power supplies Battery charger Isolation transformer Variable AC supply Frequency changer

INPUT = DC DC-DC converter Inverter Generator UPS

4 0
2 years ago
cellPhoneBill(m,tx)Write the function cellPhoneBill()that takes two int m and txas input and returns a float.The function takes
lidiya [134]

Answer:

The solution code is written in C++

  1. float cellPhone(int m, int tx){
  2.    float COST_PER_MIN = 0.1;
  3.    float COST_PER_MESSAGE = 0.2;
  4.    
  5.    float bill_amount = m * COST_PER_MIN + tx * COST_PER_MESSAGE;
  6.    
  7.    return bill_amount;
  8. }

Explanation:

Firstly, declare a function named cellPhone() that takes two input parameters, m and tx (Line 1).

Since the policy of the carrier company is not given in the question, I make a presumption that the cost per minutes is $0.10 and the cost per message is $0.20 (Line 2- 3).

Next, apply the formula m * COST_PER_MIN + tx * COST_PER_MESSAGE to calculate the total bill (Line 5) and return the bill_amount as function output (Line 7).

4 0
3 years ago
Intel® Core™ i5-7500 is one of Intel's 7th generation of microprocessors and was launched earlier in 2017 and has been used in m
Ket [755]

Answer:

A. 4 CPUs and 6 megabyte cache memory

B. 1.3157 x10^-9 nanoseconds

Explanation:

The Intel core i5 7500 is a seventh generation central processing unit with a 4 CPU core and a 6 megabyte cache memory. It executes task at a clock cycle of 5 clock cycle at a speed of 3.8 GHz.

The relationship between frequency and clock cycle is,

Clock cycle = 1 / ( frequent).

So, One clock cycle = 1 / 3.8 GHz

= 0.3 x10^-9

For five clock cycles = 5 x 0.3 x10^-9

= 1.3157 x10^-9 nanoseconds.

5 0
3 years ago
Differences between mechanical and optical mouse <br>Plz help me
lutik1710 [3]
Mechanical mouse has a ball that turns rollers inside. If friction is lost between the ball and the mousing surface, or between the ball and the rollers, the mouse fails to work. In order to assure good contact with the mousing surface, the ball must be fairly heavy. When you change directions with the mouse, you must make the ball change rolling directions--an action that inertia likes to prevent.

An optical mouse makes use of an LED and some optics to detect surface texture and the changes in it as the mouse is moved. There are no moving parts
7 0
3 years ago
Other questions:
  • Which of the following is the final fate for average sized stars?
    12·1 answer
  • Help! live preview in brackets is not working
    8·1 answer
  • Trina Hauger works for Johnson Electric as a corporate lawyer, and part of her duties are to ensure the ethical and legal use of
    13·1 answer
  • Gabriel needs to create a formula that does not change when it is copied to cell b2. which formula should he create?
    14·1 answer
  • Where do you place the logical test argument in an JF function formula?
    5·2 answers
  • Which of the following scenarios is an example of irrelevant media?
    11·1 answer
  • Adobe Indesign project 4 museum indesign file. The instructions are 70 pages long I cant sit still long enough to read them
    11·1 answer
  • Write the Python programs for the
    13·1 answer
  • Digital rights include the right to
    12·1 answer
  • 1.Know the BMI of the user. First, the user will input the height in meters and weight in kilograms. After inputting, the inputt
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!