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
Tatiana [17]
3 years ago
6

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.
Computers and Technology
1 answer:
stiv31 [10]3 years ago
6 0

Complete Question:

Design a program that will use a pair of nested loops to read the company's sales amounts. The details are as follows: -

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 for 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

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;}  

You might be interested in
A large retailer is asking each customer at checkout for their zip code. if the zip code is the only recorded variable, what is
Varvara68 [4.7K]

Answer:

Nominal

Explanation:

  • So while singing the question, let's further move to the answer. So let's see here and there.
  • The first option is B. S, which corrects gross sectional data, And the 2nd 1 of Nominal, C. Is correct nominal. So here are the buddha points which are given in the question.
  • The first one, option B is correct cross-sectional data, And the 2nd 1, is option C. Is correct nominal.

To learn more about it, refer

to brainly.com/question/25458754

#SPJ4

7 0
2 years ago
Which aspect of business does accounting measure?
VladimirAG [237]

financial aspect

Accounting measurement is the computation of economic or financial activities in terms of money, hours or other units. An accounting measurement is a unit of some measurable element that is used to compare and evaluate accounting data. Accounting is often measured in terms of money.

6 0
3 years ago
Cloud architects have been largely replaced by ScrumMasters.<br><br> True<br><br> False
Kitty [74]
True much larger than scrum masters
6 0
3 years ago
Read 2 more answers
You decide to store data in the user's browser in order to reduce the amount of data that must be downloaded. What is this proce
Lemur [1.5K]

Answer:

client-side storage

Explanation:

The process of doing this is known as client-side storage. Like the name suggests this saves data that is sent to the user's computer on that computer either as cookies or cached data. This data is then used every time that the user decides to enter the same website or access the same program from the browser. Doing this allows these websites and programs to load much faster the more times that the user decides to enter them.

5 0
3 years ago
You have the following code:
My name is Ann [436]

Answer:

7

Explanation:

We already have the functions that tells us how much to add. If you add all this, you will get 12. HOWEVER because cantaloupe is in the list, the computer does not count that. So if we add that again without 5(how much the cantaloupe costs), we get 7.

3 0
2 years ago
Other questions:
  • Investigations involving the preservation, identification, extraction, documentation, and interpretation of computer media for e
    12·1 answer
  • Which of the following statements best reflects the usefulness of commercial digital editing programs?
    7·1 answer
  • The next four octal numbers after 36 is:________.
    10·1 answer
  • Assume the input data is structured as follows: first there is a non-negative integer specifying the number of employee timeshee
    9·1 answer
  • What is a bin range?
    14·1 answer
  • Please help meh T^T Which of the following describes an application error? Select 2 options.
    5·2 answers
  • Implement the function printTwoLargest that inputs an arbitrary number of positive numbers from the user. The input of numbers s
    14·1 answer
  • Consider a short, 90-meter link, over which a sender can transmit at a rate of 420 bits/sec in both directions. Suppose that pac
    9·1 answer
  • Write a function named dice_eval that accepts two parameters representing numeric dice values and returns a string describing th
    14·1 answer
  • A document that summarizes and displays data is called a: Group of answer choices Report Procedure Form Requirement
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!