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
During the weekend, Alice often needs to access files stored on her office desktop from her home laptop. Last week, she installe
ICE Princess25 [194]

Answer:

Depending on the error message which Alice get but what could have gone wrong is perhaps firewall issue.

Explanation:

There are lots of probable reason why Alice could not access her files during the weekend but below are some common reasons:

Firewall issue: Maybe Alice has her firewall turned on unknowingly as it is known that firewall do block such types of connection except it is explicitly allowed from the firewall settings.  Another issue might be that, Alice ISP uses firewall.

FTP programs Setting: Perhaps there is a settings which Alice has not activated in the FTP program that she is using.

3 0
4 years ago
What is the difference between the web and the internet?
Naddika [18.5K]
The Web is just one of the ways that information can be disseminated over the Internet
4 0
3 years ago
Eugene wants to indent a paragraph, but the ruler is not present. Which tabs could Eugene use in order to accomplish his goal?
Anettt [7]

Answer:

The answer is "View and page layout."

On google docs, you can click 'tab' on the keyboard to indent a paragraph. I don't know if that's the same on all software though.

hope this helps

7 0
4 years ago
While working on a forty-slide PowerPoint presentation, a user needs to quickly look over the six slides that have orange backgr
guapka [62]

Answer:

B

Explanation:

8 0
3 years ago
I need ideas for a scratch (imagine, share, and program) coding project. You can think of any project you'd like thanks! :)
alex41 [277]

You did not include enough information.

5 0
3 years ago
Read 2 more answers
Other questions:
  • Encryption is the process of:
    12·1 answer
  • Writenames of eight output device.​
    8·1 answer
  • Python
    14·1 answer
  • How can I change it to accepted file types: .ppt, .pptx, .xls, .xlsx, .doc, .docx, .zip, .pdf, .accdb, .msg on Inkscape?
    15·2 answers
  • What is the output of the following program? #include using namespace std; class TestClass { private: int val; void showVal() {
    5·1 answer
  • William found out that someone used his report on American culture without his permission. What is William a victim of? A. plagi
    7·2 answers
  • 2 (01.01 LC)
    5·1 answer
  • Which of these is an expansion slot type?
    5·1 answer
  • How can your network be infected with malware or ransomware?
    6·1 answer
  • Software is in -----language​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!