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]
2 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]2 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
Which of the following has likely attended vocational school?
JulsSmile [24]

C- A graphic designer is the awnser

7 0
3 years ago
A user logs into Active Directory on a workstation and the user home directory does not redirect to a network share on a file se
inysia [295]

Answer:

gpresult

Explanation:

Group Policy provides the system administrator with settings that would be necessary to manage the different user accounts available in an organization. It also controls their work environment centrally by configuring the user Operating System (OS), applications and user accounts.

Group policy settings or configurations are referred to as Group Policy Objects (GPOs). These objects can be linked to organizational units (OUs), domains or sites.

There are various group policy commands such as;

  1. rstrui (System Restore tool will run),
  2. runas (using different permission to run a tool or program),
  3. tasklist (currently running programs are shown
  4. gpupdate (Group policies are refreshed)
  5. gpresult (group policy configurations are displayed for verification)

gpresult command can be used to verify the group policy configurations for adjustment or optimization. The technician can start troubleshooting from viewing the active settings, then running the rstrui to start the System Restore utility to restore the computer to an earlier date

6 0
3 years ago
What is the big-O performance estimate of the following function?
larisa [96]

Answer:

The time complexity of the code is O(log₇n).

Explanation:

The i is updated by 7*i.On each iteration i is multiplied by 7.So on finding the time complexity of the code given above it will come out to  be log base 7.

When we divide the input by 2 the time complexity is log base 2.

So on dividing it by 7 we get the time complexity of log base 7.

8 0
3 years ago
Read 2 more answers
What type of software translates a programmer’s statements to binary form?
Aleks04 [339]
A compiler, which has several parts, translates source code to executable code.
3 0
3 years ago
Which of the following is not a use of a hash function
soldi70 [24.7K]

Answer:

the answer would be there

Explanation:

7 0
2 years ago
Other questions:
  • Why is it a mistake to put e-mail address of people who don't know each other in the "to:" field
    9·2 answers
  • The interaction between information technology and organizations is influenced___________.A) solely by the decision making of mi
    12·1 answer
  • 1. in terms of technology, we often said to be living in the _____ age.???
    15·2 answers
  • Define additional characteristics such as font weight or style for an html tag
    5·1 answer
  • Describe any five GSM PLMN basic services?
    10·1 answer
  • Explain in your own words how remote-access Trojans (RATs) work. How can these be used by attackers? How would a network adminis
    10·1 answer
  • Code the function definition for aNonclassFunction, picking up co. aNonclassFunction has no return value.
    8·1 answer
  • Shelby wants to move “ExpirationDate” to the top of the datasheet. What should she do?
    13·1 answer
  • A chemical mixture that is burned to produce thrust. (Jet engine homework)
    14·2 answers
  • a printer's accessory list includes a maintenance kit with a variety of replaceable parts you should install after 100,000 pages
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!