Question

PLEASE DO THIS IN PYTHON!!! 1.) Exercise #1: Design and implement a program (name it Youth)...

PLEASE DO THIS IN PYTHON!!!

1.) Exercise #1: Design and implement a program (name it Youth) that reads from the user an integer values repressing age (say, age). The program prints out the entered values followed by a message as follows: If age is less or equal to 21, the message is “Youth is a wonderful thing. Enjoy.”. Finally, the program always prints out the message “Age is a state of mind.” Format the outputs following the sample runs below.

Sample run 1:

You entered: 20
Youth is a wonderful thing. Enjoy.
Age is a state of mind.

Sample run 2:

You entered: 25
Age is a state of mind.

Sample run 3:

You entered: 21
Youth is a wonderful thing. Enjoy.

Age is a state of mind.

2.) Exercise #2: The weekly pay for an employee is determined based on the following parameters:

Standard work hours by week is 40 hours.

Hourly pay rate is $10.00 per hour

Overtime hours are paid at time and a half the rate (that is $15.00 per hour).

Design and implement a program (name it WeeklyPay) that read number of hours worked per week (as integer value), prints out the entered hours, and then prints out the gross earning. Organized your output following these sample runs.

Sample run 1:

You entered 20 hours.
Gross earning is $200

Sample run 2:

You entered 40 hours.
Gross earning is $400

Sample run 3:

You entered 50 hours.
Gross earning is $550

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

The codes are commented. See code screenshot for indentation. Its important in python.

1)

Code:

age=int(input("Enter your age: "))
print("You entered: "+str(age))
if(age<=21):

print("Youth is a wonderful thing. Enjoy.")

print("Age is a state of mind.")

Code screenshot:

Output:

2)

Code:

#input from user
hrs=int(input("Enter number of working hours per week: "))
# printing entered hours
print("You entered: "+str(hrs)+ " hours.")
#calculating earnings
earnings= hrs*10
# adding earnings for overtime hours
if(hrs>40):

earnings+=((hrs-40)*5)

print("Gross earning is $"+str(earnings))

Code screenshot:

Output:

Add a comment
Answer #1

The codes are commented. See code screenshot for indentation. Its important in python.

1)

Code:

age=int(input("Enter your age: "))
print("You entered: "+str(age))
if(age<=21):

print("Youth is a wonderful thing. Enjoy.")

print("Age is a state of mind.")

Code screenshot:

Output:

2)

Code:

#input from user
hrs=int(input("Enter number of working hours per week: "))
# printing entered hours
print("You entered: "+str(hrs)+ " hours.")
#calculating earnings
earnings= hrs*10
# adding earnings for overtime hours
if(hrs>40):

earnings+=((hrs-40)*5)

print("Gross earning is $"+str(earnings))

Code screenshot:

Output:

Add a comment
Know the answer?
Add Answer to:
PLEASE DO THIS IN PYTHON!!! 1.) Exercise #1: Design and implement a program (name it Youth)...
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
  • PLEASE DO THIS IN C#.Design and implement a program (name it ProcessGrades) that reads from the...

    PLEASE DO THIS IN C#.Design and implement a program (name it ProcessGrades) that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below. Sample run 1: You entered: 95, 80, 100, 70 Highest grade: 100 Lowest grade: 70 Average grade: 86.25

  • PLEASE DO IN PSEUDOCODE; Design and implement a program (name it CheckPoint) that prompts the user...

    PLEASE DO IN PSEUDOCODE; Design and implement a program (name it CheckPoint) that prompts the user to enter the x-coordinate then y-coordinate of a point (in a Cartesian plane) as integer values. The program prints out the entered values followed by the location of the point on the plane. The possibilities for a point are: the origin point, on the x-axis, on the y-axis, in the first quadrant, in the second quadrant, in the third quadrant, or in the fourth...

  • Using C# Exercise #3: Design and implement a program (name it CheckPoint) that prompts the user...

    Using C# Exercise #3: Design and implement a program (name it CheckPoint) that prompts the user to enter the x-coordinate then y-coordinate of a point (in a Cartesian plane) as integer values. The program prints out the entered values followed by the location of the point on the plane. The possibilities for a point are: the origin point, on the x-axis, on the y-axis, in the first quadrant, in the second quadrant, in the third quadrant, or in the fourth...

  • Design in Python (pseudocode) and implement (source code) a program (name it MyRectangle) that defines the...

    Design in Python (pseudocode) and implement (source code) a program (name it MyRectangle) that defines the following 3 methods: Method isValid() returns true if the sum of the width and height is greater than 30 Method Area() returns the area of the rectangle if it is a valid rectangle Method Perimeter() returns the perimeter of the rectangle if it is a valid rectangle The main method of MyRectangle prompts the user to enter the width and height of a rectangle...

  • PLEASE DO IN PSEUDOCODE ; Design and implement a programming (name it NextMeeting) to determine the...

    PLEASE DO IN PSEUDOCODE ; Design and implement a programming (name it NextMeeting) to determine the day of your next meeting from today. The program reads from the user an integer value representing today’s day (assume 0 for Sunday, 1 for Monday, 2 for Tuesday, 3 for Wednesday, etc…) and another integer value representing the number of days to the meeting day. The program determines and prints out the meeting day. Format the outputs following the sample runs below. Sample...

  • SOLVE IN PYTHON: Exercise #2: Design and implement a program (name it CompareArrays) that compares the...

    SOLVE IN PYTHON: Exercise #2: Design and implement a program (name it CompareArrays) that compares the content of 2 single-dimensional arrays of the same size. The program prompts the users to enter the array size. Then prompts the user to initialize each array with integer values. The program defines method Compare() that takes two signal-dimensional arrays of type integer. The method compares the content of the arrays and returns true (Boolean type) if the arrays store same values in the...

  • In Java code Exercise #1: (Java) Design and implement a program (name it MinMaxAvg) that defines...

    In Java code Exercise #1: (Java) Design and implement a program (name it MinMaxAvg) that defines three methods as follows: Method max (int x, int y, int z) returns the maximum value of three integer values. Method min (int X, int y, int z) returns the minimum value of three integer values. Method average (int x, int y, int z) returns the average of three integer values. In the main method, test all three methods with different input value read...

  • IN PYTHON the original problem was Design (pseudocode) and implement (source code) a program (name it...

    IN PYTHON the original problem was Design (pseudocode) and implement (source code) a program (name it WeeklyHours) to compute the total weekly hours for 3 employees. The program main method defines a two-dimensional array of size 3x7 to store employers’ daily hours for the week. Each row represents one employee and each column represent one day of the week such that column 0 designates Monday, column 1 designates Tuesday, etc. The program main method populates the array with random numbers...

  • IN PYTHON ONLY!!! Program 2: Design (Pseudocode) and implement (Source Code) a program that asks the...

    IN PYTHON ONLY!!! Program 2: Design (Pseudocode) and implement (Source Code) a program that asks the user for their height (in inches), weight (in pounds), age and gender. Use loops to validate user input and to continue running for a new user until a sentinel value is entered. Ask them to select their approximate level of exercise each week from the options below, then determine and print their allowed daily caloric intake using their BMR: Female BMR = 655+(4.35 *...

  • I need this in JAVA please: Design and implement a program (name it MinMaxAvg) that defines...

    I need this in JAVA please: Design and implement a program (name it MinMaxAvg) that defines three methods as follows: Method max (int x, int y, int z) returns the maximum value of three integer values. Method min (int X, int y, int z) returns the minimum value of three integer values. Method average (int x, int y, int z) returns the average of three integer values. In the main method, test all three methods with different input value read...

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