answer.
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
Paha777 [63]
2 years ago
12

Write a function named max that accepts two integer values as arguments and returns the value that is the greater of the two. Fo

r example, if 7 and 12 are passed as arguments to the function, the function should return 12. Use the function in a program that prompts the user to enter two integer values. The program should display the value that is the greater of the two
Computers and Technology
1 answer:
RoseWind [281]2 years ago
6 0

Answer:

The solution code is written in Python

  1. def max(a, b):
  2.    if(a > b):
  3.        return a  
  4.    else:
  5.        return b
  6. num1 = int(input("Please input the first number: "))
  7. num2 = int(input("Please input the second number: "))
  8. print(max(num1, num2))

Explanation:

Firstly create a function max that accepts two input, a and b, as required by question (Line 1). In the function, create if statement to check if a greater than b return a and vice versa (Line 2 -5).

In the main program (Line 7 - 10), prompt user to input two numbers (Line 7 - 8). At last call the function by passing num1 and num2 as arguments and print the result (Line 10).

You might be interested in
Our new catalog contains an eclectic collection of items
Cloud [144]

Answer: .

Explanation: .

7 0
2 years ago
___refers to self-acting or self-operating.
lisabon 2012 [21]

Answer:

do it to me watch this

Explanation:

trailing zeros in a whole number with no decimal shown are NOT significan

6 0
2 years ago
(Java)Write a program that calculates and displays the conversion of an entered number of dollars into currency denominations—20
Nataly [62]

Answer:

Below!

Explanation:

This is the code I have. I am not sure what I am missing that it won't accept -  

import java.util.Scanner;

class Dollars {

   public static void main(String[] args) {

            int numTwenties,numTens,numFives,numOnes,dollarAmount;  

       Scanner sc= new Scanner(System.in);

       System.out.println("Please enter a dollar amount: ");  

       dollarAmount = sc.nextInt();

        numTwenties = dollarAmount/20;

        numTens = (dollarAmount - 20*numTwenties)/10;

        numFives = (dollarAmount - (10*numTens + 20*numTwenties))/5;

        numOnes = (dollarAmount - (10*numTens + 20*numTwenties + 5*numFives));

       System.out.println(+ dollarAmount + " converted is" + numTwenties + " $20s, " + numTens + " $10s, " + numFives + " $5s, and " + numOnes + " $1s.");  

   }

}

This is what it is giving me -

Test CaseIncomplete

Dollars 598

Input598

OutputPlease enter a dollar amount: 598

598 converted is29 $20s, 1 $10s, 1 $5s, and 3 $1s.

Results

$598 converted is 29 $20s, 1 $10s, 1 $5s, and 3 $1s

Expected Output

$598 converted is 29 $20s, 1 $10s, 1 $5s, and 3 $1s

8 0
2 years ago
Use the drop-down menus to complete each sentence about the layers of the atmosphere.
REY [17]

Answer

Use the drop-down menus to complete each sentence about the layers of the atmosphere.  

If the Mesosphere did not exist, Earth might be destroyed by chunks of rock from space.

The Stratosphere is located 12 to 50 kilometers from Earth’s surface.

Both the Mesosphere and Troposphere get colder as altitude increases.

The ozone in the Stratosphere protects people from ultraviolet (UV) radiation.

The Themosphere has the highest temperature of any layer in Earth’s atmosphere.

u welcome

6 0
2 years ago
Read 2 more answers
When you reboot your system, the computer follows start-up instructions stored in this type of memory. multiple choice dram sdra
MA_775_DIABLO [31]
<span>A computer’s start-up instructions are stored in a type of memory called Flash. Flash memory can be written to and read from, but its contents are not erased after the computer powers down. This Flash memory is more commonly referred to as the BIOS (Basic Input Output System).</span>
4 0
2 years ago
Read 2 more answers
Other questions:
  • In a situation where handicapped person can only input data into the computer using a stylus or light pen, which keyboard config
    7·2 answers
  • Danilo is planning the art to include in a business proposal his team is preparing. For which of the following items should Dani
    7·2 answers
  • PowerPoint is a visual aid for many speakers. Discuss some points to remember when adding text to a PowerPoint presentation. How
    13·1 answer
  • Darcy is creating an instructional manual for her employees. She entered the text in a word processing program and wants to impo
    6·1 answer
  • An administrator has initiated the process of deploying changes from a sandbox to the production environment using the Force IDE
    5·1 answer
  • Determine the number of bytes necessary to store an uncompressed binary image of size 4000 × 3000 pixels.
    9·1 answer
  • Write a function that computes the average and standard deviation of four scores. The standard deviation is defined to be the sq
    15·1 answer
  • Consider the following network: proxy-cache On average there are 35 objects downloaded per second, and the average object size i
    14·1 answer
  • Make a class Employee with a name and salary. Make a class Manager inherit from Employee. Add an instance variable, named depart
    14·1 answer
  • Which of the following is true about sorting functions?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!