Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please please slove this python question in less time (1) Dog Treats: Barley the dog loves treats. At the end of the day, he is

image text in transcribed

please please slove this python question in less time

(1) Dog Treats: Barley the dog loves treats. At the end of the day, he is either happy or sad depending on the number and size of treats he receives throughout the day. The treats come in three sizes: small, medium, and large. His happiness score can be measured using the following formula: 1xS+2xM+3XL where S is the number of small treats, M is the number of medium treats and L is the number of large treats. If Barley's happiness score is 10 or greater then he is happy. Otherwise, he is sad. Determine whether Barley is happy or sad at the end of the day. Input Specification There are three lines of input. Each line contains a non-negative integer less than 10. The first line contains the number of small treats, S, the second line contains the number of medium treats, M. and the third line contains the number of large treats, L, that Barley receives in a day. Output Specification If Barley's happiness score is 10 or greater output happy. Otherwise, output sad. Sample Input 1 3 1 0 Output for Sample Input 1 sad Explanation of Output for Sample Input 1 Barley's happiness score is 1x3+2x1+3x0=5, so he will be sad. Sample Input 2 3 2 1 Output for Sample Input 2 happy Explanation of Output for Sample Input 2 Barley's happiness score is 1x3+2x2+3x1=10, so he will be happy

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

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions