A group of 30 people have gone apple picking at Battleview Orchards. Each person has picked a number of apples.  Your C++ program will create a file containing 30 random numbers with values between 2 and 75.  These numbers represent the number of apples a person picked.  You are then to determine  a.    How many people picked 10 or fewer apples. b.    How many people picked between 50 and 75 apples c.    The average number of apples picked d.    For those who picked between 2 and 5 apples change that number to 0 (they ate their apples)  and print the new array contents. The functions you must write: a. Write a function to create an input data file of 30 random numbers with values between 2 and 75.  You can do this by writing a short C++  loop in your function.  As you create the numbers print them out (on the screen), 2 spaces between each number   and print the 30 random numbers the file, then close the file and (open it as input in main)  b.  Passing the array to a count function, determine how many of the people picked 10 or fewer  apples The function returns the count to main. Main prints the result.  c.  Pass the array to another count function to determine how many of the numbers are between 50 and 75 apples,  The function returns the count to main. Main prints the result.  d:  Pass the array to a function to compute the average number of apples picked, The function returns the average to main.  Main will print the result.  e. Pass the array to a function and change all apple numbers that are between 2 and 5 to 0¸  Print the revised array in main.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

A group of 30 people have gone apple picking at Battleview Orchards. Each person has picked a number of apples. 
Your C++ program will create a file containing 30 random numbers with values between 2 and 75.  These numbers represent the number of apples a person picked.  You are then to determine 
a.    How many people picked 10 or fewer apples.
b.    How many people picked between 50 and 75 apples
c.    The average number of apples picked
d.    For those who picked between 2 and 5 apples change that number to 0 (they ate their apples)  and print the new array contents.
The functions you must write:
a. Write a function to create an input data file of 30 random numbers with values between 2 and 75.  You can do this by writing a short C++  loop in your function.  As you create the numbers print them out (on the screen), 2 spaces between each number   and print the 30 random numbers the file, then close the file and (open it as input in main) 
b.  Passing the array to a count function, determine how many of the people picked 10 or fewer  apples The function returns the count to main. Main prints the result. 
c.  Pass the array to another count function to determine how many of the numbers are between 50 and 75 apples,  The function returns the count to main. Main prints the result. 

d:  Pass the array to a function to compute the average number of apples picked, The function returns the average to main.  Main will print the result. 
e. Pass the array to a function and change all apple numbers that are between 2 and 5 to 0¸  Print the revised array in main. 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY