Does anyone know Java?

Collapse

Recommended Videos

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SuperBowlNachos
    All Star
    • Jul 2004
    • 10218

    #1

    Does anyone know Java?

    This is what I have to do
    Your neighbor’s teenage son currently cuts your yard every ten days. Your beautiful front yard is a perfect rectangle, with the street measurement being 48 feet and the driveway side being 32 feet. Your current cost to have it fully cut and manicured is $50.50 every ten days. A new lawn service will do the same job for $0.30 per square yard, with an 8% discount, if you agree to allow them to do your yard for 9 consecutive times. You are to write a Java program to determine which one is the best deal. Now adapt your program to allow you to input values at runtime for any yard in your property portfolio. See additional notes below:

    • Total feet (area) of the yard must be converted to square yards for calculation purposes. A Google search for "calculate area of rectangle" and "feet to square yards conversion" will provide the necessary information. There a several ways you might setup your calculations.

    • The data types chosen will potentially have a slight affect on the results. The sample output assumes that the street measurement (width), driveway measurement (length), area of the yard, and square yardage are whole numbers; while the lawn service price, lawn service discount, and discounted lawn service price are floating-point values

    • Give careful consideration on how named constants can be incorporated into your program for current cost, lawn service cost per square yard, and discount rate; all are assumed to be floating-point values

    • It is not necessary to format for a particular number of decimal places at this time or for the dollar sign symbol, $, which is simply embedded in the character string of the print statement
    This is what I have so far and I seriously don't know if any of it is right. I am basing it off an example program we did that is doing a similar thing.
    Spoiler

    Am I heading in the right direction?



    this is the example program I am basing it off of
    Spoiler
  • eDotd
    We ain't cool de la?
    • Jul 2006
    • 6284

    #2
    Re: Does anyone know Java?

    If you're lost start slow and ignore the user for right now. Have you got the first part where the values are given to you (the yard's dimensions) working already? Once you do that you can easily change it so that it gets the values from the user.
    Last edited by eDotd; 02-12-2011, 08:39 AM.

    Originally posted by Con-Con
    Honestly, some of the posters on here are acting like Rob Jones boned your girl while you were at work, on you own sheets BTW.
    Originally posted by trobinson97
    Mo is the Operator from the Matrix.

    Comment

    • SuperBowlNachos
      All Star
      • Jul 2004
      • 10218

      #3
      Re: Does anyone know Java?

      I'll post what I have later. I got pretty far, I have most of the calculations done. Suck at math so it was a pain trying to set them up in word form.

      Comment

      Working...