Limited time offer

Get 25% off your order

Use the code below at checkout — offer expires soon.

Your promo codeBESTW25
25%
Expires in: 10:00
Claim my 25% discount

🎓 Get 20% off your first order! Use code FIRST20 at checkout. Order Now →

Home Write a C++ program that inputs a list of integers of known size and uses acounter-controlled while loop to count of the number of positive integers, count the numberof negative integers and count

Write a C++ program that inputs a list of integers of known size and uses acounter-controlled while loop to count of the number of positive integers, count the numberof negative integers and count

Part A:
Write a C++ program that inputs a list of integers of known size and uses a
counter-controlled while loop to count of the number of positive integers, count the number
of negative integers and count the number of zeros in the list. It also calculates the sum of
the positive integers and the sum of the negative integers.
After the while loop, it outputs the count of the positive integers, the count of the negative
integers and the count of the zeros in the list. It also outputs the sum of the positive integers
and the sum of the negative integers.
Also, it calculates and outputs the average of the list. The average should be formatted to
two digits after the decimal.
Test Case 1:
Enter the size of the list: 7 Enter an integer: 2
Enter an integer: 18 Enter an integer: 400 Enter an integer: -63 Enter an integer: 0
Enter an integer: -27
Enter an integer: 9
The count of the positives: 4
The count of the negatives: 2
The count of the zeros: 1
The sum of the positives: 429
The sum of the negatives: -90
The average of the list of integers: 48.43
Part B:
Add a for loop to the above program to test more than one set of integers.

📝 Need Help With a Similar Assignment?

Our expert writers can deliver a 100% original, plagiarism-free paper tailored to your requirements with fast turnaround.

Get Professional Help Now →
WhatsApp
Limited Offer Get 25% off — use code BESTW25
No AI No Plagiarism On-Time Delivery Free Revisions
Claim Now