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 17 98 Maximum is: 98 Figure 1. Exercise 1 Sample Run.
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 17 98 Maximum is: 98 Figure 1. Exercise 1 Sample Run.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8RQ
Related questions
Question
![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 17 98
Maximum is: 98
Figure 1. Exercise 1 Sample Run.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ffda25008-6811-4f3a-896c-3b0e49712a6d%2Fbe57e46c-754c-4d27-8fd3-d6c9efcb96f1%2Ffo467v_processed.jpeg&w=3840&q=75)
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 17 98
Maximum is: 98
Figure 1. Exercise 1 Sample Run.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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.Recommended textbooks for you
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Systems Architecture](https://www.bartleby.com/isbn_cover_images/9781305080195/9781305080195_smallCoverImage.gif)
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning