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
guapka [62]
3 years ago
12

Write the definitions for three function named max. Each receives two parameters, of the same type, and returns the larger of th

e two values. Define one of these functions to apply to type double, another to type int and a third to type char.
Computers and Technology
1 answer:
GenaCL600 [577]3 years ago
8 0

Answer:

The method definition to this question can be given as:

Method definition:

double max(double x, double y)  //define method with double parameter  

{

if (x>=y)    //check condition.

return x;  //return value

else

return y;     //return value

}

double max(int x, int y)    //define method with integer parameter

{

if (x>=y)    //check condition

return x;    //return value

else

return y;  //return value

}

double max(char x, char y)   //define method with char parameter

{

if (x>=y)    //check condition

return x;    //return value

else

return y;    //return value

}

Explanation:

The above method definition can be described as below:

  • In the first method definition first, we define a method that is "max()". In this method we pass two variables as a parameter that is "x and y" and the datatype of this is double. Then we use a conditional statement. In the if block we check if variable x is greater then equal to y then it will return x else it will return y.  
  • In the second method definition, we define a method that is same as the first method name but in this method, we pass two integer variable that is "x and y". Then we use a conditional statement. In the if block we check if variable x is greater then equal to y then it will return x else it will return y.
  • In the third method definition, we define a method that is same as the first and second method name but in this method, we pass two char variable that is "x and y". Then we use a conditional statement. In the if block we check if variable x is greater then equal to y then it will return x else it will return y.
You might be interested in
Different between anlog and digital computer?​
sp2606 [1]

Explanation:

Analog computer:

It works with naturaland physical values

It works upon continuous data.

Its accuracy is low.

Digital computer:

It works with digits.

It works upon discrete data.

Its accuracy is high

3 0
3 years ago
To select more than one sketched entity, you need to press and hold down the ________ key on the keyboard while selecting the en
almond37 [142]

Answer:

The answer to this question is Control(ctrl).

Explanation:

We use control(ctrl) key when we need to select multiple entities.

So when we want to select more than one sketched entity we need to press and hold the control key on the keyboard when we are selecting the items.

Hence we conclude that the answer to this question is Control(ctrl).

6 0
3 years ago
What do the points do
Kamila [148]
Add a score to your achieve of correctly answered questions. Which then will determine how much of a Genius you are.
8 0
3 years ago
Read 2 more answers
Identify way computer are used in television production​
Aleonysh [2.5K]

Answer:

image editing, text om screen, weather graphics, animation, sattelites ... a lot more possibilites are endless just limited

3 0
2 years ago
How is non-renewable energy converted into usable energy?
lianna [129]

Explanation:

-Mostly by burning fossils for oil.

-The water is non renewable and is converted into usable energy thanks to hidroelectric centrals.

Best regards

4 0
2 years ago
Other questions:
  • Mobile devices typically come pre installed with standard apps like web browsers , media players, and mapping programs true or f
    9·1 answer
  • Wide area networks are defined by their ability to
    14·2 answers
  • For her homework, Annie has added the picture of a fruit in a document. She wants to enhance it to give a cut-out look. Which fe
    5·2 answers
  • When an organization uses cloud computing, they do not have to buy and maintain expensive hardware. Group of answer choices True
    6·1 answer
  • A non technical kind of cyber intrusion that relies heavily on human interaction and often involve tricking people into breaking
    5·1 answer
  • PHOTOSHOP IS A GRAPHICS EDITING PROGRAM CREATED WITH IMAGES KNOWN AS________ ​
    6·1 answer
  • You need to configure your Android phone so that you can receive your Yahoo email on the device. What information would you need
    10·1 answer
  • What are some of the general components of an IDE?
    7·1 answer
  • What is a database and provide 2 examples of how you are using a database.
    5·1 answer
  • Which page layout is most commonly used for a website with a large navigation menu?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!