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
denpristay [2]
3 years ago
15

Please help

Computers and Technology
1 answer:
ExtremeBDS [4]3 years ago
8 0

Answer:

Answered below

Explanation:

This solution is written in Kotlin programming language.

fun average (a: Int, b: Int, c: Int, d: Int, e: Int) : Double {

#variable to hold the addition of all parameters

var sum = a + b + c + d + e

#variable to hold the average of sum

var avg = sum / 5

return avg

}

#call the function to see how it works.

# this operation is done in the fun main()

var test: Double = average ( 5, 4, 7 , 3, 9)

print (test)

You might be interested in
Instagram
Aleonysh [2.5K]
Uninstall instagram and install it again. log in and go to settings and fix up the notifications maybe that’ll work??

if it doesn’t, go to your apple settings and see if the notifications for instagram are on.

also try shutting your phone off for a few seconds if you do either one.
5 0
3 years ago
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
State the difference between a monitor and a television​
Maurinko [17]
The size of a monitor is not much larger. As these are used from a specific distance, it would be so inconvenient if a monitor size is too big.
7 0
2 years ago
Read 2 more answers
Worksheet titles and subtitles should be as wordy as possible.<br> a. True<br> b. False
Maru [420]
B) false, as you want them to be as simple as you can... the 'wordy' part comes underneath said title :)
5 0
2 years ago
Read 2 more answers
What to do when you accidentally delete usb drivers?
amid [387]
Step 1

Save your work and close all programs. You will be restarting your computer during the process.

Step 2

Click “Start” from the task bar and then choose “All Programs.”

Step 3

Click “Accessories” from the program menu. Choose “System Tools” from the side pop-out menu and then select “System Restore.”

Step 4

Click “Restore my computer to an earlier time” from the Welcome screen. Click “Next” at the bottom.

Step 5

Choose a date in bold from the calendar shown on the Restore Point page. The date that you choose should be an earlier one, like a day or two before the deletion occurred. Click “Next” at the bottom of the window.

Step 6

Click “Next” on the next page. The restoration begins, and your computer will restart.

Step 7

Click “OK” from the completion window that appears when your computer loads again.

3 0
3 years ago
Other questions:
  • A (blank) is a way for students to keep track of information during research
    7·2 answers
  • Which steps would you take to determine how much an employee should be paid? Select all that apply.
    9·1 answer
  • Assume that LO and HI have already been assigned as constants with LO &lt; HI, and x has been declared as DWORD in the data segm
    7·1 answer
  • Count input length without spaces, periods, or commas Given a line of text as input, output the number of characters excluding s
    8·2 answers
  • Which is NOT a benefit of using visual aids?
    9·2 answers
  • A(n) ________ software installation copies all the most commonly used files to your computer's hard drive.
    10·1 answer
  • How does a Cloud-first strategy approach a client's migration to the Cloud?
    11·1 answer
  • give the difference between functional and functional tools in the middle of to the circle give importance​
    10·1 answer
  • What is the diffrent between ibm pc and ibm compatibles in table:​
    11·1 answer
  • How many atoms of oxygen in 4 molecules of HN03​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!