# Thread: New to Programming . . .Need Help

1. Member
Join Date
Sep 2008
Posts
3
Rep Power
0

## New to Programming . . .Need Help

For one of my classes I have to write basic Java code that will compute the area of a rectangle, triangle and circle. Here are the directions for the first:

The area of a rectangle is found by multiplying its ase and height. As such, define 3 integer variables in "main" : two for the base and height, and one for the area. Your program should read the base and height using the following format: Rectangle's base: 7 , Rectangle's height: 6 . . . and it should wrrite to the screen in the following format "the area of a rectangle of base 7 and height 6 is 42.
The next shape is a Triangle:

Continue extending your program by adding operations to calculate the area of a triangle.
The area of a triangle is found by multiplying its base and height and dividing this result by 2.
As such, define 3 additional variables in “main”: two integers for the base and height, and one double for the resulting area.
Your program should read the base and height using the following format
Triangle’s base: 21
Triangle’s height: 3
…and should write to the screen in the following format
The area of a triangle of base 21 and height 3 is 31.5
The next shape is a Circle:

The area of a circle is found by multiplying the square of its radius by π. For simplicity, assume that the value of π is 3.14159. The square of the radius is calculated by multiplying it by itself.
As such, define 2 additional double variables in “main”: one for the radius, and one for the area.
…and write to the screen in the following format
The area of a circle of radius 5.0 is 78.53975
Thanks, if you only have time to help with one that would still be greatly appreciated.

Dan

2. Member
Join Date
Jul 2008
Posts
68
Rep Power
0
You aren't going to get anyone here to do your homework. If you make an attempt and can't figure something out post a more specific question and someone will be glad to help you with your problem.

3. as said politely above, please do you're own farking work.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•