CS211 Lab 2

Due Tuesday, September 5

Download the program mon-size.py from the class examples area. It's a Python 2 program, not Python 3. You can run it like this on isoptera:
seth@isoptera:~/public_html/cs211/examples $ python mon-size.py
Enter Diagonal:   43
Enter Width (can be part of a ratio.  For 16:9 for example, enter 16):  16
Enter Height (similar to above): 9
side a = 37.477748
side b = 21.081233
Visible area = 790.077151
It'll also run on other python interpreters, but the print statement is incompatible with Python 3. In Python 3, print is a function, not a statement, and requires parenthesis.

For this lab, translate this Python program into C++. The C++ program may be a little longer than the Python version. You can use cin for input. Make sure to use a data type that supports decimal numbers, like float or double.

Turn in the lab in the same manner as lab 1. For your convenience, there is a command called "turnin" on isoptera which can be used to turn in labs directly from isoptera, avoiding the need to download and upload the lab. If you used online GDB or an interpreter on your own computer, I suspect the website option is more convenient.