Thanks Thanks:  0
Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2002
    Location
    Dallas, TX
    Posts
    2,488
    Credits
    1,065

    who wants to do my homework for me?



    i am very frustrated right now!!!!!

    Instructions:
    Purpose: Demonstrate the ability to create and execute a JAVA program utilizing basic, elementary JAVA statements.

    Assignment: Write a program that calculates a car’s gas mileage. Accept from the keyboard the number of gallons consumed on the trip, the starting mileage for the trip and the ending mileage for the trip. Calculate the miles per gallon and print all the data in a clear format on the screen.


    that is only my second assignment in my first java programming class... how wicked

    i got a 100 on my first program assignment tho!! :big grin:
    (yes i did it all on my own)



    this is a half serious and a half joke thread. you don't have to help and i should do it myself.
    but i want help and i don't wanna do it myself.... hehe
    "Frankly, my dear, I don't give a damn."

  2. #2
    Join Date
    Sep 2001
    Location
    No place like 127.0.0.1
    Posts
    1,399
    Credits
    1,103
    hehe i could help you cause i did java last term.. but i am too lazy to remember the syntax

    but it would look something like this is

    var start_mileage; /* here you would put form data */
    var end_mileage; /* and here */
    var gallons; /* and here */
    var mileage; /*these are worked out later */
    var answer; /*and this */

    mileage = end_mileage - start_mileage;
    answer = mileage / gallons;

    then you would either create an alert

    alert(answer);

    to display or have it displayed in a form! up to you

    hope that sorta helps its been a year since i looked at java code and im rusty


    [My Top 20 Movies@Ymdb] - ([)(]) Dolby Digital the choice of ML's - [~My Place ~]

    {Drag The Sunrise Down: You know the light can hypnotise, so shut it out and close your eyes - Rooster}

  3. #3
    Join Date
    Jul 2003
    Location
    London Ont Canada
    Posts
    244
    Credits
    1,085

    Question


  4. #4
    Join Date
    Feb 2003
    Location
    NYC, USA
    Posts
    2,356
    Credits
    1,105
    how about this - we trade

    I do that for u and you do my

    30 pages of college bio
    25 pages of college chem
    30 pages of American History 2
    5 pages of Environmental Medicine
    25 pages of Gothic literature

    and that's without the questions or special assignments

    someone plz feel bad for me

  5. #5
    Join Date
    Apr 2002
    Location
    Dallas, TX
    Posts
    2,488
    Credits
    1,065
    awwww Jake!!


    well thanks for trying everybody!!
    but i got it now..

    /* Program that calculates a car’s gas mileage
    Stephanie Bradley
    CS 1315 Assignment #2
    */

    import javax.swing.JOptionPane;

    public class Assignment2
    {
    public static void main(String[]args)
    {

    double gallons = 0;
    double gasMileage = 0;
    double startingMileage = 0;
    double endingMileage = 0;


    //Prompt the user to enter the gallon

    String gallonsString = JOptionPane.showInputDialog(null, "Enter the gallons",
    "Input Dialog Demo", JOptionPane.QUESTION_MESSAGE);


    //Prompt the user to enter the starting mileage

    String startingMileageString = JOptionPane.showInputDialog(null, "Enter the starting mileage" ,
    "Input Dialog Demo", JOptionPane.QUESTION_MESSAGE);


    //Prompt the user to enter the ending mileage

    String endingMileageString = JOptionPane.showInputDialog(null, "Enter the ending mileage",
    "Input Dialog Demo", JOptionPane.QUESTION_MESSAGE);

    //Assign gasMileage
    gallons = Double.parseDouble(gallonsString);
    startingMileage = Double.parseDouble(startingMileageString);
    endingMileage = Double.parseDouble(endingMileageString);
    gasMileage = (endingMileage - startingMileage) / gallons;


    //Display results

    JOptionPane.showMessageDialog(null,"The miles per gallons are " + gasMileage,
    "Assignment #2 Output", JOptionPane.INFORMATION_MESSAGE);

    System.exit(0);
    }
    }



    sorry jake... i can't do your homework now since you didn't do this for me


    and yes I did that all by myself!! :big grin: (no applause please)

  6. #6
    Join Date
    Jan 2002
    Location
    Ontario, Canada
    Posts
    897
    Credits
    1,105
    Looks like I'm too late, and can only program in BASIC anyway

    oh yeah...feel the power of my real-world skills.

  7. #7
    Join Date
    Sep 2001
    Location
    No place like 127.0.0.1
    Posts
    1,399
    Credits
    1,103
    hehe its right marcus.. i realised my tip was done for javascript not java hehe..

  8. #8
    Join Date
    Apr 2002
    Location
    Dallas, TX
    Posts
    2,488
    Credits
    1,065
    made an A in this course! wooooooohooooooo!!!!!!!!!!!

  9. #9
    Join Date
    May 2002
    Location
    Mel, AU
    Posts
    5,079
    Credits
    1,091
    Congrat, you cheater you. j/k
    Last edited by editman; 12-15-2003 at 09:41 PM.

    "The idea was to be a symbol. editman could be anybody, that was the point."

    Trolls destroyed the Forum

    my DVD/blu-ray List

Bookmarks

Bookmarks

Posting Permissions

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