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
Match the term to its correct defintion
emmasim [6.3K]

Answer:

View Base tables: Virtual table based on a SELECT query

CREATE VIEW statement: Data definition command that stores the query specification in the data dictionary

DROP VIEW statement: Data definition command that removes the query specification in the data dictionary

Explanation:

Views are virtual tables, which can be created by select queries using the real database tables.

Creating and dropping views can be done by the CREATE VIEW and DROP VIEW statements.

<u>CREATE VIEW syntax:</u>

CREATE VIEW view_name AS

SELECT column1, column2, ...

FROM table_name

WHERE condition;

<u>DROP VIEW syntax:</u>

DROP VIEW view_name;

5 0
3 years ago
What is a "telescreen"? How is it different from the televisions we know? Is it possible to make a television that could see and
mars1129 [50]

Answer:

  1. Telescreens are devices that operate as televisions, security cameras, and microphones.
  2. A television is an electronic communication medium that allows the transmission of real-time visual images, and often sound while a telescreen is a television and security camera-like device used to keep things or people under constant surveillance, thus eliminating the chance of secret conspiracies.
  3. It could be employed in secretly investigating criminals and terrorists.
  4. It could also play a major role in politics by investigating suspicious government officials and those that plan Ill towards a nation.
  5. It would definitely be a great idea to install one of such.

Explanation:

8 0
3 years ago
Item = "quesadilla"
jok3333 [9.3K]

Answer:

item = "quesadilla"

meat = "steak"

queso = False

guacamole = False

double_meat = False

base_price = 4.5

if item == "quesadilla":

base_price = 4.0

elif item == "burrito":

base_price = 5.0

if meat == "steak" or meat == "pork":

base_price += 0.50

if meat == "steak" and double_meat:

base_price += 1.50

elif meat == "pork" and double_meat:

base_price += 1.50

elif double_meat:

base_price += 1.0

if guacamole:

base_price += 1.0

if queso and item != "nachos":

base_price += 1.0

print(base_price)

Explanation:

  • Use a conditional statement to check if meat is steak or pork then add 0.50 to base_price .
  • Check if the meat is steak or pork, then double_meat adds 1.50 or 1.0 otherwise .
  • Check if meat is steak and its double_meat , then add 1.50  and if its for guacamole, then add 1.00 to base_price . If queso is there and item is not nachos, add 1.00 to base_price .
  • Finally when item is nachos, no need to add any money to base_price .

7 0
3 years ago
Differentiate the term, "bundling," as applied to a Mac/Apple computer and a PC.
saw5 [17]

Answer:

Mac comes with the up (or is bundled with) the up-to-date OS where with windows there are multiple flavors to choose from.

Explanation:

Sorry if its wrong

8 0
3 years ago
What is green market?
Fynjy0 [20]
Green marketing<span> is the </span>marketing<span> of products that are presumed to be environmentally preferable to others.Thus </span>green marketing<span> incorporates a broad range of activities, including product modification, changes to the production process, sustainable packaging, as well as modifying advertising.</span>
4 0
3 years ago
Other questions:
  • Why is the stateless nature of the internet a problem for shopping cart software? g?
    5·2 answers
  • Gunther is filling in his own input mask. He wants to format the Social Security numbers of his clients. The field must contain
    5·1 answer
  • Where do you access the status report of an assigned task that is open?
    12·2 answers
  • If several programs or apps are running simultaneously, your computer or device might use up its
    14·1 answer
  • What is the inverse function of d(x ) = -2x - 6?
    11·1 answer
  • Who invented the first antivirus software and when was it written?
    12·1 answer
  • Graphic characters used to identify items on an unordered list first line indent is called _______
    8·1 answer
  • Can we change our profile name on here and how
    7·2 answers
  • Create a public class Dog that stores a single double age set by the constructor. (Reject negative ages using assert.) Dog shoul
    13·1 answer
  • Servers that exist within a data center that is publicly accessible on the internet are referred to as on-premises servers.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!