program5_1.pyWrite a program that uses a custom function to generate a specified number of random integers in a specified range. This custom function should take three arguments; the number of integers to generate, the lower limit for the range, and the upper limit for the range. Values for these arguments should be entered by the user in main. The custom function should display the random integers on one line separated by single spaces. The function should also report how many numbers were even and how many were odd. Finally, the function should calculate the total of the random integers and return this total back to main where it will be printed. User inputs in main are shown in blue.Sample OutputHow many integers are to be generated 8Enter the lowest integer desired 10Enter the highest integer desired 2016 14 19 20 12 15 18 186 evens and 2 odds were generatedThe total of those 8 random numbers is 132

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.2: Returning A Single Value
Problem 13E
icon
Related questions
Question

program5_1.py
Write a program that uses a custom function to generate a specified number of random integers in a specified range. This custom function should take three arguments; the number of integers to generate, the lower limit for the range, and the upper limit for the range. Values for these arguments should be entered by the user in main. The custom function should display the random integers on one line separated by single spaces. The function should also report how many numbers were even and how many were odd. Finally, the function should calculate the total of the random integers and return this total back to main where it will be printed. User inputs in main are shown in blue.
Sample Output
How many integers are to be generated 8
Enter the lowest integer desired 10
Enter the highest integer desired 20
16 14 19 20 12 15 18 18
6 evens and 2 odds were generated
The total of those 8 random numbers is 132

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
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
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