I can't figure out how to start this.

Hi I have a problem I was assigned and I can't, for the life of me, figure out how to even start this.

The problem is :

The screen size of a TV is given by the length of the rectangular diagonal. Traditional TVs come in 4:3 ratio, that is, the ratio of length to width is 4 to 3. This means, if the length is x inches, then the width is (3/4)x. LCD TVs come in 16:9 ratio. Write a program that prompts the user to input the length of the diagonal (in inches) of the screen and allows the user to select which type of TV's screen length, screen width, and screen area the user would like to calculate. Have the program display the desired results.
Pythagoras:
diagonal squared = length squared + width squared

#include <cmath> gives square root function sqrt( a number)

If you know the diagonal and one side (width or length)
then,
the other side = sqrt(diagonal squared - known side squared)

Also area = length X width
ratio length:width= 4:3, so area = 3/4 multiplied by x squared,
so, if you know the area, x = sqrt(4/3 times area), and so it goes on.

That's for 4:3, similar for 16:9, just plug in different numbers.
There you go. That's a start.
Topic archived. No new replies allowed.