Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 9 Weeks Ago, 5 Days Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
.Write a short program that takes four float numbers and it prints out the average of the highest 3 of these numbers.Â
Hint: use the built-in function min()
3.Write a program that can compute the area of a circle, a triangle or a rectangle, based on the user choice.Â
First the program should ask the user to choose their preference (circle, triangle or rectangle). Then the program should ask for the appropriate input:
-If user's choice is circle, program should ask for a radius parameter.
-If user's choice is triangle, program should ask for base and height parameters.
-If user's choice is rectangle, program should ask for width and height parameters.
The program should then calculate the area of the chosen shape, and print an output statement to report the area of that shape.
4.Write a short program where the user is asked to provide a sentence. The program should then print out the length (i.e. number of characters) of the sentence. The program must continue to receive user input, until the user provides some sort of halt signal. It is up to you what the halt signal should be (i.e. user can halt by typing quit, q, pressing return key, etc.)
Hint: use the built-in function len() to calculate the length of a string
-----------