Chapter 1 Lab, custom calculator

For this assignment you will create 2 python programs using the variable assignment, print, input, and math operators from the lesson tutorial in Chapter 1.

http://programarcadegames.com/index.php?chapter=python_as_calculator&lang=en#section_1

The first will convert Fahrenheit to Celcius. And the second will calculate the area of a trapezoid.

Program 1: Fahrenheit to Celcius, the following should be the output of your program:

Sample run:

Enter temperature in Fahrenheit: 32
The temperature in Celsius: 0.0

Sample run:

Enter temperature in Fahrenheit: 72
The temperature in Celsius: 22.2222222222

You can take a look at this Snap! program I made to give you an idea (ie. pseudocode) for how your program should work, except you need to code it in python:

http://tinyurl.com/hsumz35

Program 2: Calculate the area of a trapezoid using the following formula:

trapezoid

The output of your program should look like:

Sample run:

Area of a trapezoid
Enter the height of the trapezoid: 5
Enter the length of the bottom base: 10
Enter the length of the top base: 7
The area is: 42.5

You can take a look at this Snap! program I made to give you an idea (ie. pseudocode) for how your program should work, except you need to code it in python:

http://tinyurl.com/h9etxz4

Please hand in the assignment through the dropbox. The assignment is due by end of class Wednesday.

Reminder that on Wednesday, there will be a quiz on Chapter 1 python commands. 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s