Python Programming: An Introduction to Computer Science
Python Programming: An Introduction to Computer Science
3rd Edition
ISBN: 9781590282779
Author: John Zelle
Publisher: Franklin Beedle & Associates
bartleby

Concept explainers

bartleby

Videos

Question
Book Icon
Chapter 3, Problem 6PE
Program Plan Intro

Slope of a line

Program Plan:

  • Define the main function.
    • Get the values of “x1”, “x2”, “y1”, and “y2” from the user.
    • Calculate slope of the line and store it in a variable “slope”.
    • Print the value of “slope”.

Blurred answer
Students have asked these similar questions
Write a Phyton program that computes the duration of a projectile’s flight and its   height above the ground when it reaches the target. As part of your solution, you should display instructions to the program user.  Relevant formula:   time = distancevelocity xcos (θ)   height = velocity xsin x time- g x time22   use the following variables:           g = gravitational constant = 32.17           = angle of elevation in radian               v = velocity or the projectile velocity (ft/sec)           d= distance to target           t = time of flight in seconds.           h = height at impact Try your program on these data sets.
Two points in a plane are specified using the coordinates (x1,y1) and(x2,y2). Write a program that calculates the slope of a line through two(non-vertical) points entered by the user.y2 - y1 slope=x 2 1
Body Mass Index (BMI) is a measure of health on weight. It can be calculated by taking your weight in kilograms and dividing by the square of your height in meters. Write a program which prompts the user to enter the weight in kgs (integer value) and height in feet and inches (both integers) and then calculates the BMI of the person. Your program first need to convert inches to meters (i.e. inches * 0.0254) and then use the following formula to calculate BMI: weight kilogram / (height_meter)^2 Your program displays the BMI value in two decimal places and the corresponding status as shown in the examples below. Note that one inch is 0.0254 meters and 1 foot is 12 inches. For example: Input Result 62 5 10 89 6 0 45 BMI BMI < 18.5 18.5 s BMI < 25.0 25.0 ≤ BMI < 30.0 30.0 ≤ BMI 7 82 5 Interpretation Underweight Normal Overweight Obese 2 Enter weight (kg): Enter height (feet): Enter height (inches): BMI is 19.61, Normal Enter weight (kg): Enter height (feet): Enter height (inches): BMI is…
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Constants, Variables, Data types, Keywords in C Programming Language Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=d7tdL-ZEWdE;License: Standard YouTube License, CC-BY