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
faltersainse [42]
2 years ago
15

Write the definition of a function printLarger, which has two int parameters and returns nothing. The function prints the larger

value of the two parameters on a single line by itself. (For purposes of this exercise, the "larger" means "not the smaller".)
Computers and Technology
1 answer:
GarryVolchara [31]2 years ago
7 0

Answer:

def printLarger(x: int ,y: int):

print(max(x,y))

Explanation:

The function is written in python as follows:

  1. the fuction printLarger takes two integer parameters x and y
  2. max() function determines larger value of x and y. If the numbers are the same it prints the value of the numbers as the largest value.
  3. the function prints the larger value.

You might be interested in
What is a typical grace period for a credit card...
Schach [20]
It is 20 to 25 days so c is correct
6 0
2 years ago
Read 2 more answers
Rideshare companies like Uber or Lyft track the x,y coordinates of drivers and customers on a map. If a customer requests a ride
TiliK225 [7]

Answer:

The program in Java is as follows:

import java.util.*;

public class Main{

 public static void main (String[]args){

   Scanner input = new Scanner(System.in);

   double user[] = new double[2];    double dr1[] = new double[2];

   double dr2[] = new double[2];    double dr3[] = new double[2];    

   System.out.print("Enter user coordinates: ");

   for(int i =0;i<2;i++){        user[i] = input.nextDouble();    }

   System.out.print("Enter driver 1 coordinates: ");

   for(int i =0;i<2;i++){        dr1[i] = input.nextDouble();    }

   System.out.print("Enter driver 2 coordinates: ");

   for(int i =0;i<2;i++){        dr2[i] = input.nextDouble();    }

   System.out.print("Enter driver 3 coordinates: ");

   for(int i =0;i<2;i++){        dr3[i] = input.nextDouble();    }

   double dr1dist = Math.abs(user[0] - dr1[0]) + Math.abs(user[1] - dr1[1]);

   double dr2dist = Math.abs(user[0] - dr2[0]) + Math.abs(user[1] - dr2[1]);

   double dr3dist = Math.abs(user[0] - dr3[0]) + Math.abs(user[1] - dr3[1]);

   System.out.println("Estimated pickup time of driver 1 "+(3.5 * dr1dist)+" minutes");

   System.out.println("Estimated pickup time of driver 2 "+(3.5 * dr2dist)+" minutes");

   System.out.println("Estimated pickup time of driver 3 "+(3.5 * dr3dist)+" minutes");

 }

}

Explanation:

The following array declarations are for the customer and the three drivers

<em>    double user[] = new double[2];    double dr1[] = new double[2];</em>

<em>    double dr2[] = new double[2];    double dr3[] = new double[2];    </em>

This prompts the user for the customer's coordinates

   System.out.print("Enter user coordinates: ");

This gets the customer's coordinate

   for(int i =0;i<2;i++){        user[i] = input.nextDouble();    }

This prompts the user for the driver 1 coordinates

   System.out.print("Enter driver 1 coordinates: ");

This gets the driver 1's coordinate

   for(int i =0;i<2;i++){        dr1[i] = input.nextDouble();    }

This prompts the user for the driver 2 coordinates

   System.out.print("Enter driver 2 coordinates: ");

This gets the driver 2's coordinate

   for(int i =0;i<2;i++){        dr2[i] = input.nextDouble();    }

This prompts the user for the driver 3 coordinates

   System.out.print("Enter driver 3 coordinates: ");

This gets the driver 3's coordinate

   for(int i =0;i<2;i++){        dr3[i] = input.nextDouble();    }

This calculates the distance between driver 1 and the customer

   double dr1dist = Math.abs(user[0] - dr1[0]) + Math.abs(user[1] - dr1[1]);

This calculates the distance between driver 2 and the customer

   double dr2dist = Math.abs(user[0] - dr2[0]) + Math.abs(user[1] - dr2[1]);

This calculates the distance between driver 3 and the customer

   double dr3dist = Math.abs(user[0] - dr3[0]) + Math.abs(user[1] - dr3[1]);

The following print statements print the estimated pickup time of each driver

<em>   System.out.println("Estimated pickup time of driver 1 "+(3.5 * dr1dist)+" minutes");</em>

<em>    System.out.println("Estimated pickup time of driver 2 "+(3.5 * dr2dist)+" minutes");</em>

<em>    System.out.println("Estimated pickup time of driver 3 "+(3.5 * dr3dist)+" minutes");</em>

7 0
2 years ago
Given is the array prices with 100 elements(prices[100]). The problem consists of two parts: 1. Find the highest price in the ar
Scrat [10]

Answer:

1. Input array of 100 numbers

mx = 0

for (int i = 0; i < 100; i++)

  if (arr[i] > mx)

      mx = arr[i]

Output mx

2. Input array of 100 numbers

mx = 0

for (int i = 0; i < 100; i++)

  if (arr[i] > mx)

      mx = arr[i]

mx = mx * 0.9

3. Input three numbers

if(firstNumber > secondNumber) {

swap(firstNumber, secondNumber)

}

if (firstNumber > thirdNumber) {

swap(firstNumber, thirdNumber)

}

if (secondNumber > thirdNumber) {

swap(secondNumber, thirdNumber)

}

output firstNumber, secondNumber, thirdNumber

Explanation:

4 0
2 years ago
Prompt
Verizon [17]
Prompt is a game code technically a tiko machine that turns into machines that fraud into the new line that put in a friends house.
7 0
1 year ago
Read 2 more answers
dam is writing a program that: 1) has the user guess a number, and 2) tells the user how many guesses it took to get the correct
Virty [35]

Answer:

Adam had most likely made a logic error.

Explanation:

Adam should check his code for any wrong formulas used or wrong arithmetic symbols.

6 0
2 years ago
Other questions:
  • To read encrypted data, the recipient must decipher it into a readable form. what is the term for this process? re-securing decr
    5·1 answer
  • How efficient would a 6-bit code be in asynchronous transmission if it had 1 parity bit, 1 start bit, and 2 stop bits?
    5·1 answer
  • Tina reported a safety hazard at her workplace to OSHA. Representatives from OSHA
    5·1 answer
  • The development of the original personal computer (PC) was a(n) __________ innovation at the time, whereas adding a different ki
    8·1 answer
  • Assume that we would like to expand the MIPS register file to 128 registers and expand the instruction set to contain four times
    14·1 answer
  • What happened if the offshore team members are not able to participate in the iterations demo due to timezone/infrastructure iss
    12·1 answer
  • Create the strAnalysis() function that takes 1 string argument and returns a string message. The message will be an analysis of
    15·1 answer
  • External network security threats can include management failure to support organization-wide security awareness, inadequate sec
    12·1 answer
  • Fill in the missing word in this program. class TooWide(Exception): pass answer = input('How wide is it? ') width = float(answer
    7·1 answer
  • A group of developers for a startup company store their source code and binary files on a shared open-source repository platform
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!