2 Replies - 675 Views - Last Post: 27 March 2013 - 12:15 AM Rate Topic: -----

#1 durianruntuh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 26-March 13

java assignment trying to find the surface area of the exterior

Posted 26 March 2013 - 11:31 PM

I need to write a java program that to estimate the cost of painting a house, a painter needs to know the surface area of the exterior (assume the doors or windows have uniform size). I am a beginner at programming in java and have run into a lot of trouble trying to write the program).The input are the width,length, and height of the house, the number of windows and doors and their dimensions.
Is This A Good Question/Topic? 0
  • +

Replies To: java assignment trying to find the surface area of the exterior

#2 floppyspace  Icon User is offline

  • D.I.C Regular

Reputation: 48
  • View blog
  • Posts: 254
  • Joined: 04-February 10

Re: java assignment trying to find the surface area of the exterior

Posted 26 March 2013 - 11:40 PM

View Postdurianruntuh, on 27 March 2013 - 02:31 PM, said:

I am a beginner at programming in java and have run into a lot of trouble trying to write the program).


post what you have done, effort gets rewarded with answers.
Was This Post Helpful? 0
  • +
  • -

#3 Gungnir  Icon User is offline

  • Your Imaginary Friend

Reputation: 152
  • View blog
  • Posts: 527
  • Joined: 21-May 11

Re: java assignment trying to find the surface area of the exterior

Posted 27 March 2013 - 12:15 AM

Now, I'm no artist. But this is how you should be doing it.
Sorry, this is in 2D, but it's already drawn so I'm not turning back now:

Posted Image

//GET HOUSE SIZE
//GET # OF WINDOWS AND DOORS
//SUBSTITUTE INTO EQUATION
    surfaceArea = (houseWidth * houseHeight * 4);
    surfaceArea -= (numberOfDoors * (doorWidth * doorHeight));
    surfaceArea -= (numberOfWindows * (windowWidth * windowHeight));



For a cube house with 4 walls.

This post has been edited by Gungnir: 27 March 2013 - 12:23 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1