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
________ are devices in a computer that are in either the on or off state
Vanyuwa [196]
The appropriate response is Electrical Switches. These are electromechanical gadgets that are utilized as a part of electrical circuits to control, recognize when frameworks are outside their working reaches, flag controllers of the whereabouts of machine individuals and work pieces, give a way to manual control of machine and process capacities, control lighting, et cetera.
6 0
3 years ago
What are 6 external parts or perpherals of a computer system and identify output from input devices.
n200080 [17]
40. External Peripherals of a Computer systems are the following: -> Keyboard – this is an input device -> Mouse – This is an input device also -> Printer – this is an output device -> Flashdrive – This is a storage device -> Monitor – this is an output device -> external hard drive – this is a storage device Output device are those devices that communicate the results of the data processing to the user Input device are those device that communicate the results of the data processing to the computer system Storage device are those device that stores data.
4 0
3 years ago
Which of the following calculates to 10?
nikdorinn [45]
The third one because u have to do parenthesis
7 0
3 years ago
Read 2 more answers
______and______<br>are examples of utility<br>software.<br>can anyone say the answer ​
Viktor [21]

Answer:

File Management Tool

Compression Tool

Explanation: type it into the internet and the answer is there. :)

8 0
3 years ago
Please Helppp!!!! What type of lighting works best in the morning and at dusk?
alexira [117]

Answer:

solar light

Explanation:

This is because at this time, the sun is in the right place to illuminate the scene from the right angles, without overpowering the photograph. Light is one of the most important factors to take into account when taking a photograph.

8 0
2 years ago
Other questions:
  • If a filesystem has a block size of 4096 bytes, this means that a file comprised of only one byte will still use 4096 bytes of s
    12·1 answer
  • What addresses do not change if you copy them to a different cell?
    7·1 answer
  • 6. While using the HTS, ________________ will help maintain a safe driving environment despite high speeds and a large number of
    12·1 answer
  • The IT infrastructure components should be evaluated based on their expected financial value. All of the following are used to q
    15·1 answer
  • A large amount of scatter in a scatterplot is a indication that the association between the two variables is
    13·2 answers
  • WILL GIVE BRAINLIEST ANSWER!!!<br><br> How do you manage your screen time?
    8·2 answers
  • Whats the answer :)?<br>i will give brainslist​
    11·1 answer
  • Describe the steps to change an existing macro in Microsoft office 2016
    6·1 answer
  • True and False(Total points: 10)
    12·2 answers
  • What is essential for a good study routine? Select four options.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!