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
What is a good rule of thumb for how much white space you should have in a flyer or poster
almond37 [142]
Poster because if you have that much space....well what I do is calculate it by the centimeters in square divide:)
6 0
3 years ago
Read 2 more answers
With modeling and simulation, we model the system and then test the ______________ to gather test predictions.
Kobotan [32]

Answer:

With modeling and simulation, we model the system and then test the system to gather test predictions.

Explanation:

You would have to test the system in order to see if it's working right and everything is all good with the system.

I hope this helped. I am sorry if you get this wrong.

4 0
3 years ago
What type of information is appropriate for headers and footers? Check all that apply.
lbvjy [14]

Answer:

slide/page number

smart art

maybe date and time

Explanation:

6 0
3 years ago
Read 2 more answers
. Assuming each reference costs 1 byte, and each piece of data/info costs 1 byte as well. When will a doubly linked list be more
mixer [17]

Answer:

The circular individually linked list is more efficient for time sharing process ,when multiple application are running on pc it is responsibility of an output system to put all process on a list and execute them all by giving them piece of time and make them wait when cpu is selected to other process.

It will be more suitable for output system to use circular list as when it reaches to last of list it will be manually reaches to starting node or process.

Singly circular linked list is used when we are concerned with the memory as only one process will be allocated memory at once and there are no chances of process to go never-ending waiting.

Explanation:

4 0
3 years ago
Please Help Me!!! 40 Points!! Match the correct definition to each term
fgiga [73]

Answer:

is there anymore to this problem because I would like to help you out more mate.

6 0
3 years ago
Other questions:
  • Jennifer has been hired as a temporary employee at a local college. She is given a username and password to access certain parts
    14·2 answers
  • Match each keyboard command with its result.
    6·1 answer
  • Science is a body of knowledge that extends back to Select one: a. the time of Galileo. b. Italy in the 16th century. c. Greece
    6·1 answer
  • Edhesive coding practice 3.4​
    12·1 answer
  • Solve the recurrence relation.<br> S(1)=1<br> S(n)= S(n-1)+(2n-1) for n&gt;=2
    13·1 answer
  • Which of the following information should be included in audit documentation? a. Procedures performed. b. Audit evidence examine
    13·1 answer
  • Give your own example of a nested conditional that can be modified to become a single conditional, and show the equivalent singl
    12·1 answer
  • How to fix a light blub
    11·2 answers
  • Which of the following technologies does NOT facilitate the transferring of data between computers in adjacent buildings?
    12·1 answer
  • Monero is cryptocurrency that focuses on transparency of ownership. True or false
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!