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]
2 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]2 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
Why are high-quality transformers wound with large diameter wire?
lesya692 [45]
So that they can lower the I2R losses
8 0
3 years ago
Software (often on firmware) designed to make physical products and devices "smarter" by doing things like sharing usage informa
kolezko [41]

Answer:

embedded system

Explanation:

Based on the scenario being described within the question it can be said that the type of software that is being described is known as an embedded system. This is actually a combination of both hardware and software that focuses on a specific function which is later implemented into a much larger system to allow it to become "smarter", by performing more complex tasks, which would otherwise not be possible.

5 0
3 years ago
Characteristics of first generation computers​
Marrrta [24]
* Main Electron a component- vacuum tube.

* Main memory- Magnetic drums and magnetic tapes.

* Programming language- Machine language.

* Power- Consume a lot of electricity and generate a lot of heat.

* were expensive to operate
5 0
2 years ago
Brainliest forrrrrrr frrrrrew right herrreeee
nikdorinn [45]

Answer:

Hi!

Explanation:

Thank You So Much For The Points.

5 0
2 years ago
Do applications need to exchange udp control messages before exchanging data
Molodets [167]

The answer is NO.

Thats what makes UDP connectionless. Aclient that is going to send a UDP message to the server just sends it.The server does not know it is coming untill it arrives .When a server recieves a UDP message it gets the source address/port and the data.

7 0
3 years ago
Other questions:
  • The mutt software is an example of what type of mail service software on Linux? a. Mail Delivery Agent b. Mail Transport Agent c
    5·1 answer
  • What is the order of arrangement of files and folders on a computer?
    15·1 answer
  • A ____ appears at the bottom of your e-mail messages and contains standard information about yourself that the recipient can use
    5·1 answer
  • Question 4: What will be the output of the code? Show a complete analysis.
    6·1 answer
  • Overlay analysis is ____________, taking in data from two or more layers to create a single output layer.
    5·1 answer
  • The _____ of a local variable is the function in which the variable is created.
    6·1 answer
  • What are 3 software programs for mobile computing?
    10·1 answer
  • क) मानौं तिमी बसेको समाजमा मान्छेहरूले सधै फोहर फाल्ने गर्नाले वातावरण प्रदूषित
    13·1 answer
  • Help!!
    15·1 answer
  • What is the purpose of quick access toolbar?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!