SlideShare a Scribd company logo
1 of 9
You work for an airline, a small airline, so small you have only
one plane. Your plane has 5 rows with 4 seats in each row, 2
seats are on each side of the plane with an aisle down the
middle.
I have developed the class
Seat.java
, which represents a seat on the plane. Please review
Seat.java
and understand it before you start this assignment. You are to
use
Seat.java
in this assignment. You are not to change
Seat.java
.
1 import java.util.Random;
2
3 public class Seat
4 {
5 private int row;
6 private int seat;
7 private boolean aisle;
8 private boolean window;
9 private boolean occupied;
10 private int cost;
11 private static int revenue = 0;
12
13 public Seat()
14 {
15 row = 0;
16 seat = 0;
17 aisle = false;
18 window = false;
19 occupied = false;
20 cost = 0;
21 }//end constructor
22
23 public Seat(int rowPassed, int seatPassed)
24 {
25 Random randNumGen = new Random();
26 row = rowPassed;
27 seat = seatPassed;
28 if(seatPassed == 1 || seatPassed == 2)
29 aisle = true;
30 else
31 aisle = false;
32 if(seatPassed == 0 || seatPassed == 3)
33 window = true;
34 else
35 window = false;
36 occupied = false;
37 cost = randNumGen.nextInt(301) + 200;
38 //revenue = revenue + cost;
39 }//end constructor
40
41 //getters
42 public int getRow()
43 {
44 return row;
45 }//end method getRow
46
47 public int getSeat()
48 {
49 return seat;
50 }//end method getSeat
51
52 public boolean getAisle()
53 {
54 return aisle;
55 }//end method getAisle
56
57 public boolean getWindow()
58 {
59 return window;
60 }//end method getWindow
61
62 public boolean getOccupied()
63 {
64 return occupied;
65 }//end method getOccupied
66
67 public int getCost()
68 {
69 return cost;
70 }//end method getCost
71
72 public static int getRevenue()
73 {
74 return revenue;
75 }//end method getRevenue
76
77 //////
78 //setters
79 public void setRow(int rowPassed)
80 {
81 row = rowPassed;
82 }//end method setRow
83
84 public void setSeat(int seatPassed)
85 {
86 seat = seatPassed;
87 }//end method setSeat
88
89 public void setAisle(boolean aislePassed)
90 {
91 aisle = aislePassed;
92 }//end method setAisle
93
94 public void setWindow(boolean windowPassed)
95 {
96 window = windowPassed;
97 }//end method setWindow
98
99 public void setOccupied(boolean occupiedPassed)//Revised
to take care of gaming the system
100 {
101 if(occupiedPassed == true && occupied ==
false)//unoccupied becomes occupied
102 {
103 occupied = occupiedPassed;
104 revenue = revenue + cost;
105 }
106 else if (occupiedPassed == false && occupied == true)
//occupied becomes unoccupied
107 {
108 occupied = occupiedPassed;
109 revenue = revenue - cost;
110 }
111 //no need to deal with occupied become occupied or
112 //unoccupied becomes unoccupied as no change in status
113 //of seat and renevue
114 }//end method setOccupied
115
116 public void setCost(int costPassed)
117 {
118 cost = costPassed;
119 }//end method setCost
120
121 public String toString()
122 {
123 return
124 "Row: " + row + "n" +
125 "Seat: " + seat + "n" +
126 "Aisle: " + aisle + "n" +
127 "Window: " + window + "n" +
128 "Occupied: " + occupied + "n" +
129 "Cost: $" + cost + "n";
130 }//end toString
131
132 }//end class
You work for an airline, a small airline, so small you have only one.docx

More Related Content

Similar to You work for an airline, a small airline, so small you have only one.docx

Chaining and function composition with lodash / underscore
Chaining and function composition with lodash / underscoreChaining and function composition with lodash / underscore
Chaining and function composition with lodash / underscoreNicolas Carlo
 
Workshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptWorkshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptVisual Engineering
 
PHP traits, treat or threat?
PHP traits, treat or threat?PHP traits, treat or threat?
PHP traits, treat or threat?Nick Belhomme
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesAdvanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesGanesh Samarthyam
 
Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4Jeff Carouth
 
Design patterns in javascript
Design patterns in javascriptDesign patterns in javascript
Design patterns in javascriptAbimbola Idowu
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript IntroductionDmitry Sheiko
 
