An airplane has one hundred and eighty seats, of which sixty are “non-smokers” and numbered from 1 to 60 and one hundred and twenty seats numbered from 61 to 180 “smoker”. Design a pseudocode that allows the reservation of seats on the plane and stops half an hour before the departure of the plane, at which time the waiting list will open.

An airplane has one hundred and eighty seats, of which sixty are “non-smokers” and numbered from 1 to 60 and one hundred and twenty seats numbered from 61 to 180 “smoker”. Design a pseudocode that allows the reservation of seats on the plane and stops half an hour before the departure of the plane, at which time the waiting list will open.

  1.  

 

 

 

import java.util.Scanner;

 

public class JavaGrades

{

public static void main(String args[])

{

 

int marks [] = new int[6];

int i;

float total=0, avg;

Scanner scanner = new Scanner(System.in);

 

 

for (i=0; i<6; i++) {

System.out.print(“Enter marks of subject”+(i+1)+”:”);

marks[i] = scanner.nextInt();

total = total + marks[i];

}

scanner.close();

 

 

avg = total/6;

System.out.print(“The student Grade is: “);

if(avg>=80)

{

System.out.print(“A”);

}

else if(avg>=60 && avg<80)

{

System.out.print(“B”);

}

else if(avg>=40 && avg<60)

{

System.out.print(“C”);

}

else

{

System.out.print(“D”);

}

}

 

Answer:

define Array Non-smoker []

define Array Smoker []

define Array Waiting []

book-seat () {

if Current Time + 30 minutes <= Departure Time {

if Passenger is Non-smoker {

if Array Non-smoker []! = full

insert passenger id into Array Non-smoker []

else

print “Sorry, nonsmoker seat not available”

}

if Passenger is Smoker {

if Array Smoker []! = full

insert Passenger id into array Smoker []

else

print “Sorry, Smoker seat not available”

}

}

else {

insert Passenger id into Array Waiting []

}

}

 

Given the name of a series of students and the grades obtained on an exam, calculate and print the average grade, as well as each grade and the difference with the average.

Order a similar paper

Get the results you need