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
lidiya [134]
3 years ago
13

In the main function, define five variables of type int, named: first, second, third, fourth, and total. Also in the main functi

on, define three variables of type double named: decimalOne, decimalTwo and decimalTotal Write one function named getData which asks the user for the data and puts it in first, second, third, fourth, decimalOne, and decimalTwo. (You may copy your getData from problem H1 and make additions to manage fourth, decimalOne, and decimalTwo.) Write a function named computeTotal which can take two, or three int arguments and returns an int. Write another function, also named computeTotal which takes four int arguments and returns an int. Write another function, also named computeTotal which takes two double arguments and returns a double. Write a function named printAll which takes three arguments of type int. Write a function named printAll which takes four arguments of type int. Write a function named printAll which takes five arguments of type int. Write a function named printAll which takes three arguments of type double.
Computers and Technology
1 answer:
fiasKO [112]3 years ago
8 0

Answer:

  1. import java.util.Scanner;
  2. public class num8 {
  3.    public static void main(String[] args) {
  4.    int first, second, third, fourth,total;
  5.    double decimalOne, decimalTwo, decimalTotal;
  6.    }
  7.    public static void getData(int first, int second, int third, int fourth, double decimalOne, double decimalTwo){
  8.        System.out.println("Enter the Values");
  9.        Scanner in = new Scanner(System.in);
  10.        first=in.nextInt();
  11.        second=in.nextInt();
  12.        third=in.nextInt();
  13.        fourth=in.nextInt();
  14.        decimalOne = in.nextDouble();
  15.        decimalTwo = in.nextDouble();
  16.    }
  17.    public static int computeTotal(int first, int second, int third){
  18.        return first+second+third;
  19.    }
  20.    public static int computeTotal(int first, int second, int third, int fourth){
  21.        return first+second+third+fourth;
  22.    }
  23.   public static double computeTotal(double decimalOne, double decimalTwo){
  24.        return decimalOne+decimalTwo;
  25.    }
  26.    public static void printAll( int first, int second, int third){
  27.        System.out.println("Number one, two and three are: "+first+" "+second+" "+third);
  28.    }
  29.    public static void printAll( int first, int second, int third, int fourth){
  30.        System.out.println("Number one, two and three and four are: "+first+" "+second+
  31.                " "+third+" "+fourth);
  32.    }
  33.   public static void printAll( int first, int second, int third, int fourth, int fifth){
  34.        System.out.println("Number one, two and three and four are: "+first+" "+second+
  35.                " "+third+" "+fourth+" "+fifth);
  36.    }
  37.    public static void printAll( double first, double second, double third){
  38.        System.out.println("Number one, two and three and four are: "+first+" "+second+
  39.                " "+third);
  40.    }
  41. }

Explanation:

This solution is provided in Java:

All the variable declarations are done in the main method (lines 3-6)

Eight methods as specified in the question are created (Lines 7, 17, 20, 23, 26, 29, 33 and 37).

Observe the concept of Method Overloading (i.e. methods with same name and return types but different parameter list)

You might be interested in
Dr. Thomas likes to follow up with her patients to make sure they were happy with their care. She sends all patients an email en
timofeeve [1]

Answer:

lean media

Explanation:

Dr. Thomas uses email as a medium of lean media to convey messages.

Lean media may be defined as the source of conveying messages that are short or of lean capacity. It is meant for instant messages and message and information that is not considered to be of out most importance. Whereas a rich media is a video chat or face to face communication.

Dr. Thomas send emails to her patients to follow up with them and also encourages her patients to call her for appointments or any questions. She uses email as a source of lean media for this communication.

8 0
3 years ago
Read 2 more answers
You are a running cable in a new network. You are running a series of cables from the wiring closet to the RJ-45 ports for the c
siniylev [52]

Answer:

IDF cable

Explanation:

An IDF cable or intermediate distribution frame is a cable rack that interconnects and manages a MDF or main distribution frame and a collection of workstations or computer systems. The MDF is a cable rack that interconnects several IDFs to itself.

4 0
2 years ago
​Lara is the chief editor of "Laughter and Life," an online magazine. Lara has assigned Jenny the task of redesigning the magazi
Zarrin [17]

Answer:

The "A" option is correct.

Explanation:

For CSS flexbox layout, the property "align-content" requires that the space in the flexbox is more than enough to show the items. In this case, to distribute evenly the items and show the first and last items aligned with the start and end of the main axis, the only suitable option is "space-between". This option leaves no space at the start or at the end of the flexbox, distributing the remaining space between the elements into the flexbox.

7 0
3 years ago
1. Which markup language adds the ability to use video without requiring the user to download add-ons?
aniked [119]

HTML5

HTML5 has fewer plug-ins like the ability to standardize how audio and video are presented on a Web page. It introduces the <video> element designed to remove the need to install 3rd party add-ons and plug-ins like adobe flash player. It also adds the <audio> element  too that allows pages to smoothly add audio files.

3 0
3 years ago
What type of software can you use to capture and examine the contents of network messages?
Ludmilka [50]
They're usually referred to as packet sniffers.
7 0
3 years ago
Other questions:
  • In order to plan George’s birthday, his father gave him a list of people who attended his birthday for the last five years. What
    8·2 answers
  • In 2-3 paragraphs, identify at least two ways technology and innovation have affected global economic competition. Provide a spe
    5·1 answer
  • When you take a multiple-choice test, you are relying on ________, a means of retrieving information out of your long-term memor
    8·1 answer
  • How is typing speed measured
    12·2 answers
  • Which character is often used to identify registered trademarks and is available on the Insert tab and Symbols
    5·1 answer
  • An Internet Service Provider (ISP) is a company that builds the routers and wired connections that allow individuals to access t
    12·2 answers
  • Benching system are prohibited in
    5·1 answer
  • To convert microseconds to nanoseconds: a. Take the reciprocal of the number of microseconds. b. Multiply the number of microsec
    13·1 answer
  • Explain how mobile phone production could be more sustainable​
    8·2 answers
  • Algorithm to eat orange<br><br>​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!