Checking Oracle VM VirtualBox. Part 1
Checking Oracle VM VirtualBox. Part 1Checking Oracle VM VirtualBox. Part 1
Checking Oracle VM VirtualBox. Part 1Andrey Karpov
 
What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?Christophe Porteneuve
 
10 Catalyst Tips
10 Catalyst Tips10 Catalyst Tips
10 Catalyst TipsJay Shirley
 
Drehbuch zum Talk "Rapid Prototyping mit PHP Frameworks"
Drehbuch zum Talk "Rapid Prototyping mit PHP Frameworks"Drehbuch zum Talk "Rapid Prototyping mit PHP Frameworks"
Drehbuch zum Talk "Rapid Prototyping mit PHP Frameworks"Ralf Eggert
 
Chaining et composition de fonctions avec lodash / underscore
Chaining et composition de fonctions avec lodash / underscoreChaining et composition de fonctions avec lodash / underscore
Chaining et composition de fonctions avec lodash / underscoreNicolas Carlo
 
Checking Oracle VM VirtualBox. Part 2
Checking Oracle VM VirtualBox. Part 2Checking Oracle VM VirtualBox. Part 2
Checking Oracle VM VirtualBox. Part 2Andrey Karpov
 
ES6 PPT FOR 2016
ES6 PPT FOR 2016ES6 PPT FOR 2016
ES6 PPT FOR 2016Manoj Kumar
 

Similar to You work for an airline, a small airline, so small you have only one.docx (20)

Chaining and function composition with lodash / underscore
Chaining and function composition with lodash / underscoreChaining and function composition with lodash / underscore
Chaining and function composition with lodash / underscore
 
Workshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptWorkshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScript
 
ES6 Overview
ES6 OverviewES6 Overview
ES6 Overview
 
PHP traits, treat or threat?
PHP traits, treat or threat?PHP traits, treat or threat?
PHP traits, treat or threat?
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Template Method Design Pattern
Template Method Design PatternTemplate Method Design Pattern
Template Method Design Pattern
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesAdvanced Debugging Using Java Bytecodes
Advanced Debugging Using Java Bytecodes
 
Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4
 
Design patterns in javascript
Design patterns in javascriptDesign patterns in javascript
Design patterns in javascript
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
Checking Oracle VM VirtualBox. Part 1
Checking Oracle VM VirtualBox. Part 1Checking Oracle VM VirtualBox. Part 1
Checking Oracle VM VirtualBox. Part 1
 
Griffon @ Svwjug
Griffon @ SvwjugGriffon @ Svwjug
Griffon @ Svwjug
 
Wcbpijwbpij new
Wcbpijwbpij newWcbpijwbpij new
Wcbpijwbpij new
 
What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?
 
Mastering Java ByteCode
Mastering Java ByteCodeMastering Java ByteCode
Mastering Java ByteCode
 
10 Catalyst Tips
10 Catalyst Tips10 Catalyst Tips
10 Catalyst Tips
 
Drehbuch zum Talk "Rapid Prototyping mit PHP Frameworks"
Drehbuch zum Talk "Rapid Prototyping mit PHP Frameworks"Drehbuch zum Talk "Rapid Prototyping mit PHP Frameworks"
Drehbuch zum Talk "Rapid Prototyping mit PHP Frameworks"
 
Chaining et composition de fonctions avec lodash / underscore
Chaining et composition de fonctions avec lodash / underscoreChaining et composition de fonctions avec lodash / underscore
Chaining et composition de fonctions avec lodash / underscore
 
Checking Oracle VM VirtualBox. Part 2
Checking Oracle VM VirtualBox. Part 2Checking Oracle VM VirtualBox. Part 2
Checking Oracle VM VirtualBox. Part 2
 
ES6 PPT FOR 2016
ES6 PPT FOR 2016ES6 PPT FOR 2016
ES6 PPT FOR 2016
 

More from rosemarybdodson23141

Young Adulthood begins with the individual being on the verge of att.docx
Young Adulthood begins with the individual being on the verge of att.docxYoung Adulthood begins with the individual being on the verge of att.docx
Young Adulthood begins with the individual being on the verge of att.docxrosemarybdodson23141
 
Your abilities in international management have been recognize.docx
Your abilities in international management have been recognize.docxYour abilities in international management have been recognize.docx
Your abilities in international management have been recognize.docxrosemarybdodson23141
 
