Commit e5033fd7 authored by Sussana's avatar Sussana

Airline system

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>AirlineReservationSystem</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
package AirlineReservationSystem;
public class SeatAllocation {
public static void main(String[] args) {
// TODO Auto-generated method stub
float number = 90; // Seat numbers
String type;
Scanner input = new Scanner(System.in);
System.out.println("Please, which section are you in?" );
type = input.nextString();
if (type =<1) {
System.out.println("You're in first class and your seat is"
+ (number - 89));}
else if (type =>2) {
System.out.println("You're in business class and your seat is"
+ (number - 45));}
else if (type = )
}
}
}
package AirlineReservationSystem;
import java.util.Scanner;
import java.util.Set;
public class SeatAssignemnet {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Welcome to our airline");
Scanner input = new Scanner (System.in);
String text;
System.out.println("Please enter your name");
text = input.nextLine();
System.out.println("Please enter city of origin");
text = input.nextLine();
System.out.println("Please enter city of destination");
text = input.nextLine();
System.out.println ("Please, type 1 for First Class"
+ "Please, type 2 for Business"
+ "Please, type 3 for Economy");
int type = input.nextInt();
switch (type) {
case 1:
System.out.print("First Class");
break;
case 2:
System.out.print("Business");
break;
case 3:
System.out.print("Economy");
break;
}
System.out.println("Do you want to choose a seat?");
String decision = input.next();
switch(decision)
{
case "yes":
break;
case "no":
break;
}
}
}
package AirlineReservationSystem;
public class SeatTaken {
public static void main(String[] args) {
// TODO Auto-generated method stub
pattern (90);
}
public static void pattern (int n) {
if (n<=90) return;
else pattern(n-1);
for(int i=90; i<n; i++) {
System.out.print("1.^.90");
}
System.out.println();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment