Write a Python program that inputs five positive integer numbers, finds their maximum and sort them in ascending order. Each number should be a distinct number (i.e. all numbers are different). Each number should be input and returned by a function named getValue(..) that receives a prompt message. A second function ascSortNumbers(--) should sort numbers and display them on screen in ascending order. A third function maxNumber(..) should receive five numbers as parameters and returns the maximum number to the function main(..), which then prints the maximum number.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.4: A Case Study: Rectangular To Polar Coordinate Conversion
Problem 9E: (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by...
icon
Related questions
icon
Concept explainers
Question
100%
Exercise 1:
Write a Python program that inputs five positive integer numbers, finds their maximum and sort them in ascending order. Each
number should be a distinct number (i.e. all numbers are different).
Each number should be input and returned by a function named getValue(..) that receives a prompt message. A second function
ascSortNumbers(..) should sort numbers and display them on screen in ascending order. A third function maxNumber(..) should
receive five numbers as parameters and returns the maximum number to the function main(..), which then prints the maximum
number.
Please input 5 numbers: 30 30 20 10 56
Invalid input, try again
Please input 5 numbers: -9 67 20 10 97
Invalid input, try again
Please input 5 numbers: 17 15 8 98 2
Sorted: 2 8 15 1798
Maximum is: 98
Figure 1. Exercise 1 Sample Run.
Transcribed Image Text:Exercise 1: Write a Python program that inputs five positive integer numbers, finds their maximum and sort them in ascending order. Each number should be a distinct number (i.e. all numbers are different). Each number should be input and returned by a function named getValue(..) that receives a prompt message. A second function ascSortNumbers(..) should sort numbers and display them on screen in ascending order. A third function maxNumber(..) should receive five numbers as parameters and returns the maximum number to the function main(..), which then prints the maximum number. Please input 5 numbers: 30 30 20 10 56 Invalid input, try again Please input 5 numbers: -9 67 20 10 97 Invalid input, try again Please input 5 numbers: 17 15 8 98 2 Sorted: 2 8 15 1798 Maximum is: 98 Figure 1. Exercise 1 Sample Run.
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr