Lab#3

| September 13, 2020

 

For this lab, you have to solve four required problems. Some problem requires from you to input some data and do some calculation.
There is a bonus problem (the last one). It is optional
Each problem should be solved inside its own main function with comments in between.
Think about the possible data types for each data in every problem.
Choose names for your variables that make sense, don’t use any  variable name that is one character only. Use good, multi-character,  meaningful identifiers (variables) names. There is a 5% penalty for not  doing that.
Document your work by putting comments at the top of your program.  The possible comments that you need for this program are the program  prolog (name of the programmer, your class and section, the date when  you finished working on the program and the purpose of the program).   There is a 5% penalty for not doing that.
In addition to that, you have to write some comments between the  lines of the code to show why you write your code this way. Remember  that comments in Python are either:

Starts with // in case the comment is one line only.
Or it is between /*  */ if the comment is taking more than one line.

Problem 1: Lake Length

To approximate the length  of a lake, a surveyor starts at one end of the lake and walks 245  yards. He then turns 110º and walks 270 yards until he arrives at the  other end of the lake. Approximately how long is the lake?

———————————–
Problem 2: President Age

Ask  the user to input his/her age. The check if the user’s age makes  him/her eligible to be a president of the United State of America. As  specified in the U.S. Constitution, a person must be aged 35 or over to  be a president

————————————
Problem 3: Profit vs. Lost

Write a program that asks the user to input a product cost price and its selling price (two inputs).  Then check if the seller makes a profit or loss from that product, in  addition, to calculate the total profit or total loss rounded to 2  decimals digits.

———————————————————-
Problem 4: Circles Overlap

Write  a program to determine whether or not two circles touch each other,  overlap with each other, or not overlap with each other. your program  should work like the following

Ask the user to input the X-coordinate of the center of the first circle.
Ask the user to input the Y-coordinate of the center of the first circle.
Ask the user to input the radius of the first circle.
Ask the user to input the X-coordinate of the center of the second circle.
Ask the user to input the Y-coordinate of the center of the second circle.
Ask the user to input the radius of the second circle

Based on these inputs, can you determine if the two circles are :

Touch each other,
Overlap with each other 
Not overlap with each other

Show a proper message for each case.
Test Your program using these 3 cases:
Case #1 :
Input:
3
4
5
14
18
8
Output : Circles do not touch each other.

Case #2 :
Input:
2
3
12
15
28
20
Output : Circles intersect with each other.

Case #3 :
Input:
-10
8
30
14
-24
10
Output : Circle touch each other.

————————————–
Problem 5:  Basketball Players

Two players stand on a basketball court. The angles of elevation from the foot of each player to the basket (which is 10′ high) are 40 and 50 degrees. How far apart are the players from each other? Check the following diagram.

Order your essay today and save 20% with the discount code: ESSAYHELP
Order your essay today and save 20% with the discount code: ESSAYHELPOrder Now