your 14 years daughter accidently leaves her purse open in the fam.docx
your 14 years daughter accidently leaves her purse open in the fam.docxyour 14 years daughter accidently leaves her purse open in the fam.docx
your 14 years daughter accidently leaves her purse open in the fam.docxrosemarybdodson23141
 
Young people are ruining the English languageIn your reflectio.docx
Young people are ruining the English languageIn your reflectio.docxYoung people are ruining the English languageIn your reflectio.docx
Young people are ruining the English languageIn your reflectio.docxrosemarybdodson23141
 
Young man drops out of school in seventh grade and becomes his mothe.docx
Young man drops out of school in seventh grade and becomes his mothe.docxYoung man drops out of school in seventh grade and becomes his mothe.docx
Young man drops out of school in seventh grade and becomes his mothe.docxrosemarybdodson23141
 
Young and the RestlessWeek 11 Couples Therapy Movie Experience .docx
Young and the RestlessWeek 11 Couples Therapy Movie Experience .docxYoung and the RestlessWeek 11 Couples Therapy Movie Experience .docx
Young and the RestlessWeek 11 Couples Therapy Movie Experience .docxrosemarybdodson23141
 
You-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docx
You-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docxYou-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docx
You-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docxrosemarybdodson23141
 
You  may have seen how financial news outlets provide real-time .docx
You  may have seen how financial news outlets provide real-time .docxYou  may have seen how financial news outlets provide real-time .docx
You  may have seen how financial news outlets provide real-time .docxrosemarybdodson23141
 
You  are responsible for putting together the Harmony Day celebr.docx
You  are responsible for putting together the Harmony Day celebr.docxYou  are responsible for putting together the Harmony Day celebr.docx
You  are responsible for putting together the Harmony Day celebr.docxrosemarybdodson23141
 
You wrote this scenario from the perspective of Behaviorism learni.docx
You wrote this scenario from the perspective of Behaviorism learni.docxYou wrote this scenario from the perspective of Behaviorism learni.docx
You wrote this scenario from the perspective of Behaviorism learni.docxrosemarybdodson23141
 
You worked closely with your IT managers to develop a complementing .docx
You worked closely with your IT managers to develop a complementing .docxYou worked closely with your IT managers to develop a complementing .docx
You worked closely with your IT managers to develop a complementing .docxrosemarybdodson23141
 
You work in the office of a personal financial planner. He has asked.docx
You work in the office of a personal financial planner. He has asked.docxYou work in the office of a personal financial planner. He has asked.docx
You work in the office of a personal financial planner. He has asked.docxrosemarybdodson23141
 
You work in the IT department of a financial services company that s.docx
You work in the IT department of a financial services company that s.docxYou work in the IT department of a financial services company that s.docx
You work in the IT department of a financial services company that s.docxrosemarybdodson23141
 
You work for the Jaguars Bank as the Chief Information Officer.  It .docx
You work for the Jaguars Bank as the Chief Information Officer.  It .docxYou work for the Jaguars Bank as the Chief Information Officer.  It .docx
You work for the Jaguars Bank as the Chief Information Officer.  It .docxrosemarybdodson23141
 
You work for OneEarth, an environmental consulting company that .docx
You work for OneEarth, an environmental consulting company that .docxYou work for OneEarth, an environmental consulting company that .docx
You work for OneEarth, an environmental consulting company that .docxrosemarybdodson23141
 
You work for an international construction company that has been con.docx
You work for an international construction company that has been con.docxYou work for an international construction company that has been con.docx
You work for an international construction company that has been con.docxrosemarybdodson23141
 
You will write your Literature Review Section of your EBP Projec.docx
You will write your Literature Review Section of your EBP Projec.docxYou will write your Literature Review Section of your EBP Projec.docx
You will write your Literature Review Section of your EBP Projec.docxrosemarybdodson23141
 
You work for a small community hospital that has recently updated it.docx
You work for a small community hospital that has recently updated it.docxYou work for a small community hospital that has recently updated it.docx
You work for a small community hospital that has recently updated it.docxrosemarybdodson23141
 
You work for a regional forensic computer lab and have been tasked w.docx
You work for a regional forensic computer lab and have been tasked w.docxYou work for a regional forensic computer lab and have been tasked w.docx
You work for a regional forensic computer lab and have been tasked w.docxrosemarybdodson23141
 
