Results 1 to 3 of 3
  1. #1
    DSutta22 is offline Member
    Join Date
    Sep 2008
    Posts
    3
    Rep Power
    0

    Default 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.
    Your program should read the radius using the following format
    Circle’s radius: 5
    …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. #2
    racerxadam is offline Member
    Join Date
    Jul 2008
    Posts
    68
    Rep Power
    0

    Default

    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. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

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

Similar Threads

  1. programming
    By abcdefg in forum New To Java
    Replies: 9
    Last Post: 03-10-2008, 11:34 AM
  2. Applet Programming
    By Java Tutorial in forum Java Tutorial
    Replies: 0
    Last Post: 02-11-2008, 05:04 PM
  3. Programming buddy
    By gibsonrocker800 in forum Forum Lobby
    Replies: 12
    Last Post: 01-17-2008, 11:58 PM
  4. Programming a Game?
    By gt123 in forum New To Java
    Replies: 4
    Last Post: 01-01-2008, 01:41 PM
  5. Programming block
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-25-2007, 12:20 PM

Posting Permissions

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