Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that prompts the user for the number of tellers at Nations Bank in Hyatesville that worked each of the last three years.

Write a program that prompts the user for the number of tellers at Nation’s Bank in Hyatesville that worked each of the last three years. For each worker the program should ask for the number of days out sick for each of the last three years. The output should provide the number of tellers and the total number of days missed by all the tellers over the last three years.
See the sample output below.
Sample Run:
How many tellers worked at Nation’s Bank during each of the last three years ?
2
How many days was teller 1 out sick during year 1?
5
How many days was teller 1 out sick during year 2?
8
How many days was teller 1 out sick during year 3?
2
How many days was teller 2 out sick during year 1?
1
How many days was teller 2 out sick during year 2?
0
How many days was teller 2 out sick during year 3?
3
The 2 tellers were out sick for a total of 19 days during the last three years

He also wants us to calculate running total for each inner for loop, using this as a reference:
for i=1 to teller
for j=1 to num_year
cin>> sick_days
tottalsick_days+=sick_days
endinnerfor
endouterfor

Step by Step Solution

3.27 Rating (150 Votes )

There are 3 Steps involved in it

Step: 1

include using namespace std int main int teller 0 sickDays 0 temp 0 cout ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Java Programming, Comprehensive Version

Authors: Y. Daniel Liang

10th Edition

133761312, 978-0133761313

More Books

Students also viewed these Programming questions