You work for a political science magazine, Government Today. T.docx
You work for a political science magazine, Government Today. T.docxYou work for a political science magazine, Government Today. T.docx
You work for a political science magazine, Government Today. T.docxrosemarybdodson23141
 

More from rosemarybdodson23141 (20)

Young Adulthood begins with the individual being on the verge of att.docx
Young Adulthood begins with the individual being on the verge of att.docxYoung Adulthood begins with the individual being on the verge of att.docx
Young Adulthood begins with the individual being on the verge of att.docx
 
Your abilities in international management have been recognize.docx
Your abilities in international management have been recognize.docxYour abilities in international management have been recognize.docx
Your abilities in international management have been recognize.docx
 
your 14 years daughter accidently leaves her purse open in the fam.docx
your 14 years daughter accidently leaves her purse open in the fam.docxyour 14 years daughter accidently leaves her purse open in the fam.docx
your 14 years daughter accidently leaves her purse open in the fam.docx
 
Young people are ruining the English languageIn your reflectio.docx
Young people are ruining the English languageIn your reflectio.docxYoung people are ruining the English languageIn your reflectio.docx
Young people are ruining the English languageIn your reflectio.docx
 
Young man drops out of school in seventh grade and becomes his mothe.docx
Young man drops out of school in seventh grade and becomes his mothe.docxYoung man drops out of school in seventh grade and becomes his mothe.docx
Young man drops out of school in seventh grade and becomes his mothe.docx
 
Young and the RestlessWeek 11 Couples Therapy Movie Experience .docx
Young and the RestlessWeek 11 Couples Therapy Movie Experience .docxYoung and the RestlessWeek 11 Couples Therapy Movie Experience .docx
Young and the RestlessWeek 11 Couples Therapy Movie Experience .docx
 
You-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docx
You-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docxYou-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docx
You-Attitude A Linguistic PerspectiveLllita RodmanThe Uni.docx
 
You  may have seen how financial news outlets provide real-time .docx
You  may have seen how financial news outlets provide real-time .docxYou  may have seen how financial news outlets provide real-time .docx
You  may have seen how financial news outlets provide real-time .docx
 
You  are responsible for putting together the Harmony Day celebr.docx
You  are responsible for putting together the Harmony Day celebr.docxYou  are responsible for putting together the Harmony Day celebr.docx
You  are responsible for putting together the Harmony Day celebr.docx
 
You wrote this scenario from the perspective of Behaviorism learni.docx
You wrote this scenario from the perspective of Behaviorism learni.docxYou wrote this scenario from the perspective of Behaviorism learni.docx
You wrote this scenario from the perspective of Behaviorism learni.docx
 
You worked closely with your IT managers to develop a complementing .docx
You worked closely with your IT managers to develop a complementing .docxYou worked closely with your IT managers to develop a complementing .docx
You worked closely with your IT managers to develop a complementing .docx
 
You work in the office of a personal financial planner. He has asked.docx
You work in the office of a personal financial planner. He has asked.docxYou work in the office of a personal financial planner. He has asked.docx
You work in the office of a personal financial planner. He has asked.docx
 
You work in the IT department of a financial services company that s.docx
You work in the IT department of a financial services company that s.docxYou work in the IT department of a financial services company that s.docx
You work in the IT department of a financial services company that s.docx
 
You work for the Jaguars Bank as the Chief Information Officer.  It .docx
You work for the Jaguars Bank as the Chief Information Officer.  It .docxYou work for the Jaguars Bank as the Chief Information Officer.  It .docx
You work for the Jaguars Bank as the Chief Information Officer.  It .docx
 
You work for OneEarth, an environmental consulting company that .docx
You work for OneEarth, an environmental consulting company that .docxYou work for OneEarth, an environmental consulting company that .docx
You work for OneEarth, an environmental consulting company that .docx
 
You work for an international construction company that has been con.docx
You work for an international construction company that has been con.docxYou work for an international construction company that has been con.docx
You work for an international construction company that has been con.docx
 
You will write your Literature Review Section of your EBP Projec.docx
You will write your Literature Review Section of your EBP Projec.docxYou will write your Literature Review Section of your EBP Projec.docx
You will write your Literature Review Section of your EBP Projec.docx
 
