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
Amiraneli [1.4K]
3 years ago
15

KDS Company has 3 departments: 1. Dept X 2. Dept Y 3. Dept Z. Design a program that will read as input each department's sales f

or each quarter of the year, and display the result for all divisions. Use a two dimensional array that will have 3 rows and 4 columns and show how the data will be organized.
Computers and Technology
1 answer:
AVprozaik [17]3 years ago
6 0

Answer:

In C++:

#include<iostream>  

using namespace std;  

int main() {  

  int depts[3][4];

  char dptcod [3] ={'X','Y','Z'};

  for (int rrw = 0; rrw < 3; rrw++) {  

      for (int cll = 0; cll < 4; cll++) {  

          cout<<"Dept "<<dptcod[rrw]<<" Q"<<(cll+1)<<": ";

          cin>>depts[rrw][cll];  }  }  

      for (int rrw = 0; rrw < 3; rrw++) {  

          int total = 0;

          for (int cll = 0; cll < 4; cll++) {  

              total+=depts[rrw][cll]; }

              cout<<"Dept "<<dptcod[rrw]<<" Total Sales: "<<total<<endl;}  

  return 0; }

Explanation:

This declares the 3 by 4 array which represents the sales of the 3 departments

  int depts[3][4];

This declares a character array which represents the character code of each array

  char dptcod [3] ={'X','Y','Z'};

This iterates through the row of the 2d array

  for (int rrw = 0; rrw < 3; rrw++) {  

This iterates through the column

      for (int cll = 0; cll < 4; cll++) {

This prompts the user for input

          cout<<"Dept "<<dptcod[rrw]<<" Q"<<(cll+1)<<": ";

This gets the input

          cin>>depts[rrw][cll];  }  }  

This iterates through the row of the array

      for (int rrw = 0; rrw < 3; rrw++) {

This initializes total sum to 0

          int total = 0;

This iterates through the column

          for (int cll = 0; cll < 4; cll++) {

This calculates the total sales of each department

              total+=depts[rrw][cll]; }

This prints the total sales of each department

              cout<<"Dept "<<dptcod[rrw]<<" Total Sales: "<<total<<endl;}  

I hope this helps a little bit

You might be interested in
Assume that sentence is a variable that has been associated with a string consisting of words separated by single space characte
sleet_krkn [62]

The right code is,

secondWord = sentence.substr (sentence.find ("`") + 1);

secondWord = secondWord.substr (0, secondWord.find ("`"));

3 0
3 years ago
Read 2 more answers
Adjusting the ______ adjusts the difference in appearance between light and dark areas of the photo.​
Svetach [21]

Answer:

contrast

Explanation:

4 0
3 years ago
Read 2 more answers
Apakah ada yang bisa menjelaskan potongan source code ini?
GarryVolchara [31]

This code attempts to fuse two strings together. So,

fuse("Apple", "Banana")

would return "ABpapnlaen a"

However, there are a couple of things wrong with this code:

- The for loop is incomplete (probably a copy paste error)

- It is unclear from the code if the array jawaban will overflow if kata1 and kata2 are large (it probably will)

- Biggest problem: the jawaban array is declared on the stack, which means it will be cleaned up when the function returns. So the caller of this function will reference unallocated memory! This is a huge bug!!

6 0
3 years ago
Often, a single source does not contain the data needed to draw a conclusion. It may be necessary to combine data from a variety
nlexa [21]

To measure the pollution of a particular river, one must take the sample of the river and take the sample of pure water, then draw the conclusion, it will tell the amount of pollution in the river water.

<h3>What is pollution?</h3>

Pollution is the mixing of unwanted or harmful things in any substance or compound.

Water pollution is the mixing of toxics and chemicals in water.

Thus, to measure the pollution of a particular river, one must take the sample of the river and take the sample of pure water, then draw the conclusion, it will tell the amount of pollution in the river water.

Learn more about pollution

brainly.com/question/23857736

#SPJ1

6 0
2 years ago
Question 1 (True/False Worth 15 points)
liraira [26]

It is a programmer's responsibility to contribute to society and human well-being is true.

Explanation:

  • It is a programmer's responsibility to contribute to society and human well-being is true.
  • The Association for Computing Machinery (ACM) is known as  the world's largest educational and scientific computing society.
  • It has its own Code of Ethics and another set of ethical principles which were also approved by the IEEE as the known standards of teaching and practicing software engineering.
  • Programmers contribute to develop computer systems which can reduce negative impression to the society.
  • The negativity includes as threats to safety and health, which can be reduced and make everyday activities and work easier.
  • software developers should reduce the risk of harming others due to the coding errors or the security issues which could impact human well-being.

3 0
3 years ago
Other questions:
  • An electronic resume is a plain-looking document. True of False?
    6·2 answers
  • Jennifer recently bought a new computer to type a new manuscript she’s been working on. She also stored a lot of movies on it to
    10·1 answer
  • Select the correct answer.
    6·1 answer
  • Rick is linking different pages in his website. Match the value of the attribute to its meaning to enable Rick to choose the mos
    13·1 answer
  • Designers and graphic artists can print finished publications on a color printer, take them to a professional printer, or post t
    15·1 answer
  • Ohanians “great big secret” is that:
    8·1 answer
  • Why, y did brainly just do that........or did it just happen to me
    12·2 answers
  • ¡Hola! He visto en muchos comentarios de Twitter "svd" cuando alguien dice "dale fav a este Tweet y siganse entre ustedes" y en
    8·1 answer
  • Why do attackers tend to target public or private Wi-fi networks?
    10·1 answer
  • How can you prevent someone with access to a mobile phone from circumventing access controls for the entire device
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!