Focusing on Intermediate Programming —Solve one of the “building block” —A grocer first enters the prices of five items from his store. Then the grocer enters another price, and is told how many prices fall below that value. A program written in a straightforward manner might look like this: double price1, price2, price3, price4, price5; double threshold; int count = 0; cout cin >> price1 >> price2 >> price3 >> price4 >> price5; cout cin >> threshold; if (price1 count++; if (price2 count++; if (price3 count++; if (price4 count++; if (price5 count++; cout —Grocer decides that ten items need to be entered instead of five. You then must create five new float objects and five new if statements. Suppose the grocer needs to enter a hundred items? A thousand? —-Use arrays to solve this problem
Focusing on Intermediate Programming—Solve one of the “building block”—A grocer first enters
the prices of five items from his store. Then the grocer enters another price, and is told how many prices fall below that value. A program written in a straightforward manner might look like this:
double price1, price2, price3, price4, price5;
double threshold;
int count = 0;
cout cin >> price1 >> price2 >> price3
>> price4 >> price5;
cout cin >> threshold;
if (price1 count++;
if (price2 count++;
if (price3 count++;
if (price4 count++;
if (price5 count++;
cout
—Grocer decides that ten items need to be entered instead of five. You then must create five new float objects and five new if statements. Suppose the grocer needs to enter a hundred items? A thousand?
—-Use arrays to solve this problem
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"