You work for a small community hospital that has recently updated it.docx
You work for a small community hospital that has recently updated it.docxYou work for a small community hospital that has recently updated it.docx
You work for a small community hospital that has recently updated it.docx
 
You work for a regional forensic computer lab and have been tasked w.docx
You work for a regional forensic computer lab and have been tasked w.docxYou work for a regional forensic computer lab and have been tasked w.docx
You work for a regional forensic computer lab and have been tasked w.docx
 
You work for a political science magazine, Government Today. T.docx
You work for a political science magazine, Government Today. T.docxYou work for a political science magazine, Government Today. T.docx
You work for a political science magazine, Government Today. T.docx
 

Recently uploaded

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 

Recently uploaded (20)

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 

You work for an airline, a small airline, so small you have only one.docx

  • 1. You work for an airline, a small airline, so small you have only one plane. Your plane has 5 rows with 4 seats in each row, 2 seats are on each side of the plane with an aisle down the middle. I have developed the class Seat.java , which represents a seat on the plane. Please review Seat.java and understand it before you start this assignment. You are to use Seat.java in this assignment. You are not to change Seat.java . 1 import java.util.Random; 2 3 public class Seat 4 { 5 private int row; 6 private int seat; 7 private boolean aisle; 8 private boolean window; 9 private boolean occupied;
  • 2. 10 private int cost; 11 private static int revenue = 0; 12 13 public Seat() 14 { 15 row = 0; 16 seat = 0; 17 aisle = false; 18 window = false; 19 occupied = false; 20 cost = 0; 21 }//end constructor 22 23 public Seat(int rowPassed, int seatPassed) 24 { 25 Random randNumGen = new Random(); 26 row = rowPassed; 27 seat = seatPassed;
  • 3. 28 if(seatPassed == 1 || seatPassed == 2) 29 aisle = true; 30 else 31 aisle = false; 32 if(seatPassed == 0 || seatPassed == 3) 33 window = true; 34 else 35 window = false; 36 occupied = false; 37 cost = randNumGen.nextInt(301) + 200; 38 //revenue = revenue + cost; 39 }//end constructor 40 41 //getters 42 public int getRow() 43 { 44 return row; 45 }//end method getRow
  • 4. 46 47 public int getSeat() 48 { 49 return seat; 50 }//end method getSeat 51 52 public boolean getAisle() 53 { 54 return aisle; 55 }//end method getAisle 56 57 public boolean getWindow() 58 { 59 return window; 60 }//end method getWindow 61 62 public boolean getOccupied() 63 {
  • 5. 64 return occupied; 65 }//end method getOccupied 66 67 public int getCost() 68 { 69 return cost; 70 }//end method getCost 71 72 public static int getRevenue() 73 { 74 return revenue; 75 }//end method getRevenue 76 77 ////// 78 //setters 79 public void setRow(int rowPassed) 80 { 81 row = rowPassed;
  • 6. 82 }//end method setRow 83 84 public void setSeat(int seatPassed) 85 { 86 seat = seatPassed; 87 }//end method setSeat 88 89 public void setAisle(boolean aislePassed) 90 { 91 aisle = aislePassed; 92 }//end method setAisle 93 94 public void setWindow(boolean windowPassed) 95 { 96 window = windowPassed; 97 }//end method setWindow 98 99 public void setOccupied(boolean occupiedPassed)//Revised to take care of gaming the system
  • 7. 100 { 101 if(occupiedPassed == true && occupied == false)//unoccupied becomes occupied 102 { 103 occupied = occupiedPassed; 104 revenue = revenue + cost; 105 } 106 else if (occupiedPassed == false && occupied == true) //occupied becomes unoccupied 107 { 108 occupied = occupiedPassed; 109 revenue = revenue - cost; 110 } 111 //no need to deal with occupied become occupied or 112 //unoccupied becomes unoccupied as no change in status 113 //of seat and renevue 114 }//end method setOccupied 115 116 public void setCost(int costPassed)
  • 8. 117 { 118 cost = costPassed; 119 }//end method setCost 120 121 public String toString() 122 { 123 return 124 "Row: " + row + "n" + 125 "Seat: " + seat + "n" + 126 "Aisle: " + aisle + "n" + 127 "Window: " + window + "n" + 128 "Occupied: " + occupied + "n" + 129 "Cost: $" + cost + "n"; 130 }//end toString 131 132 }//end class