catch (Exception InputMismatch) { System.out.printin ("Please input an integer number"): System.out.printin ("Does the flight make more than one stop to its destination? answer true or false: ") : try ( transit - sc.nextBoolean (): catch (Exception InputMismatch) ( System.out.printin ("Please answer (true) or (false) "): System.out.printin ("Is the flight international? answer true or false: "): try ( international - sc.nextBoolean (): catch (Exception InputMismatch) ( System.out.printin ("Please answer (true) or (false) "): boolean FlightCheck - true: for (int i - 0; i< Flights.size (): i++) { if (flightNumber -- Flights.get (i).getFlightNum () ){ FlightCheck - false: if (FlightCheck - false) { System.out.printin ("Flight " + flightNumber + "already exists"): elsel Flight flight - new Flight (flightNumber, cap, transit, international): System.out.printin (Flights): g20428164.AhmedAlsomali20428 164> O main > while (option !- 9) > switch (option) > case 1: > for (nti - 0; i < Fights.size); i++) > if (fightNumber - Fights.get().getFightNum0) > li 20428164 (run) x Ahmed Alsomali 20428 164 (run) #2 x Pption: 1- NlewFlight at flight number: at flight passenger capacity (maximum) : light make more than one stop to its destination? ansver true or false: ght international? ansver true or false: in thread "main" java.lang. Runtime Exception: Uncompilable source code - variable flightlumber might not have been initialized ahmed. alsomali.pkg20428164.AhmedAlsomali20428164.main (AhmedAlsomali20428164.java:112) nmdh\AppData\Local\NetBeans\Cache\8.2\executor-snippess\run.xml:53: Java returned: 1
catch (Exception InputMismatch) { System.out.printin ("Please input an integer number"): System.out.printin ("Does the flight make more than one stop to its destination? answer true or false: ") : try ( transit - sc.nextBoolean (): catch (Exception InputMismatch) ( System.out.printin ("Please answer (true) or (false) "): System.out.printin ("Is the flight international? answer true or false: "): try ( international - sc.nextBoolean (): catch (Exception InputMismatch) ( System.out.printin ("Please answer (true) or (false) "): boolean FlightCheck - true: for (int i - 0; i< Flights.size (): i++) { if (flightNumber -- Flights.get (i).getFlightNum () ){ FlightCheck - false: if (FlightCheck - false) { System.out.printin ("Flight " + flightNumber + "already exists"): elsel Flight flight - new Flight (flightNumber, cap, transit, international): System.out.printin (Flights): g20428164.AhmedAlsomali20428 164> O main > while (option !- 9) > switch (option) > case 1: > for (nti - 0; i < Fights.size); i++) > if (fightNumber - Fights.get().getFightNum0) > li 20428164 (run) x Ahmed Alsomali 20428 164 (run) #2 x Pption: 1- NlewFlight at flight number: at flight passenger capacity (maximum) : light make more than one stop to its destination? ansver true or false: ght international? ansver true or false: in thread "main" java.lang. Runtime Exception: Uncompilable source code - variable flightlumber might not have been initialized ahmed. alsomali.pkg20428164.AhmedAlsomali20428164.main (AhmedAlsomali20428164.java:112) nmdh\AppData\Local\NetBeans\Cache\8.2\executor-snippess\run.xml:53: Java returned: 1
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
I'm working on a java program that takes input from user and creates flights (objects).
I'm trying to assign variables to user input, and use these variables as an argument for my object, but I keep getting an error that says I didn't initalize my variables (although I did + it should have the value of user input). Can someoene please tell me what I'm doing wrong?
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education