CS211 Lab 2
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 Linux:
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.