answer.
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]
2 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]2 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
Omar wants to add transitions to his presentation, so he clicks the Transitions tab. Which tasks can he now complete? Check all
ser-zykov [4K]

Answer:

a b c and d

Explanation:

edgunity 2020

7 0
2 years ago
Which of the following statements about crane hand signal training are true? A. Both statements are true about crane hand signal
Alenkinab [10]
The correct option is A.
When using crane at a construction site, it is required that:
1.A poster should be posted at the job site with an illustration of the hand signals that every operator and personnel working with the crane and around the crane must know.
2. Hand signals for crane and derrick operators should be those set by the American National Standard institute customize for the type of crane in use.<span />
5 0
2 years ago
Write a loop that counts the number of space characters in a string. Recall that the space character is represented as ' '.
Jlenok [28]

Answer:

I am writing Python program.

string = input("Enter a string: ")

print(string.count(' '))

Explanation:

The first statement takes input string from the user.

input() is used to read the input from the user.

The next statement uses count() function to count the number of times the specified object which is space ' ' here occurs in the string.

The print() function is used to return the number of times the space occurs in the string entered by the user.

Output:

Enter a string: How are you doing today?

4

The screenshot of program and its output is attached.

3 0
2 years ago
PYTHON CODE ONLY:
Oksanka [162]

Answer:

lst=["H", "wor", "o w"]

s='Hello world'

contains = True

for i in range (0, len(lst)):

 if not lst[i] in s:

   contains = False

   break

Explanation:

Above code works fine if you make sure that identation is correct.

8 0
2 years ago
1.erros can easily be ____ 2.work is done in an ____ no mess environment 3.colors do not _____ and brushes are never ______ 4.st
bonufazy [111]

Answer:

1) corrected

2) organized

3) Fade and worn-out

4) saved

5) saved

6) organized and graphics

6 0
2 years ago
Other questions:
  • Marissa works at a company that makes perfume. She noticed many samples of the perfume were not passing inspection. She conducte
    6·2 answers
  • Programming challenge description: Write a program that, given two binary numbers represented as strings, prints their sum in bi
    6·1 answer
  • The attack in which the attacker sends a forged packet with the same source IP address and destination IP address in which the v
    10·1 answer
  • Develop an EER model for the following situation using the traditional EER notation, the Visio notation, or the subtypes inside
    8·1 answer
  • This program will store roster and rating information for a soccer team. Coaches rate players during tryouts to ensure a balance
    5·1 answer
  • What are some reasons DNS is necessary? Check all that apply. A. It maps local addresses to simple names without editing hosts f
    7·1 answer
  • Write a program that calculates taxi fare at a rate of $1.50 per mile. Your pro-gram should interact with the user in this manne
    12·1 answer
  • Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating value ZZZ. Store each String in
    15·1 answer
  • How do many corporations most likely manage the health and safety of their employees and the workplace?
    13·1 answer
  • What is Accenture's role in Multi-party Systems?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!