asdf

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cowboybebop
    FFR Player
    • May 2004
    • 1

    #1

    asdf

    class project2
    {

    public static EasyReader console = new EasyReader();

    public static void main (String[] args)
    {
    int people, miles;
    print("Enter #people , minimum = 25, maximum = 250");
    people = console.readInt();
    if (people < 25)
    {
    print ("Invalid number of people.Now exiting.");
    }
    if (people > 200)
    {
    print ("Invalid number of people.Now exiting.");
    }
    print("Enter #miles , minimum = 150, maximum = 1600");
    miles = console.readInt();
    if (miles < 150)
    {
    print ("Invalid number of Miles.Now exiting.");
    System.exit(1);
    }
    if (people > 1500)
    {
    print ("Invalid number of Miles. Now exiting.");
    System.exit(1);
    }

    analysis(people,miles);
    }

    public static void analysis(int people, int miles)
    {
    int bus, peopleonvan, numofbus, numofvans;
    double cost=50;
    double GP, MC, MC2;
    print ("Bus Charter Trip Analysis");
    print ("Number of passengers:" + people);
    print ("Number of miles for the trip:" + miles);
    peopleonvan = people % 50;
    bus = people - peopleonvan;
    if (bus<=0)
    {
    bus=peopleonvan + 5;
    peopleonvan=0;
    }

    print ("Transported via bus:"+ peopleonvan);
    print ("Transported via van:"+ peopleonvan);
    numofbus = bus / 50;
    if ((bus > 0) && (numofbus==0))
    {
    numofbus=1;
    }
    numofvans= peopleonvan / 15;
    if ((peopleonvan > 0) && (numofvans==0))
    {
    numofvans=1;
    }
    if ((peopleonvan > 15) && (numofvans==1))
    {
    numofvans=2;
    }
    print ("Number of busses:" + numofvans);
    print ("Number of vans:"+ numofbus);
    if (miles>=150)
    {
    cost=25;
    if (miles<=201)
    {
    cost=30;
    if (miles<=401)
    {
    cost=50;
    if (miles<=801)
    {
    cost=80;
    if (miles<=1201)
    {
    cost=100;
    }
    }
    }
    }
    }
    GP=(double)people * cost;
    print ("Gross Profit: $"+ GP);
    MC= (double)numofbus * ((double)miles * 1.275);
    MC2= (double)numofvans * ((double)miles * .175);
    double MC3= MC - MC2;
    print ("Maintenance Costs: $"+ MC3);
    double profitlost= GP-MC3;
    print ("Profit or loss on trip: $"+ profitlost);
    }


    public static void print(String msg)
    {
    System.out.println(msg);
    }

    }
  • Kilgamayan
    Super Scooter Happy
    FFR Simfile Author
    • Feb 2003
    • 6583

    #2
    RE: asdf

    I watched clouds awobbly from the floor o' that kayak. Souls cross ages like clouds cross skies, an' tho' a cloud's shape nor hue nor size don't stay the same, it's still a cloud an' so is a soul. Who can say where the cloud's blowed from or who the soul'll be 'morrow? Only Sonmi the east an' the west an' the compass an' the atlas, yay, only the atlas o' clouds.

    Comment

    • JurseyRider734
      lil j the bad b-word
      • Aug 2003
      • 7506

      #3
      RE: asdf

      Stfu Newbie


      See sig.
      Originally posted by Arch0wl
      I'd better be considering I own roughly six textbooks on logic and have taken courses involving its extensive use

      Originally posted by Afrobean
      Originally Posted by JurseyRider734
      the fact that you're resorting to threatening physical violence says a lot anyway.
      Just that you're a piece of shit who can't see reason and instead deserves a fucking beating.

      Comment

      • dinnerroll
        FFR Player
        • Jun 2004
        • 283

        #4
        RE: asdf

        um...yeah..What they said.

        Comment

        • lightdarkness
          Summer!!
          • Jul 2003
          • 11308

          #5
          RE: asdf

          Um...

          Just don't post this again.

          EDIT: Ran the code in java, go this...

          Enter #people , minimum = 25, maximum = 200
          100
          Enter #miles , minimum = 150, maximum = 1600
          500
          Bus Charter Trip Analysis
          Number of passengers:100
          Number of miles for the trip:500
          Transported via bus:100
          Transported via van:0
          Number of busses:2
          Number of vans:0
          Gross Profit: $3000.0
          Maintenance Costs: $1750.0
          Profit or loss on trip: $1250.0
          Press any key to continue...

          Comment

          Working...