0
Java OOP help
Anyone using discord or any other platform? I want help with Java OOP my code is kind of long cannot post here.
7 odpowiedzi
0
okurpants
Post in Code Playground and share the link here.
0
🅰🅹 i have three seperate classes and one of the classes is 300 lines long so it'll be a mess if i put all of them here
0
Pastebin 512 KB in one file, or Github
0
zemiak 🅰🅹 can someone help me
passoword: 97fFhS9HkD
link: https://pastebin.com/qcH20jxN
This is a hotel reservation system I want to stop the repetition of entered data when I store and load the file. And also in the add customer method I want to check if all the rooms are booked and pass the the customer to a waiting list using a circular queue.
0
How you get duplicate of data, I try
S1L1
and get
Room number 1 is occupied by nobody.
------Details of room number1------
Paying Guest: nobody
First Name of Paying Guest: null
Surname of Paying Guest: null
Number of Guests in the Room: 0
Credit Card Number: 0
Room number 2 is occupied by nobody.
------Details of room number2------
Paying Guest: nobody
First Name of Paying Guest: null
Surname of Paying Guest: null
Number of Guests in the Room: 0
Credit Card Number: 0
Is it wrong ?
0
zemiak like when you add a customer and store and load the details are same for every room how can I stop this?
0
There is OOP problem, rewrite all code to work with this
//class Person extends Room {
class Person { ...
class Room{
//private String pgName;
private Person pGuest;
...
then you get a different Person for each room.
Because you have one Person object now, and you store the same object in each room.
for (int x = 0; x < roomObj.length; x++) {
myWriter.write("\nRoom number " + roomObj[x].getRoom() //...
myWriter.write("------Details of // ...
"Paying Guest: "+ roomObj[x].getName() +"\n"+
"First Name of Paying Guest: "+
personObj.getPgFirstName()+"\n"+
...