Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

VIRGIN 11:23 AM itoba.desire2learn.com Lab 2 Lab 2 January 15th to 18th Material covered: . Getting input from a user . Doing calculations with Python

image text in transcribed
VIRGIN 11:23 AM itoba.desire2learn.com Lab 2 Lab 2 January 15th to 18th Material covered: . Getting input from a user . Doing calculations with Python Formatting output Question 1: BMI Calculation Prompt the user for a their weight in kilograms, and their height in centimetres. Then, calculate and report their body-mass index The BMI formula is BMI /A Where w is weight in kg, and h is height in metres. Convert the height you read in Report the BMI to two decimal places Your program should look something like: What is your weight in kgs? >90 What is your height in cm?180 Your BMI is 27.78 Question 2: Finding x and y intercepts of a line Write a program finds the x and y intercepts of a straight line. Reminder that the x-intercept is the value of y when the line crosses the x axis, when y-0. The y-intercept is the value of y when the line crosses the y axis, when x=0. See httpswen.wikipedia orgwiuy-intercept if you need more detail on x and y intercepts. Prompt the user to values m and b for a line formula: -m+ Solve for where the x and y intercepts are. Print out the linear question and report the results back to the user. Your output should look something like: Fill the question y-mx + b: What is m? 15 What is b?> 10 Here are the intercepts for y-15x+10 The y intercept is 10.0 The x intercept is -0.6666666666666666 Question 3: Find x and y intercepts of a parabola Write a program that finds the x and y intercepts of a parabola. The concept of intercepts are the same as question 2, with the addition that parabolas cross the x axis in two different spots. Prompt the user to values a, b and c filling the equation, -a++ Only test with parabolas that have x intercepts, such as y-r.-4. Calculate the single y intercept, and use Quadratic equation formula to find both x intercepts

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

Students also viewed these Databases questions