Question

Write a program that displays the total income for 3 weeks of pay. Have the user...

Write a program that displays the total income for 3 weeks of pay. Have the user input each week’s salary. Display the total income. IN PYTHON please explain each step with comments

Algorithm

PseudoCode

Sourcecode

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

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Here a new python program with name "Main.py" is created, which contains following code.

Main.py :

#Python program to display the total income for 3 weeks of pay
#declaring variable to store week number
weekno=1
#declaring variable to store total pay
totalPay=0
for i in range(3):
#asking user to enter pay
pay=int(input("Enter "+str(weekno)+" week’s salary : "))
#adding salary in totalPay
totalPay=totalPay+pay
#increment weekno
weekno=weekno+1
  
#display total income for 3 weeks
print("Total Income for 3 weeks : ",totalPay)

Screen for Indentation :

======================================================

Output : Compile and Run above program to get the screen as shown below

Screen 1 :Screen asking each weeks salary

Screen 2 :Screen showing total pay for three weeks

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
Write a program that displays the total income for 3 weeks of pay. Have the user...
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
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