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
Which of these actions would NOT help you organize data efficiently?
Ilya [14]
The answer is Storing files on your desktop so that you can locate them easily
Hope this helps! :)
3 0
3 years ago
Most job applications are online. true or false
Sonja [21]

Answer:

True

Explanation:

4 0
3 years ago
I need someone's opinion<br> Which format is better? The first or second one? I can't decide 0.0
Ne4ueva [31]

Answer:

2nd one

Explanation:

4 0
3 years ago
Read 2 more answers
A nonprofit organization uses a contact management database to track donations, amounts donated, and all correspondence and phon
notka56 [123]

Answer:

nvbvbnvvbnbnvbnvbn

Explanation:

vbnvbnvbnbnnnbvnn

7 0
3 years ago
Is anyone familiar in drawing flow charts for c++ programming
Elina [12.6K]
Yes, but I use Unreal Engine

3 0
3 years ago
Other questions:
  • Which sign or symbol will you use to lock cells for absolute cell reference?
    8·2 answers
  • As we learned in this lesson, a byte is about the same amount of memory as a character, such as the letter 't'. There are approx
    13·1 answer
  • The different concepts in the architecture operating model are aligned with how the business chooses to integrate and standardiz
    10·2 answers
  • Professor Zak allows students to drop the four lowest scores on the ten 100 point quizzes she gives during the semester. Design
    13·1 answer
  • When working with arrays, most programming languages perform ________, which means they do not allow programs to use invalid sub
    5·1 answer
  • 1i) Standardize 'weight' column Write a function named standardize_weight that takes in as input a string and returns an integer
    14·1 answer
  • Write a function that takes an integer value and returns the number with its digits reversed. for example, given the number 7631
    10·1 answer
  • 3. Fire and police protection is the main responsibility of
    15·2 answers
  • What is artificial Intelligence ?
    11·2 answers
  • A(n) ____ is system software. Group of answer choices word processing program presentation graphics program operating system spr
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!