Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-10-2008, 06:21 AM
Member
 
Join Date: Sep 2008
Posts: 3
DSutta22 is on a distinguished road
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:

Quote:
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:

Quote:
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:

Quote:
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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-10-2008, 07:02 AM
Member
 
Join Date: Jul 2008
Posts: 58
racerxadam is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 09-10-2008, 07:19 AM
Fubarable's Avatar
Senior Member
 
Join Date: Jun 2008
Posts: 883
Fubarable is on a distinguished road
as said politely above, please do you're own farking work.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
programming abcdefg New To Java 9 03-10-2008 12:34 PM
Applet Programming Java Tutorial Java Tutorials 0 02-11-2008 06:04 PM
Programming buddy gibsonrocker800 Forum Lobby 12 01-18-2008 12:58 AM
Programming a Game? gt123 New To Java 4 01-01-2008 02:41 PM
Programming block Java Tip Java Tips 0 12-25-2007 01:20 PM


All times are GMT +3. The time now is 10:41 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org