HELP IN C++ ONLY USING CODEBLOCKS Lab 8C: Write a program that declares an array
ID: 3690780 • Letter: H
Question
HELP IN C++ ONLY
USING CODEBLOCKS
Lab 8C:
Write a program that declares an array of 15 integers. Fill the array with random integers from 1 to 20, (generate the random numbers, the user does not enter them).
Print the contents of the array.
Once you have done that, count how many of the values in the array are even and how many are odd. Print each of these counts.
Sample Output:
Array: 3 4 8 19 12 15 11 16 2 1 4 9 10 12 15
Even Count: 8
Odd Count: 7
Lab 8D:
In this program you will use two arrays in parallel and perform some useful tasks that can be done using arrays.
Create an array to hold the ID’s (int) of 10 sales employees. Then create an array to hold the sales amounts for each employee that will parallel the array of IDs.
Write a loop to read in data for both arrays. (what type of loop is this?)
Write a second loop to display the data from both arrays lined up with column headings.
ID Sales
2121 $3456
2235 $5324
Write the code to find which salesperson had the highest sales. Print the employee’s ID and sales amount.
Write the code to find which salesperson had the lowest sales. Print the employee’s ID and sales amount.
Write the code to find the average sales for all 10 salespeople. Print this average.
rint the IDs of the salespeople who had below average sales and print the IDs of the salespeople who had above average sales. Make the output meaningful.
Allow the user to enter an ID. Search the ID array for that id number and then print the ID and the sales for that salesperson. If the ID is not present in the array of IDs print a message stating the search ID was not found.
Explanation / Answer
LAB 8C Program:
LAB 8D Program:
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.