Starting from:
$30

$24

HOMEWORK #01 Solution

Write a complete program that calculates

 the area of the largest circle that fits inside a rectangle,

 the area of the largest square that fits inside the rectangle,

 the area of the smallest circle that surrounds the same rectangle,

 the area of the smallest square that surrounds the same

rectangle.



The program gets edges of the rectangle and print outs the area of each circle and square.




The program must use all these functions listed below. double circle_area(double radius);

double calc_hypotenuse(int side1, int side2);

double calc_radius_of_smallest_circle(int side1, int side2); double calc_radius_of_largest_circle(int side1, int side2); double calc_area_of_smallest_circle(int side1, int side2); double calc_area_of_largest_circle(int side1, int side2); double calc_area_of_smallest_square(int side1, int side2); double calc_area_of_largest_square(int side1, int side2); double calc_area_of_square (int side);

void display_results(void);




The program must use sqrt() and pow() functions whenever necessary. PI = 3.14




Submission Rule: student_no.zip




Grading Policy:

 If you do not apply submission rule, you will get –20 points.

 In case of cheating, each participant gets –100.

 A code which does not compile will be graded up to 30 points.




Asking Rules:

 You can ask when you need help. (Turkish or English)

 Describe your problem explicitly.

 And write your solution (even half) or describe your idea. If you have no idea or even half solution don’t ask, make research in the internet or in the books.

 Please be polite, constructive.

 If you don’t get an answer in 48 hour check the rules.




Contact: asbayraktar@gtu.edu.tr

More products