b) 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 1* position of the array, and February is stored...


C++ programming


b) Assume an integer array of size 12 named arrSales stores the sales of a product for each<br>month. For example, sales for January should be stored in 1* position of the array, and<br>February is stored in 2nd position of the array and so on for the rest of the months.<br>Write a segment of code in C++ that perform the following:<br>(). Define a string array of size 12 and initialise the values of the array with the values to<br>the calendar months from “January

Extracted text: b) 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 1* 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: (). 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". (ii). Prompt user to enter a month in integer (s.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 (ii). 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 () and its actual sales figures respectively. For example if April, September and Octerber sales are below RM 2000, then display the output as below: April RM1400 September RM1350 October RM1230 3 months Sales below RM2000

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here