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
marta [7]
3 years ago
11

Write a method so that the main() code below can be replaced by simpler code that calls method calcMilesTraveled(). Original mai

n():
public class CalcMiles {
public static void main(String [] args) {
double milesPerHour = 70.0;
double minutesTraveled = 100.0;
double hoursTraveled;
double milesTraveled;
hoursTraveled = minutesTraveled / 60.0;
milesTraveled = hoursTraveled * milesPerHour;
System.out.println("Miles: " + milesTraveled);
}
}
1 import java.util.Scanner;
2
3 public class CalcMiles (
4
5 /" Your solution goes here ./
6 private double calcMilesTraveled(double milesPertour, double ninsTraveled)
7 double hoursTraveled
8 double milesTraveled;
9
10 hoursTraveled mibsTraveled 60.8
11 milesTraveled hoursTraveled milesperhour
12
13 return milesTraveled;
14
15
16 public static void main(String 0] args)
17 double milesPerhour 70.0;
18 double minutesTraveled 100.0
19
20 System.out.printin("Miles: mphAndMinutesToMiles(milesPerHour, minutesTraveled))i
Computers and Technology
1 answer:
patriot [66]3 years ago
5 0

Answer:

See explanation

Explanation:

From the question, you have answered the question. However, it is poorly formatted.

<em>So, I'll help present the code properly and also give explanation using comments.</em>

import java.util.Scanner;

public class CalcMiles{

//This line defines the calcMilesTraveled method

private static double calcMilesTraveled(double milesPerhour, double minsTraveled){

//This declares hoursTraveled

double hoursTraveled;

//This declares milesTraveled

double milesTraveled;

<em>//This calculates the hoursTraveled</em>

hoursTraveled = minsTraveled/60.0;

//This calculates the milesTraveled

milesTraveled = hoursTraveled * milesPerhour;

//This returns the milesTraveled

return milesTraveled;

}

//The main method begins here

public static void main(String [] args){

//This declares and initializes milesPerhour

double milesPerhour =70.0;

//This declares and initializes minutesTraveled

double minutesTraveled = 100.0;

//This calls the calcMilesTraveled function and also prints the required result

System.out.println("Miles: "+calcMilesTraveled(milesPerhour, minutesTraveled));

}

}

<em>See attachment for program without comments</em>

Download txt
You might be interested in
Njdnkjsdnjvnsdjvnjsdnvjsdvnjdnvjdsnvnksn
adoni [48]

Answer:

yes

Explanation:

7 0
2 years ago
Universal Containers is tracking the interviewer's ratings of candidate in Salesforce. They would like to easily link the Candid
uranmaximum [27]

Answer:

Hierarchical is scenario is used to between condition and ratings.

Explanation:

Master   -details its open up all details of the candidate and his rating to Universal Containers is tracking by interviewer ratings. where they are no classified. Just data collection.

Lookup:- where it fetches all details and further analysis will be a big task.

Search  :- it is a just search where relevant information based on queries.

Hierarchical;- it is further classified and it is very to do analysis and takes decisions.

Since it is classified further drill down is possible and make a good analysis report can be made.

3 0
2 years ago
How many categories of bitmap images are there?
seraphim [82]

Answer:

Bitmap images can contain any number of colors but there are four main categories: Line-art. These are images that only contain two colors, usually black and white.

6 0
3 years ago
Select the three careers in the creative side of digital media.
MrRa [10]

Answer:

I would pick A B and D to be my answer

6 0
2 years ago
In case of a suspected data breach, what course of action should a chief information security officer (CISO) take
guapka [62]

Answer

1. Assemble his team

2. Find reason for breach

3. Evaluate what was lost

4. Ensure password change

Explanation:

In case of a suspected breach, the Chief information security officer should first of all assemble his incidence response team. This team should have representatives from all areas of the organization.

Then the reason for the breach and how access was gained has to be found out. An evaluation of what has been lost in the breach would be carried out and it's likely impact on the company.

In case credentials were stolen the CISO has to ensure that the employees change passwords. Also he has to notify all the necessary parties about the breach.

The CISO has to ensure that all employees are trained properly on security and they comply to security policies.

7 0
3 years ago
Other questions:
  • Does toontown rewritten carry spyware or malware
    9·1 answer
  • Explaim Why the shape of a cell is hexagonal
    15·1 answer
  • Which code returns the date in the format friday, april 20th, 2015?
    13·1 answer
  • The Table Tools tab provides which two additional tabs?
    5·1 answer
  • Question 4 of 20
    5·1 answer
  • Write a qbasic program to display integer numbers 1 to 100 using the for next loop<br>​
    9·1 answer
  • MORE FREEE POINTS AYEEE
    7·2 answers
  • When would instant messaging be the least effective means of communication
    9·1 answer
  • Why should you make sure the paper being used in a printer is dry and not damp?
    11·1 answer
  • Ups developed software called ____ to enable u.s. customs and border protection agents to inspect packages that pass through the
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!