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.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8RQ
icon
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.
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Datatypes
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
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning