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
ch4aika [34]
4 years ago
7

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

(): public class CalcMiles { public static void main(String [] args) { double milesPerHour
Computers and Technology
1 answer:
weeeeeb [17]4 years ago
7 0

Complete Question

Write a method so that the main() code below can be replaced by the simpler code that calls method calcMiles() traveled.

Original main():

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); } }

Answer:

import java.util.Scanner;

public class CalcMiles

{

public double CalculateMiles (double miles, double minutes)

{ //Method CalculateMiles defined above

//Declare required variables.

double hours = 0.0;

double mile = 0.0;

//Calculate the hours travelled and miles travelled.

hours = minutes / 60.0;

mile = hours * miles;

//The total miles travelled in return.

return mile;

}

public static void main(String [] args)

{

double milesPerHour = 70.0;

double minsTravelled = 100.0;

CalculateMiles timetraveles = new CalculateMiles();

System.out.println("Miles: " + timetravels.CalculateMiles(milesPerHour, minsTraveled));

}

}

//End of Program

//Program was written in Java

//Comments are used to explain some lines

Read more on Brainly.com - brainly.com/question/9409412#readmore

You might be interested in
The "network of networks," consisting of LANs (Local Area Networksnetworks connecting two or more computers, usually within the
irina1246 [14]

Answer:

Internet

Explanation:

Internet is very often called the network of networks, creating a bridge between many networks and joining larger networks to another.

5 0
3 years ago
which of the following is something that an information systems (IS) professional would do? A. devise new ways to use computers
AlladinOne [14]

Answer:B

Explanation:

it professionals build and repair computers, create and aunts in networks, and help people with their technology needs.

5 0
3 years ago
What causes the natural event called El Niño? In a short paragraph, describe El Niño and the effects it has on Latin America.
iren2701 [21]

El Niño is a pattern in climate change occurring as the result of accelerated temperatures in the tropical-eastern regions of the Pacific Ocean for a shorter or extended period of time. This phenomenon affects areas of the western and southern parts of America impacting all natural resources including ocean life. In the past, El Niño has also caused serious disease outbreaks among the local population.

Explanation:

El Niño keeps the western pacific coast very warm and dry leading to drought.

Responsible for extremely wet monsoons, may lead to severe flooding along the Caribbean coast.

The opposite effect is known as “La Niña” that has adverse positive effects on the ecosystem, bringing in nutrient-rich cooler-water currents.

3 0
3 years ago
A period in which unemployment is low, business produces many goods and services, and wages are good is called ______.
ddd [48]

Answer:

A

Explanation:

4 0
3 years ago
The purpose of a ________ is to extract data from operational systems and other sources, clean the data, and store and catalog t
NeTakaya

Answer:

The correct answer for the following question will be Data warehouse.

Explanation:

Data warehouse (DWH), is a facility provided to data analyze and for managing and controlling an organization's business intelligence tools, pull data from many sources together for survey and analysis. It helps to store the former information and allows making better information for organization. This is also known as Enterprise Data Warehouse (EDW)

3 0
3 years ago
Other questions:
  • What is the core of an operating system that manages memory and devices, maintains the computer’s clock, starts programs, and as
    7·1 answer
  • What purpose would tracking changes be most useful for?
    7·1 answer
  • Fill in the function shopSmart(orders,shops) in shopSmart.py, which takes an orderList (like the kind passed in to FruitShop.get
    6·1 answer
  • Developers and organizations all around the world leverage ______ extensively.
    9·2 answers
  • 1. Provide at least two statements that explain the relationship between the position of the Earth and the seasons.
    15·1 answer
  • Differentiate agricultural waste from hazardous waste.​
    9·1 answer
  • Edhesive 4.6 lesson practice <br><br> Range is an example of a_______.
    10·2 answers
  • Name and define (or list the set that defines) three of the four common data types in programming
    12·1 answer
  • What is a major advantage of medical simulators?
    9·1 answer
  • Which of the following was the first computer-animated film to win animated film to win an academy award?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!