SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 6 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 16 Oct 2017 My Price 8.00

Eclipse is giving me a few errors and I can't fix them.

I need this code fixed my assignment is attached to this post. Eclipse is giving me a few errors and I can't fix them. My deadline is tomorrow at 9pm

 

/***************************************************************************************

* HAUnit4.java

* Alicia Holmes

*

* This program determines whrn you should head to the airport for an upcoming flight.

*****************************************************************************************/

 

import java.util.Scanner;

 

public class HAUnit4

{

 public static void main (String[] args)

 {

  Scanner stdIn = new Scanner(System.in) ;

  String flightDay;      // user entered-day of flight departure

  String currentDay;      // current day

  int flightHour;       // military hour of flight departure

  int currentHour;       // current military hour

  char response;        // user's response y/n response

  boolean departureDay = true; // Does the current day match the flight day?

  int HOURS_LEFT_TILL_FLIGHT; // hours left until flight departure

  HOURS_LEFT_TILL_FLIGHT = currentHour - flightHour;

 

  do

  {

   System.out.print ("Enter the day of your flight: ");

   flightDay = stdIn.nextString ();

   System.out.print ("Enter the hour your flight leaves: ");

   flightHour = stdIn.nextInt ();

   System.out.print ("Enter the current day: ");

   currentDay = stdIn.nextString ();

   System.out.print ("Enter the current hour: ");

   System.out.print ("Is today your departure day? (y/n): ");

   response = stdIn.next() .charAt (0);

   while (!response.equals (n) && !response.equalsIgnoreCase (N))

   {

    System.out.println ("Invalid entry.") ;

    System.out.println (Today isn't your flight, keep checking.") ;

   } while (response == 'n' || response == 'N') ;

   } 

 

  if (departureDay))

  {

 

   switch (int HOURS_LEFT_TILL_FLIGHT)

   {

    case 17: case 18: case 19: case 20: case 21: case 22: case 23:

     System.out.println("Are you seriously checking this early?") ;

     break;

    case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 16:

     System.out.println("Plenty of time, no need to rush.") ;

     break;

    case 3: case 4:

     System.out.println("Better be heading to the airport.") ;

     break;

    case 2:

     System.out.println("Hope you are at the airport.") ;

     break;

    case 1:

     System.out.println("You best be at the airport, security lines are long.") ;

     break;

    default:

     System.out.println("Hopefully you made your flight.") ;

   } // end switch

  }

     System.out.println("Thanks for planning your trip with us.") ;

 } // end main

} // end class HAUnit4

Attachments:

Answers

(5)
Status NEW Posted 16 Oct 2017 09:10 AM My Price 8.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)