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
Which RFC reserves three ranges of IP addresses for private use - a single Class A (10.0.0.0-10.255.255.255), 16 Class Bs (172.1
erica [24]

Answer:

The answer is "1918".

Explanation:

The RFC stands for "remote function call", it is also known as an abbreviated form. It is an application, that responses in a technical online design Task Force, it is also known as a document, which was prepared for review by shareholders to collects some information.  

The RFC reverses is also known as an idea, that uses IP version 4 to reverse the IP address, this process is done by TCP/IP protocol, which is defined under RFC 1918.  

4 0
3 years ago
What is displayed on the console when running the following program?
Andre45 [30]

Answer:

The answer is "Option A"

Explanation:

In the given java code, a class "Test" is defined, inside the main method try and catch block is used, inside the try block method "p()" is called, that print a message. in this block two catch block is used, that works on "NumberFormatException" and "RuntimeException".  In the method "p" declaration, a string variable "s" is defined, that holds double value, that is "5.6", and converts its value into the wrong integer, and other wrong option can be described as follows:

  • In option B, it is wrong, it is not followed by after call method.
  • In option C, It is not followed by runtime exception, that's why it is incorrect.
  • Option D and Option E both were wrong because they can't give run time and compile-time error.  
6 0
3 years ago
Jackson is teaching a class the concept of the binary number system. Which term will he use to refer to the leftmost bit of a bi
Fofino [41]
Most significant digit. That's the same that it's called for any number system.
5 0
3 years ago
Read 2 more answers
Plz jon my discord server code is R88GTv join it
kotegsom [21]

Answer:

sure thing

Explanation:

3 0
3 years ago
Read 2 more answers
Which criterion can be used to select the appropriate type of network media for a network?
OverLord2011 [107]

There are various kinds of network media and each one of them has different features and benefits. Some have different characteristics and not all of them are meant to perform the same purpose. While choosing network media, a number of criteria must be met. These criteria include:

The distance the selected medium can successfully carry a signal.

The environment where the selected medium is to be installed

Explanation:

The distance the selected medium can successfully carry a signal – The type of network media you choose depends on the distance it can cover before you install signal boosters or repeaters. Repeaters are used to regenerate signals that are required to cover greater distances. A UTP cable as compared to fiber is more prone to interference like noise and the distance it covers before a signal repeater is installed is shorter. Fiber cable is considered the best for distances as it can cover longer distances.

Environment should also be considered when choosing network media - If your network is setup in a place where there is too much electromagnetic field being generated, then you may be required to purchase fiber optic cables. Fiber optics are immune to such interference.

Learn about network media

brainly.com/question/9279069

#LearnWithBrainly

3 0
3 years ago
Other questions:
  • This is a list of commands that tell your computer what to do. A icon B FAT C GUI D menu
    5·2 answers
  • People in STEM careers are considered thinkers who reach conclusions through sound judgment and reasoning.
    11·1 answer
  • A book of the Law was found in the Temple, which was being repaired, during what year of Josiah's reign.
    15·2 answers
  • What is a specific naming convention important in regards to your file management system<br> ?
    7·1 answer
  • You are informed that all the users within the network are unable to access the Internet. You decide to start troubleshooting fr
    12·1 answer
  • Of the sequences listed below, which shows the correct order of the steps in the incident management workflow: (1) authenticate
    14·1 answer
  • Which is the purpose of adding B-Roll footage to a sequence?
    10·1 answer
  • Which statement about intellectual property is true? (CSI-7.6) Group of answer choices It is okay to use code you find on the in
    14·1 answer
  • Another word for asking a question of your data is to _____ it.
    6·1 answer
  • What would be an ideal scenario for using edge computing solutions?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!