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
Elina [12.6K]
2 years ago
14

Create a php user defined function called MinMax. The function accepts two numbers as arguments and it returns the string: "The

minimum number is x and the maximum number is y" where x and y are the minimum and the maximum numbers respectively. For example, if the numbers 20 and 4 are passed to the function MinMax, it should return the string:
Computers and Technology
1 answer:
Diano4ka-milaya [45]2 years ago
5 0

Answer:

<?php

function MinMax($x,$y) {

 if($x > $y){

     echo("The minimum is ".$y." and the maximum number is ".$x);

 }

 else{

   echo("The minimum is ".$x." and the maximum number is ".$y);    

 }

}

MinMax(20,4);

?>

Explanation:

<?php

This defines the user function with two parameters x and y

function MinMax($x,$y) {

This checks if parameter x is greater than parameter y

 if($x > $y){

If yes, it prints x as the maximum and y as the minimum

     echo("The minimum is ".$y." and the maximum number is ".$x);

 }

If otherwised

 else{

If yes, it prints y as the maximum and x as the minimum

   echo("The minimum is ".$x." and the maximum number is ".$y);    

 }

}

This calls the function

MinMax(20,4);

?>

You might be interested in
Which of the following statements best
antoniya [11.8K]

Answer

b

Explanation:

3 0
3 years ago
What is the definition of overflow in binary?
asambeis [7]
Overflow occurs when the magnitude of a number exceeds the range allowed by the size of the bit field. The sum of two identically-signed numbers may very well exceed the range of the bit field of those two numbers, and so in this case overflow is a possibility.
4 0
3 years ago
What method can be used to determine if an email link is authentic?
Sloan [31]
A password and pin hope this helps :D
3 0
2 years ago
When adding clip art to a slide you are limited to the pictures stored on your computer?
77julia77 [94]
The answer is No.  <span>When adding clip art to a slide you are not limited to the pictures stored on your computer.  </span><span>We are not limited to using clip art from our computer. Any clip art can be used, but if it is from another source, it must first be saved to your computer as a </span>file<span>. </span>
8 0
3 years ago
Write a program that accepts a time as an hour and minute. Add 15 minutes to the time, and output the result. Example 1: Enter t
Liula [17]

Answer:

Explanation:

C++ Code

#include <iostream>

#include <cstdlib>

using namespace std;

int main(){

double hour,minute;

cout<<"Enter Hours :";

cin>>hour;

cout<<"Enter Minutes :";

cin>>minute;

minute = minute+15;

if(minute >=60){

 hour++;  

 minute = minute-60;

}

if(hour>23){

 hour = 0;

}

cout<<"Hour: "<< hour<< " Minutes: "<<minute;

return 0;  

}

Code Explanation

First take hours and minutes as input. Then add 15 into minutes.

If minutes exceeds from 60 then increment into hours and also remove 60 from minutes as hours already incremented.

Then check if hours are greater then 23 then it means new day is start and it should be 0.

Output

Enter Hours :9

Enter Minutes :46

Hour: 10 Minutes: 1

5 0
2 years ago
Other questions:
  • Write a function DrivingCost() with input parameters drivenMiles, milesPerGallon, and dollarsPerGallon, that returns the dollar
    12·1 answer
  • ________ is installed on your computer, and when the program is opened, your e-mail downloads to your computer.
    8·2 answers
  • Using an array, double each of the following values and print each result: values = [1.1, 10, 4.55, 30004, 0.2]
    7·1 answer
  • Virtualization:
    8·1 answer
  • How does a cat get out of a bush?
    7·1 answer
  • Write a recursive function sumAll that accepts an integer argument and returns the sum of all the integers from 1 up to the numb
    10·1 answer
  • Emma lives in Pennsylvania, what climate does she live in?
    7·1 answer
  • A location in memory which stores a value, the value can change as the program is running is
    12·1 answer
  • Which of these is installed only on Apple smartphones and tablets?
    5·2 answers
  • You are using a device that reads the physical addresses contained in incoming data that travels along network cables. Based on
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!