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
You can access various sites on the WWW by using hyperlinks or by______. A. entering a key word for your search B. following dir
saw5 [17]
The correct answer is C
8 0
3 years ago
Read 2 more answers
What was bill gates first operating system he created?
vagabundo [1.1K]
Microsoft windows was his first

3 0
3 years ago
National ISPs usually offer fewer services and have a smaller technical support staff than regional ISPs.
choli [55]

Answer:

um not sure

Explanation:

5 0
3 years ago
Which of the following would be better communicated with an image than with text?
slega [8]

Answer:

A decor to a wedding

Explanation:

its bc who would want to know how its described when u could look of how it looks u might be speechless

8 0
3 years ago
In a flashdisk wich icon can you use to open files in computer​
Dvinal [7]

Answer:

In a flashdisk,

If you are windows: click "my computer", and under the "cpmputer" section, you will find your flashdisk's name, and click it, in there you can find and also open your files.

If you are Mac: click "Finder", click "Desktop" and find your flashdisk's name, and click it, in there you can find and also open your files.

6 0
3 years ago
Other questions:
  • A(n) ____ loop executes a predetermined number of times.
    12·1 answer
  • Rachel completed typing an official docment with a word processing program. She wants to make sure that her document has no typo
    15·2 answers
  • Your boss asks you to work through the weekend to install new software on the applications server that serves up applications to
    15·2 answers
  • What piece of software tells the operating system how to use a specific hardware device?
    14·1 answer
  • Tom wants a way to automatically create ads and simplify campaign management, using his resources and Google's machine learning
    12·1 answer
  • Compare and contrast the following network types: Personal Area Network (PAN) Local Area Network (LAN) Metropolitan Area Network
    14·1 answer
  • When did gaming become a thing?
    7·2 answers
  • Systems Software, Inc., is introducing a new piece of sophisticated graphics software. A recently hired writer has been assigned
    8·1 answer
  • which scheduling algorithm allocate the CPU firt to the process that request the CPU first, (a) first come first serve,(b) short
    9·1 answer
  • What game is this?????????????????????
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!