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: 0. 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". 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 (1). Sample program runs as below: Enter a month:2 The sales for February is RM6000 (i). 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 1) and its actual sales figures respectively. For example if April, September and Octesber sales are below RM 2000, then display the output as below: April RM1400 September RM1350 October RM1230 3 months Sales below RM2000
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: 0. 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". 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 (1). Sample program runs as below: Enter a month:2 The sales for February is RM6000 (i). 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 1) and its actual sales figures respectively. For example if April, September and Octesber sales are below RM 2000, then display the output as below: April RM1400 September RM1350 October RM1230 3 months Sales below RM2000
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
C++
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 6 steps with 4 images
Knowledge Booster
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.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education