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
Why is it better for a CPU to have more than one cache?
Kitty [74]

Explanation:

i think cpu needs to have backup chache units in case of electrical failure

5 0
2 years ago
Read 2 more answers
Is a process in which an attacker attempts to acquire information about your network and system by social means, such as talking
aleksandr82 [10.1K]
The answer would be software exploitation
4 0
3 years ago
any one that owns a chrome book there is a new update there is new features and there is a game on settings where you see what y
timama [110]

Answer:

THANK YOU SO MUCH! I AM ON MY CHROME BOOK RIGHT NOW AND WAS HESITATING TO DOWNLOAD THE UPDATE!

Explanation:

4 0
2 years ago
Read 2 more answers
What specific record type is found in every zone and contains information that identifies the server primarily responsible for t
ValentinkaMS [17]

The SOA is the specific record type found in every zone and contains information that identifies the sever primarily responsible for the zone as well as some operational properties for the zone.

Explanation:

The Start of Authority Records (SOA) has the following information they are

Serial Number: This number is used to find when zonal information should be replicated.

Responsible person: The Email address of a person is responsible for managing the zone.

Refresh Interval: It specifies how often a secondary DNS server tries to renew its zone information.

Retry Interval: It specifies the amount of time a secondary server waits before retrying the zone information has failed.

Expires After: IT specifies the amount of time before a secondary server considers its zone data if it can't contact with the primary server.

Minimum TTL: It specifies the default TTL value for a zone data when a TTL is not supplied.

4 0
3 years ago
What is the legal right granted to all authors and artists that gives them sole ownership and use of their words, software, pict
ICE Princess25 [194]

Answer:

copyright

Explanation:

3 0
3 years ago
Other questions:
  • Differentiate between third and fourth generation of computer​
    6·1 answer
  • To use the program service routines, the user's program makes requests to the operating system through the
    10·1 answer
  • Write a recursive, bool-valued function, containsVowel, that accepts a string and returns true if the string contains a vowel. A
    5·1 answer
  • The three tasks within data harmonization, namely: data consolidation, data cleansing, and data formatting use techniques called
    8·1 answer
  • My computer just fried anybody know why it did that?
    14·2 answers
  • What function returns a line and moves the file pointer to the next line?
    9·1 answer
  • Which online article citation is correctly formatted according to MLA standards?
    15·2 answers
  • When looking at aggregated logs, you are seeing a large percentage of Windows hosts connecting to an Internet Protocol (IP) addr
    5·1 answer
  • What is the value of the variable result after these lines of code are executed? >>> a = 5 >>> b = 2 >>&
    8·2 answers
  • Which is a concept of the CIA of Computer Security
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!