Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that reads a collections of positive and negative integers and multiplies only the positive integers. Loop exit should occur when three consecutive

Write a program that reads a collections of positive and negative integers and multiplies only the positive integers. Loop exit should occur when three consecutive negative values are read.

Example output requirements: Enter positive #: 2 Enter positive #: 4 Enter positive #: 8 Enter positive #: -1 Enter positive #: 2 Enter positive #: -1 Enter positive #: -2 Enter positive #: -3 Product of positive integers is 128

2.cpp Write a program to find the largest, smallest, and average values in a collection of n numbers where the value of n will be the first data item read.

Example output requirements: Enter n: 4 #1: 2 #2: 3 #3: 4 #4: 1 Smallest: 1 Largest: 4 Average: 2.5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago