Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help with my computer homework Learning objectives: 1. Develop a simple Python program that does arithmetic 2. Develop a Python program with a loop,

need help with my computer homework image text in transcribed
image text in transcribed
Learning objectives: 1. Develop a simple Python program that does arithmetic 2. Develop a Python program with a loop, practice accumulating result 3. Develop a Python program with a nested loop Applying the software development process will make implementing your solution easier. Ask yourself, and write the answers to, questions 1-3 BEFORE implementing a solution in Python. Your answers should be part of the comments at the top of your program or embedded through your code. 1. What will the program do? 2. What will be the inputs and outputs? 3. What is a step-by-step list of what the program must do, aka an algorithm? (Remember this is in English!) 4. Implement your code. 5. Test your program 6. Maintain Programming problem: Part 1 A company needs calculating the total working time of employees in a team. You are going to help to write a program that totals the working time in hours and minutes. You should name your program as working_time.py. Your program should first ask the user how many employees there are on the team. You may assume the value entered will not be negative, but it could be zero. Your program will now be controlled by a loop that asks for, and adds, the hours and minutes for each employee. Of course, the minutes will frequently add up to more than an hour, but you should not report a total time such as 24 hours 77 minutes for example (or worse, 18 hours 377 minutes). Instead you should report the total time as 25 hours 17 minutes. On the other hand, if the total number of hours is 24 or greater you should not report the time in days, hours and minutes. Hours and minutes are all that are to be reported. While you may assume that all of the hours and minutes entered by the user will be non- negative, a time may be entered with minutes that exceed 60. Your program should be able to handle this and still report the total correctly. For example, 5 hours, 65 minutes and 3 hours, 88 minutes should add up to 10 hours, 33 minutes. Consequently, for a given team we should see output such as: Total time: 29 hours 18 minutes Note: If you already know about conditionals or while loop, you may not use them in this program Part II Do not try to do Parts I and II all together. Get Part I working completely correctly, and then go on to Part II In part II, the company needs to calculate the total working time for employees from all teams in days, hours, and minutes. Users of the program report that they do not like having to start the program over and over to process multiple teams, so we are going to fix that complaint Add code to first ask how many teams are to be processed (you may assume the value entered is non-negative). Use this number to determine how many times the program will go through one loop (known as an outer loop) Nhat contains within it the code from part I. Since the loop from the code of part I will now be within the loop you are developing for this part of the assignment, it is known as the inner loop. At the end of each pass of the outer loop your program should identify the team being processed as Teaml, Team2, etc. and then report the total time of that Team. Thus, we may see output such as: Teaml Total time: 29 hours 18 minutes Team2 Total time: 27 hours 49 minutes Team3 Total time: 15 hours 1 minutes (It's OK to use the plural form "minutes" in this case.) Note that the first team is identificd as Teaml, not Team. Finally, add code to output the total time of all of the teams entered. Thus, the last line of output may be: Total time of all teams: 3 days 0 hours 8 minutes Note that the total time for all teams should display the number of days, hours, and minutes Documentation and Style: Follow the instructions posted in homework policy. Submission: Submit working_time.py to your class OAKS

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

Describe the alternative methods of allocating scarce resources.

Answered: 1 week ago