Question: 3.1. Write a program that generates a random double base (b) and height (h) for a triangle in the range 5 to 10 , inclusive,
3.1. Write a program that generates a random double base (b) and height (h) for a triangle in the range 5 to 10 , inclusive, and then computes the area of the iriangle and shows it with three decimal points. (15 marks) 3.2. Ask the user to input a base and height for a second triangle in range of 10 to 20 and then print the ratio of the area of the first triangle to this new triangle in percentage with currect formatting. ( 5 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
