Question

In Python: Problem 4. Write a program [call it minmax.py] that accepts three integers in the...

In Python:

Problem 4. Write a program [call it minmax.py] that accepts three integers in the range [0-100] as input from the user. Your program should then determine and print the smallest and largest integers in the values entered by the user using comparison operators *not* using predefined min or max Python functions.
For instance:
If the user input is: 36 5 99 your program should give as output: min = 5 max = 99
If the user input is: 50 25 0 your program should give as output: min = 0 max = 50
An extension for a *bonus* of 3 points: Display the output as [min mid max] as well, 
If the user input is: 36 5 99 your program should give as output: min = 5 mid = 36 max = 99
If the user input is: 50 25 0 your program should give as output: min = 0 mid = 25 max = 50

Homework Answers

Answer #1

// If any doubt please comment

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
IN JAVA 1. Write up a small program that accepts two integers from the user. Print...
IN JAVA 1. Write up a small program that accepts two integers from the user. Print which of the two values is bigger. If they are the same, print that they are the same. 2. Write a method that accepts three doubles. Calculate and return the average of the three passed double values. 3. Write up a method that accepts a score between 0-10. Print out a message according to the following table. You ay personally decide the boundaries. i.e.,...
Write a function that accepts a line of text and a single letter as input (case...
Write a function that accepts a line of text and a single letter as input (case insensitive) and returns the number of times the letter is the first character of a word. Note your program should be able to handle different cases. And check if the user input is a single letter. Example: Input text = "When the SUN rises at dawn, the chicken flies into the window." Input letter = "t" Output = "The letter t has appeared 3...
(8 marks) Write a program to ask user to input an integer and display the special...
Write a program to ask user to input an integer and display the special pattern accordingly. REQUIREMENTS The user input is always correct (input verification is not required). Your code must use loop statements (for, while or do-while). Your program should use only the following 3 output statements, one of EACH of the followings: System.out.print("-"); // print # System.out.print("+"); // print + System.out.println(); // print a newline Your code must work exactly like the following example (the text in bold...
Please use Python 3 4). Write a program that asks the user to enter 10 numbers....
Please use Python 3 4). Write a program that asks the user to enter 10 numbers. The program should store the numbers in a list and then display the following data: • The lowest number in the list • The highest number in the list •The total of the numbers in the list • The average of the numbers in the list   Sample input & output: (Prompt) Enter Number 1: (User enter) 4 (Prompt) Enter Number 2: (User enter) 7...
I need python code for this. Write a program that inputs a text file. The program...
I need python code for this. Write a program that inputs a text file. The program should print the unique words in the file in alphabetical order. Uppercase words should take precedence over lowercase words. For example, 'Z' comes before 'a'. The input file can contain one or more sentences, or be a multiline list of words. An example input file is shown below: example.txt the quick brown fox jumps over the lazy dog An example of the program's output...
c++ 19.36 LAB: Output values below an amount - functions Write a program that first gets...
c++ 19.36 LAB: Output values below an amount - functions Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, and output all integers less than or equal to that value. Ex: If the input is: 5 50 60 140 200 75 100 the output is: 50 60 75 The 5 indicates that there are five integers...
Please complete the following function getMax, which accepts three integer parameters (int p, int q, int...
Please complete the following function getMax, which accepts three integer parameters (int p, int q, int r), and must return the maximum of those 3 integers received to the caller. int getMax(int p, int q, int r) // returns the max of 3 integers { // begin getMax() // Enter your code here:::::::::::::::::::::::::::::      } // end getMax() void main( ) // To test function getMax( ) { cout << "Data: 9 18 4 , Max = " << getMax(9,...
Please write the code in Python. Write a program/function in any Object-Oriented programming language that will...
Please write the code in Python. Write a program/function in any Object-Oriented programming language that will implement Queue Abstract Data Type with the following functions/methods.  Any build-in/pre-defined Queue function/library (e.g., java.util.Queue in Java) is NOT allowed to use in your code. push(Element):  insert the input Element (e.g., String or Integer in Java) to the end of the queue. pop(): remove the head element of the queue and print the head element on screen. count():  return the total number of elements in the queue...
You will write a program that loops until the user selects 0 to exit. In the...
You will write a program that loops until the user selects 0 to exit. In the loop the user interactively selects a menu choice to compress or decompress a file. There are three menu options: Option 0: allows the user to exit the program. Option 1: allows the user to compress the specified input file and store the result in an output file. Option 2: allows the user to decompress the specified input file and store the result in an...
Python #Imagine you're writing a program to check if a person is #available at a certain...
Python #Imagine you're writing a program to check if a person is #available at a certain time. # #To do this, you want to write a function called #check_availability. check_availability will have two #parameters: a list of instances of the Meeting class, and #proposed_time, a particular date and time. # #check_availability should return True (meaning the person #is available) if there are no instances of Meeting that #conflict with the proposed_time. In other words, it should #return False if proposed_time...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT