programming Assume an integer array of size 12 named arrSales stores the sales of a product for each month. For example, sales for January should be stored in 1st position of the array, and February is stored in 2nd position of the array and so on for the rest of the months. Write a segment of code

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 6PP: (Numerical) a. Define an array with a maximum of 20 integer values, and fill the array with numbers...
icon
Related questions
Question

 C++ programming

Assume an integer array of size 12 named arrSales stores the sales of a product for each
month. For example, sales for January should be stored in 1st position of the array, and
February is stored in 2nd position of the array and so on for the rest of the months.
Write a segment of code in C++ that perform the following:

1. Define a string array of size 12 and initialise the values of the array with the values to
the calendar months from “January” to “December”.

2.. Prompt user to enter a month in integer (e.g 1 for January). Then, display the sales
figure based on that month. Make sure month is display in letter format by using the
array defined in (i). Sample program runs as below:
Enter a month:2
The sales for February is RM6000

3.. Using loop structure, count the number of months where the sales is below RM2000.
You should display the result, list the affected months (by using the array defined in
(i)) and its actual sales figures respectively. For example if April, September and
Octorber sales are below RM 2000, then display the output as below: 

April RM1400
September RM1350
October RM1230
3 months Sales below RM2000

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning