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
igor_vitrenko [27]
3 years ago
10

I need this ASAP anyone pleas help me i have to do this by tonight

Computers and Technology
1 answer:
tigry1 [53]3 years ago
8 0

Answer:

IDk

Explanation:

You might be interested in
Write a method so that the main() code below can be replaced by the simpler code that calls method mphAndMinutesToMiles(). Origi
defon

ANSWER

The JAVA program after simplification is as below.

import java.util.Scanner;

public class CalcMiles {

   

   // variables declaration

   static double milesPerHour;

   static double minutesTraveled;      

   static double hoursTraveled;

   static double milesTraveled;

   

   // method declared static

   public static void mphAndMinutesToMiles(double speed, double mins)

   {

       // computations to calculate distance travelled

       hoursTraveled = mins / 60.0;

       milesTraveled = hoursTraveled * speed;

       

       // result displayed on the screen  

     System.out.println("Miles: " + milesTraveled);

   }

   

   // Scanner object created inside main()

   // user input taken inside main()

   public static void main(String [] args)

   {

       Scanner scnr = new Scanner(System.in);

       System.out.println("Enter miles travelled per hour ");

       milesPerHour = scnr.nextDouble();

       System.out.println("Enter minutes required to travel ");

       minutesTraveled = scnr.nextDouble();

       

       mphAndMinutesToMiles(milesPerHour, minutesTraveled);

       

   }

}

OUTPUT

Enter miles travelled per hour  

2.3

Enter minutes required to travel  

1234

Miles: 47.30333333333333

EXPLANATION

The program is simplified as explained below.

1. User input is taken using the object of Scanner class.

2. This object of Scanner class can only be created inside main() method hence, user input can only be taken inside main().

3. The code to calculate the result is separated in another method, mphAndMinutesToMiles(). This method is declared with return type void since no value is returned.

4. After user input is taken in main() for miles travelled per hour and minutes required to travel, these values are passed as parameters to the mphAndMinutesToMiles() method.

5. These parameters are used in calculation part. The total miles travelled in total hours (obtained from minutes), is calculated. The code to display the result is added to this method.

6. Inside the main method, only the code to create Scanner object, code to take user input for two variables and code to call the mphAndMinutesToMiles() is included.

7. The variables are declared as static and declared at class level.

8. No variable is declared inside any of the two methods.

5 0
3 years ago
Read 2 more answers
If a speaker repeats a point, it is likely _____.
zloy xaker [14]

I’m pretty sure it’s either A or D

4 0
3 years ago
Read 2 more answers
What should be used to screw on broadheads? needle-nose pliers gloves thumb and forefinger only specially designed wrench
strojnjashka [21]
You should use needle-nose pliers, or sometimes even specially designed wrenches to screw on broadheads. 
3 0
3 years ago
Which person would be the best fit for a career in the Information Technology field?
zaharov [31]
The best possible fit would be a person with a creative mind and flexible mind. 
The technical stuff can be taught and learnt. But to evolve and keep up with the pace of how technology improves day to day, you'd need some with flexibility to cope up with this and creativeness to make innovations.
6 0
3 years ago
Read 2 more answers
Uuhdcnkhbbbbhbnbbbbnnnnnnnnnfddjkjfs
Anna35 [415]

Answer:

The answer is "Option c"

Explanation:

In PHP to remove all the session variables, we use the session_destroy() function. It doesn't take any argument is required and then all sessions variables could be destroyed by a single call. If a particular clinical variable is now to be destroyed, the unset() function can be applied to unset a session variable. Its session doesn't unset or unset the session cookie by either of the local variables associated with it.

6 0
3 years ago
Other questions:
  • A programmer wrote the code segment below to display the average of all the elements in a list called numbers. There is always a
    8·1 answer
  • ________ is the abbreviation for the place in the computer where the programs and data the computer is currently using are store
    8·1 answer
  • Search engine ranking evaluates the variables that search engines use to determine where a URL appears on the list of search res
    7·1 answer
  • Web browsers are used to browse the world wide web.
    5·2 answers
  • What is required for sitting with your seatbelt on while driving?
    7·1 answer
  • Read the excerpt from The Code Book. Other attacks include the use of viruses and Trojan horses. Eve might design a virus that i
    13·1 answer
  • The area of a square is stored in a double variable named area. write an expression whose value is length of the diagonal of the
    8·1 answer
  • You want to substitute one word with another throughout your document. What tool(s) should you use?
    9·1 answer
  • We can use formatting before and after typing.​
    8·1 answer
  • _____ is rampant with bugs and shortcomings because most programmers do not know how or do not take the time to incorporate secu
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!