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
ElenaW [278]
3 years ago
9

Assume the input data is structured as follows: first there is a non-negative integer specifying the number of employee timeshee

ts to be read in. This is followed by data for each of the employees. The first number for each employee is an integer that specifies their pay per hour in cents. Following this are 5 integers, the number of hours they worked on each of the days of the workweek. Given this data, and given that an int variable total has been declared, write a loop and any necessary code that reads the data and stores the total payroll of all employees in total. Note that you will have to add up the numbers worked by each employee and multiply that by that particular employee's pay rate to get the employee's pay for the week-- and sum those values into total.
Computers and Technology
1 answer:
Vesna [10]3 years ago
7 0

Answer:

int employees;   //set integer type variable

int a,b;     //set two integer type variable

int wage=0;   //initialize integer type variable

int hours=0;   //initialize integer type vcariable

total=0;    

cin >> employees;    //get input from the user

for (a=1; a<=employees; a++){     //set for loop

cin >> wage;     //get input from the user

for (b=1; b<=5; b++){    //set for loop

cin >> hours;    //get input from the user

total += hours * wage;    //perform multiplication

}

}

Explanation:

Here, we define four integer type variable "a", "b", "wage" "hour" and assign value in "wage" to 0 and "hours" to 0.

Then, we get input from the user in the variable "employees".

Then, we set the for loop and pass the condition inside it we get input from the user in the variable "wage".

Then, again we set the for loop and pass the condition inside it we get input from the user in the variable "hours".

Then, we perform addition and the multiplication.

You might be interested in
The document asks about dependents because the number can
BARSIC [14]
The answer is: Lower overall taxes
8 0
3 years ago
Read 2 more answers
Viết chương trình hoàn chỉnh các yêu cầu sau:
Blababa [14]

Explanation:

the perimeter of an aluminium sheet is 120 CM if its length is reduced by 10% and its breadth is increased by 20% the perimeter does not change find the measure of the length and the breadth of the sheet

4 0
3 years ago
You would like the user of a program to enter a customer’s last name. Write a statement thaUse the variables k, d, and s so that
mojhsa [17]

Answer:

1st question:

Use the variables k, d, and s so that they can read three different values from standard input an integer, a float, and a string respectively. On one line, print these variables in reverse order with exactly one space in between each. On a second line, print them in the original order with one space in between them.

Solution:

In Python:

k = input()  #prompts user to input value of k i.e. integer value

d = input()  #prompts user to input value of d i.e. float value

s = input()  #prompts user to input value of s i.e. a string

print (s, d, k)  #displays these variable values in reverse order

print (k, d, s)#displays these variable values in original order

In C++:

#include <iostream>    // to use input output functions

using namespace std;   //to identify objects like cin cout

int main() {    //start of main function

  int k;   //declare int type variable to store an integer value

  float d; //  declare float type variable to store a float value

  string s;   //  declare string type variable to store an integer value

  cin >> k >> d >> s;    //reads the value of k, d and s

  cout << s << " " << d << " " << k << endl;     //displays these variables values in reverse order

  cout << k << " " << d << " " << s << endl;   } // displays these variable values in original order

Explanation:

2nd question:

You would like the user of a program to enter a customer’s last name. Write a statement that asks user "Last Name:" and assigns input to a string variable called last_name.

Solution:

In Python:

last_name = input("Last Name:")

# input function is used to accept input from user and assign the input value to last_name variable

In C++:

string last_name;  //declares a string type variable named last_name

cout<<"Last Name: ";  // prompts user to enter last name by displaying this message Last Name:

cin>>last_name; // reads and assigns the input value to string variable last_name

The programs alongwith their outputs are attached.

6 0
4 years ago
How do u friend people
Verdich [7]
You click on the three dots and click the person silhouette with the plus sign on it.
4 0
4 years ago
Read 2 more answers
A call to a value-returning function with an empty formal parameter list has the form ________ .
gizmo_the_mogwai [7]
The correct answer is D
4 0
4 years ago
Other questions:
  • Kurt is editing a table in his powerpoint that displays accounting formulas and when to use them. he wants to remove the table s
    15·1 answer
  • Did you see the fire, uh, fireworks last night? Which of the following sentences is the most correct way to format this accordin
    15·2 answers
  • Ushahidi is a crisis-mapping tool that makes information instantly available to anyone in the world. T/F
    10·1 answer
  • Given four values representing counts of quarters, dimes, nickels and pennies, output the total amount as dollars and cents. Out
    10·1 answer
  • What is the automotive name for the large wires that allow more electrical current to flow ?
    12·1 answer
  • Consider the following program where the zu format specifier is used to display as an integer the result of sizeof. #include #in
    11·1 answer
  • You are hired by a game design company and one of their most popular games is The Journey. The game has a ton of quests, and for
    12·2 answers
  • Which file format would be appropriate for web graphics​
    6·1 answer
  • Denise found a volume of documents in the trash bin that contained individuals, names, social security numbers and years of birt
    14·1 answer
  • Please NEED HELP ASAP WILL MARK BRAINLIEST ONLY #8
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!