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 Logic Statement's are correct for the following diagram? *
Solnce55 [7]

Answer:

A AND B OR C

Explanation:

7 0
3 years ago
I'm asking more questions for help with schoolwork, thank you for the help, giving Brainliest.
r-ruslan [8.4K]
Give them brainliest!
4 0
3 years ago
One lap around a standard high-school running track is exactly 0.25 miles. Write the function miles_to_laps() that takes a numbe
Cerrena [4.2K]

def miles_to_laps(mi):

   return f"{mi} mile(s) is {mi/0.25} lap(s)"

print(miles_to_laps(1))

I wrote my code in python 3.8. I hope this helps!

6 0
3 years ago
Audio tools support reading fluency by
Artist 52 [7]

Answer:

The answer is "demonstrating how a text is read".

Explanation:

Audio tools like Text to Speech are commonplace in programs like Duolingo. They offer you a somewhat accurate example of how to properly pronounce a word or phrase.

4 0
4 years ago
Read 2 more answers
One reason for using social media is to develop social and professional contacts. True or false?
xxMikexx [17]
I would say this answer is true.
7 0
3 years ago
Read 2 more answers
Other questions:
  • The different concepts in the architecture operating model are aligned with how the business chooses to integrate and standardiz
    10·2 answers
  • You knew that you had to take this quiz so you logged into Blackboard and went to the quizzes section. In this scenario your com
    11·1 answer
  • The following is the pseudocode for which type of algorithm? For maxElement = each subscript in the array, from the last to the
    14·1 answer
  • Which studio produced the film the jazz singer the first of many talkies
    11·1 answer
  • Now tell me how be rich like Bill Gates
    6·1 answer
  • Which features of words are used to separate numbers and texts into columns
    11·1 answer
  • Weird canvas submission, I’ve done directly what the directions say to do to submit it, but it won’t submit
    15·1 answer
  • What critical-thinking tool is being used when asking the question, Is this information specific enough?
    9·1 answer
  • Please help me for this question - Computer Science
    7·1 answer
  • Select the correct answer.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!