Question

I have a coding assignment where I have a set spending budget that needs to ideally...

I have a coding assignment where I have a set spending budget that needs to ideally be brought as close to 0 as possible, that will be solely spent on funding employee wages. The only thing that is changeable is the amount of hours logged per employee; the employee hourly pay must be assigned to each employee prior to calculation. The employee list must be a constant, as well as the budget, but the coding algorithm must be volatile enough to work with different numbers (such as number of employees/work rates/ etc.). Additionally, the hours worked can only be in half-hour increments (0.5, 1, 1.5, etc.).

Preferably, would like to use Matlab, C/C++, or Python, but other HLL languages are fine too.  

0 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE:

spending_budget=1800
emp=['emp1','emp2','emp3']
hourly_wages=[50,60,70]


while (spending_budget>70) :
spending_budget=1800
x=int(input("Enter no of hours worked by employee1 \n"))
y=int(input("Enter no of hours worked by employee2 \n"))
z=int(input("Enter no of hours worked by employee3 \n"))
spending_budget=spending_budget-((50*x)+(60*y)+(70*z))
  
if spending_budget>70:
print("The budget is not yet exhausted. Employees should work more no of hours\n\n")
if spending_budget>0 or spending_budget<70:
print("The budget left is "+ str(spending_budget))
if spending_budget<0:
print("The budget is exhausted. Employees should work less no of hours")
  


CODE PHOTO:

OUTPUT:

Add a comment
Know the answer?
Add Answer to:
I have a coding assignment where I have a set spending budget that needs to ideally...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I have an Assignment of Marketing Research on Climate Change. Where i have to take an...

    I have an Assignment of Marketing Research on Climate Change. Where i have to take an interview of an industry professional, which is done. I have all answer what he said, now i just need to analysis all answer into sub category which are as follow: - 1. Level of Concern of Professionals 2. Impacts on Industry 3. Awareness of Millennials' Knowledge 4. Attitudes Among Millennials If you think any other category could be included please add it. i have...

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT