Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can someone help for two questions. the chapter is on conditions. have to use input, float, int, def, if ,else,elif. please dont use sys.elif. thanks.

image text in transcribed

image text in transcribed

can someone help for two questions. the chapter is on conditions. have to use input, float, int, def, if ,else,elif. please dont use sys.elif. thanks. also please seperate in comments.

1. Filename: assign3-1.py Write a program that takes three inputs that correspond to a patien's systolic blood presure (firt number) and total cholesterol. Determine if the blood pressure if normal, prehypertension, stage 1 hypertension or stage 2 hypertension according to the Mayo Clinic (see: 20050982). Also, determine if the total cholesterol is desirable, borderline high or high according to the Mayo Clinic (see: htts:/www.mavoclinis.orgdisases-conditions/high-blood-cholesteroldiagnosis treatment dre-20350806). The output should change according to the blood pressure and cholesterol entered Input: a. ipython assign3-1.py 130 206 b. ipython assign3-1.py 140 190 Output: a. Systolic blood pressure 130, stage 1 hypertension Total cholesterol: 206, borderline high b. Systolic blood pressure: 140, stage 2 hypertension Total cholesterol: 190, desirable 3. Filename: assign3-3.py Write a program that takes quarterly sales for an organization (in thousands of dollars) over a year and calculates the total sales. The output should change according to the sales entered. Add try except block from as well as an indication of whether total sales are low (under $50,000), medium (S50K or higher and under $150K) or high ($150K or higher). Also, issue a warning in the event that sales are under $20K. If the sales entered are nonnumeric, use a tryexcept/else block to indicate that the application only takes numeric data as input. Input: a)python assign3-3.py 1000 2500 1750 10250 b)ipython assign3-3.py cat 2500 1750 10250 c)python assign3-3.py 10000 17500 14750 10250 Out a) Quarterly Sales: $1000, $2500, $1750, $10250 OyQuar terly Sales: $1000, $2500, $1750, $10250 Total Sales: $15500 Sales: low Warning: Need to improve sales b)All sales should be numeric c) Quarterly Sales: $10000, $17500, $14750, $10250 Total Sales: $52500 Sales: med Submission Instructions: .Your code should contain meaningful comments. Place your name, due date and assignment and problem number in comments at the top of the file. Cite all sources in comments. .Your output should match mine exactly (in spacing, capitalization, etc.)

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

Database Programming Languages 12th International Symposium Dbpl 2009 Lyon France August 2009 Proceedings Lncs 5708

Authors: Philippa Gardner ,Floris Geerts

2009th Edition

3642037925, 978-3642037924

Students also viewed these Databases questions