Insert coding that make the seat cannot be book by other people if already reserved
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Insert coding that make the seat cannot be book by other people if already reserved
// create a CLASS
public class DemoClass
{
public static void main(String [] args)
{
// create a OBJECT
DemoClass dc = new DemoClass();
int isle= count['2B','5B','8B','11B','14B','5B','17B','20B','23B','26B','29B'];
int window= count['3C','6B','9C','12C','15C','18C','21C','24C','27C','30'];
int isle= count['1A','4A','7A','10A','13A','16A','19A','22A','25A','28A',];
stdout.writen("type of seat (Double/single)?:");
String?types-stdin.readLinesync();
if(types--'single')
{
System.out.println("single");
}
else
{
else if(types--'Double')
{
stdout.wrilwln("chere(isle/window)?:");
String?hc-stdin.reixli inesysnc();
if(hc--'isle')
{
system.out.pritln("isle");
stdout.writeln("choose your seat?:");
String ? IsleSeat - stdin.readLineSync();
if(isleSeat -- isle)
{
isle.remove(IsleSeat);
System.out.println("isle");
}
}
else if(BC -- 'window')
{
System.out.println("window");
}
}
}
}
}
OUTPUT:
Step by step
Solved in 3 steps