1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
goblinko [34]
3 years ago
13

Assume that the array monthSales of integers has already been declared and that its elements contain sales data for the 12 month

s of the year in order (i.e., January, February, etc.). Write a statement that writes to standard output the element corresponding to October. Do not write anything else out to standard output.
Computers and Technology
1 answer:
bonufazy [111]3 years ago
6 0

Answer:

The c++ statement to display the sale corresponding to the month of October is given below.

cout << monthSales[9];

Explanation:

The integer array monthSales contains data for 12 months beginning from January to December, in the order in which the months appear.

January sales is represented by index 0 while December sales is given by index 11.

Hence, the index of the array is one less than the numerical value of the month.

The sales value corresponding to October, the tenth month, is given by index 9, monthSales[9].  

Only the sales for October is displayed as per the question. Nothing else is displayed.

The c++ program to implement the above statement is given below.

#include <iostream>

using namespace std;

int main() {

   // array containing sales data for 12 months

   int monthSales[12];

monthSales[12] = { 1234, 2345, 3456, 4567, 5678, 6789, 7890, 8901, 9012, 1208, 1357, 2470 };

       // only sales data corresponding to month of October is displayed  

   // nothing else is displayed

   cout << monthSales[9];

return 0;    

}

OUTPUT

1208

First, the array is declared.

   int monthSales[12];

The keyword int represents the integer data type of the array.

The number 12 indicates the length of the array. The array will contain 12 values.

The index of the last element will be 12 – 1 = 11.

This is followed by initialization with twelve numerical values.

monthSales[12] = { 1234, 2345, 3456, 4567, 5678, 6789, 7890, 8901, 9012, 1208, 1357, 2470 };

Only the value for October needs to be displayed. This is achieved by the below statement.

   cout << monthSales[9];

The cout keyword is used to display to the standard output.  

No new line character is inserted. No message is displayed.

The sales data can be modified. Only integer values should be taken. Floating or double values will not compile and an error will be displayed.

You might be interested in
Create the content for your website.
arlik [135]
What do you need help with? I’m confused
5 0
3 years ago
Differentiate the term, "bundling," as applied to a Mac/Apple computer and a PC.
saw5 [17]

Answer:

Mac comes with the up (or is bundled with) the up-to-date OS where with windows there are multiple flavors to choose from.

Explanation:

Sorry if its wrong

8 0
2 years ago
A) Construct NFA accepting a language L = a (ae)*or (iou)*. ∑ = {a, e,i, o,u} b) Convert the above NFA to an equivalent DFA by u
frutty [35]

ksoxkajsjjwjxjxiqwikwkak,hsjsjskxkososlajzhxjwjskksoa

8 0
2 years ago
The old german word brouh, which meant "wet ground," became the old english word broc, which meant "stream." which modern englis
Marat540 [252]
Its 100% A bark and i am writing extra cause My answer has to be more than 20 letters
4 0
3 years ago
Read 2 more answers
Importance of good safe design
KengaRu [80]

Answer:

Safe design incorporates ergonomics principles as well as good work design. Good work design helps ensure workplace hazards and risks are eliminated or minimised so all workers remain healthy and safe at work.

Explanation:

Good work design, or safety in design, considers hazards and risks as early as possible in the planning and design process. It aims to eliminate or minimise the possibility of workplace injury or illness throughout the life of the product or process. ... products. layout and configuration

3 0
2 years ago
Read 2 more answers
Other questions:
  • Make three statements about technology
    9·1 answer
  • You browsing internet and you realize that its not responding what do you do with out rebooting the computer
    10·1 answer
  • An independent frame that holds a program, document, or folder contents in windows 7 is called a ____.
    11·1 answer
  • . What may happen if a large number of computer users are attempting to access a Web site at the same
    10·2 answers
  • ILL GIVE BRAINLIEST You are taking a photograph of a valley and want to draw attention to a hamlet hidden amid the hills. Which
    10·2 answers
  • How often does colleges update the cost of attendance on their website?.
    13·1 answer
  • Is a bottle opener considered an engineered item?
    12·1 answer
  • Electronic mail is a
    9·1 answer
  • Q1). Write a python program to pass a list to a function and double the odd values and half even values of a list and display li
    12·1 answer
  • What does it mean when your phone says not registered on network?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!