From c66e2fcf117ce377e404b916a022b9e84a4b035b Mon Sep 17 00:00:00 2001 From: siddhi247 <152321352+siddhi247@users.noreply.github.com> Date: Tue, 30 Apr 2024 23:42:38 +0530 Subject: [PATCH 1/7] Create Booking.java --- Team25-TourismBooingSystem/Booking.java | 50 +++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Team25-TourismBooingSystem/Booking.java diff --git a/Team25-TourismBooingSystem/Booking.java b/Team25-TourismBooingSystem/Booking.java new file mode 100644 index 0000000..bf17d0d --- /dev/null +++ b/Team25-TourismBooingSystem/Booking.java @@ -0,0 +1,50 @@ +package tourismbooking; + +public class Booking { + private int noOfPersons; + private long mob; + private String email; + private Person persons[]; + private int index=0; + Packages.Package selectedPackage; + + public Booking(int noOfPersons, long mob, String email) { + this.noOfPersons = noOfPersons; + this.mob = mob; + this.email = email; + this.persons = new Person[noOfPersons]; + } + public void addPerson(Person person) { + if (index < noOfPersons) { + persons[index] = person; + index++; + } + + + } + + public void addPackage(Packages.Package packageToAdd) { + + this.selectedPackage = packageToAdd; + System.out.println("----------------------------------------"); + System.out.println("Package added successfully : "); + System.out.println(packageToAdd); + System.out.println("----------------------------------------"); + } + + public int getNoOfPersons() { + return noOfPersons; + } + + public long getMob() { + return mob; + } + + public String getEmail() { + return email; + } + + public Person[] getPersons() { + return persons; + } +} From d97430e5fac845fd1dce93bd189cd221f5ba2976 Mon Sep 17 00:00:00 2001 From: siddhi247 <152321352+siddhi247@users.noreply.github.com> Date: Tue, 30 Apr 2024 23:43:03 +0530 Subject: [PATCH 2/7] Create Main.java --- Team25-TourismBooingSystem/Main.java | 232 +++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 Team25-TourismBooingSystem/Main.java diff --git a/Team25-TourismBooingSystem/Main.java b/Team25-TourismBooingSystem/Main.java new file mode 100644 index 0000000..a070001 --- /dev/null +++ b/Team25-TourismBooingSystem/Main.java @@ -0,0 +1,232 @@ +package tourismbooking; + +import java.util.Scanner; +import java.util.ArrayList; +public class Main { + public static void clearScreen() + { + for (int i = 0; i < 10; i++) { // Adjust the number for your preference + System.out.println(); // Print blank lines + } + } + public static void main(String[] args) { + long mobile; + int noOfPersons; + char gender; + Scanner scanner = new Scanner(System.in); + System.out.println("****************************************"); + System.out.println("\tENTER USER INFORMATION : "); + System.out.println("****************************************"); + + do { + System.out.println("Enter the number of persons : "); + noOfPersons = scanner.nextInt(); + scanner.nextLine(); + if(noOfPersons<=0) + System.out.println("Invalid number of persons. Please try again:"); + }while(noOfPersons<=0); + + do { + System.out.println("Enter your mobile number : "); + mobile = scanner.nextLong(); + scanner.nextLine(); + if(String.valueOf(mobile).length() != 10) + System.out.println("Invalid Mobile number. Please enter again : "); + }while(String.valueOf(mobile).length() != 10); + + System.out.println("Enter your email address:"); + String email = scanner.nextLine(); + + + Booking booking = new Booking(noOfPersons, mobile, email); + + + for (int i = 0; i < noOfPersons; i++) { + System.out.println("-------------------------------------------"); + System.out.println("Enter details for person " + (i + 1) + ":"); + + System.out.print("First Name: "); + String firstName = scanner.nextLine(); + + System.out.print("Last Name: "); + String lastName = scanner.nextLine(); + + System.out.print("Age: "); + int age = scanner.nextInt(); + scanner.nextLine(); + + + System.out.println("Aadhaar Number: "); + String aadhaar = scanner.nextLine(); + + System.out.print("Gender (m/f) :"); + do { + gender = scanner.nextLine().charAt(0); + if(gender!='m' && gender!='f') + System.out.println("Invalid selection. Please try again : "); + }while(gender!='m' && gender!='f'); + + + + Person person = new Person(firstName, lastName, age, aadhaar, gender); + booking.addPerson(person); + } + System.out.println("Press ENTER to continue...."); + scanner.nextLine(); + clearScreen(); + // Step 1: Add hill stations + Places.addHillStations(); // Initialize the list of hill stations + + // Step 2: Display hill stations with their attractions + ArrayList hillStations = Places.getHillStations(); + + System.out.println("****************************************"); + System.out.println("Available Hill Stations with Attractions:"); + System.out.println("****************************************"); + + for (int i = 0; i < hillStations.size(); i++) { + Places.Place place = hillStations.get(i); + + System.out.println((i + 1) + ". " + place.getDestination()); // Display destination name + + System.out.println("Attractions:"); + for (String attraction : place.getAttractions()) { + if (attraction != null) { // Check for null values + System.out.println("- " + attraction); // Display each attraction + } + } + + System.out.println(); // Add a blank line for readability + } + + // Step 3: User selects a hill station + System.out.println("Select a hill station by entering its number:"); + int choice = scanner.nextInt(); + scanner.nextLine(); // Consume newline character + + if (choice < 1 || choice > hillStations.size()) { // Validate the choice + System.out.println("Invalid selection. Please choose a valid number."); + } else { + // Step 4: Display selected hill station with its attractions + Places.Place selectedPlace = hillStations.get(choice - 1); // Adjust for 1-based index + System.out.println("----------------------------------------"); + System.out.println("\nYou selected : " + selectedPlace.getDestination()); + + System.out.println("Attractions at " + selectedPlace.getDestination() + ":"); + for (String attraction : selectedPlace.getAttractions()) { + if (attraction != null) { + System.out.println("- " + attraction); // Display attraction + } + + } + System.out.println("----------------------------------------"); + } + System.out.println("Press ENTER to continue...."); + scanner.nextLine(); + clearScreen(); + + Packages.addPackages(); + Packages.displayPackages(); + + + System.out.println("\nSelect the package number you want to book:"); + int packageChoice = scanner.nextInt(); + scanner.nextLine(); + + if (packageChoice < 1 || packageChoice > 6) { + System.out.println("Invalid package selection."); + } else { + Packages.Package selectedPackage = Packages.allPackages[packageChoice - 1]; + booking.addPackage(selectedPackage); + } + + // Create a bill based on the booking + Bill bill = new Bill(booking); + + System.out.println("Press ENTER to continue...."); + scanner.nextLine(); + clearScreen(); + + System.out.println("****************************************"); + System.out.println("\tDISCOUNTS"); + System.out.println("****************************************"); + System.out.println("\nDiscounts available :\n 1. couples discount -> 10% \n 2.group discount -> 7% for groups with 5+ members \n 3.brithday/anniversary discount -> 5% \n 4.senior citizen discount -> 5% "); + System.out.println("\nEnter option number if applicable(0 if not applicable) : "); + int ch=scanner.nextInt(); + switch(ch) + { case(1): + bill.couple(booking); + break; + + case (2): + bill.group(booking); + break; + case (3): + bill.bday_anvys(); + break; + case (4): + bill.srctz(); + break; + default: + System.out.println("Oops, No discount. "); + } + + System.out.println("----------------------------------------"); + System.out.println("\nTotal Bill Amount: Rs."+bill.getTotal()); + System.out.println("----------------------------------------"); + + System.out.println("Press ENTER to continue...."); + scanner.nextLine(); + clearScreen(); + + System.out.println("\n******************************************"); + System.out.println("Choose method of payment: (0 = card / 1 = UPI)"); + System.out.println("*********************************************"); + int paymentMethod = scanner.nextInt(); + + if (paymentMethod == 1) { + System.out.println("Enter UPI ID:"); + String upi = scanner.next(); + + System.out.println("Enter the 4-digit passcode:"); + int passcode = scanner.nextInt(); + + System.out.println("Are you sure you want to proceed? (0 = yes / 1 = no)"); + int proceed = scanner.nextInt(); + + if (proceed == 0) { + System.out.println("-------------------------------------"); + System.out.println("\tPAYMENT SUCCESSFUL"); + System.out.println("-------------------------------------"); + System.out.println("A confirmation with booking details will be emailed to you."); + System.out.println("**Thank You**"); + } else { + System.out.println("Payment Cancelled"); + } + } else if (paymentMethod == 0) { + System.out.println("Enter card number:"); + long cardNumber = scanner.nextLong(); + + System.out.println("Enter 4-digit OTP:"); + int otp = scanner.nextInt(); + + System.out.println("Are you sure you want to proceed? (0 = yes / 1 = no)"); + int proceed = scanner.nextInt(); + + if (proceed == 0) { + System.out.println("-------------------------------------"); + System.out.println("\tPAYMENT SUCCESSFUL"); + System.out.println("-------------------------------------"); + System.out.println("A confirmation with booking details will be emailed to you."); + System.out.println("**Thank You**"); + } else { + System.out.println("Payment Cancelled"); + } + } else { + System.out.println("Invalid payment method."); + } + + scanner.close(); + } +} + From b2b83558a1bb7ff634b0683184539b948736c81c Mon Sep 17 00:00:00 2001 From: siddhi247 <152321352+siddhi247@users.noreply.github.com> Date: Tue, 30 Apr 2024 23:43:37 +0530 Subject: [PATCH 3/7] Create Packages.java --- Team25-TourismBooingSystem/Packages.java | 77 ++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 Team25-TourismBooingSystem/Packages.java diff --git a/Team25-TourismBooingSystem/Packages.java b/Team25-TourismBooingSystem/Packages.java new file mode 100644 index 0000000..d2b5606 --- /dev/null +++ b/Team25-TourismBooingSystem/Packages.java @@ -0,0 +1,77 @@ + +package tourismbooking; + +import java.util.*; +public class Packages { + Scanner scanner=new Scanner(System.in); + + static Package[] allPackages; + public static class Package { + String type; + String days; + int price; + String facilities; + + public Package(String type, String days, int price, String facilities) { + this.type = type; + this.days = days; + this.price = price; + this.facilities = facilities; + } + + @Override + public String toString() { + return "Type:" + type+ "\n-Days:" + days+ "\n-Price per person:" + price + "\n-Facilities:"+ facilities; + } + } + + public static void addPackages() { + allPackages = new Package[6]; + + + allPackages[0] = new Package("Basic", "3 days 4 nights", 3000, "Basic accommodation, breakfast, dinner, transportation"); + allPackages[1] = new Package("Standard", "3 days 4 nights", 6000, "Mid-range accommodation, breakfast, dinner, extra activities, transportation"); + allPackages[2] = new Package("Premium", "3 days 4 nights", 12000, "Luxury accommodation, gourmet meals, spa, tour guide, transportation"); + allPackages[3] = new Package("Basic", "6 days 7 nights", 5000, "Basic accommodation, breakfast, dinner, transportation"); + allPackages[4] = new Package("Standard", "6 days 7 nights", 10000, "Mid-range accommodation, breakfast, dinner, extra activities,transportation"); + allPackages[5] = new Package("Premium", "6 days 7 nights", 20000, "Luxury accommodation, gourmet meals, spa, tour guide, transportation"); + } + + public static void displayPackages() { + Scanner scanner=new Scanner(System.in); + if (allPackages == null) { + System.out.println("No packages available."); + return; + } + System.out.println("*************************************"); + System.out.println("\tAVAILABLE PACKAGES"); + System.out.println("*************************************"); + System.out.println("Select duration would you like to book : "); + System.out.println("1= 3 days 4 nights\n2= 6 days 7 nights"); + int choice=scanner.nextInt(); + switch(choice) { + + + case 1:{ + + for (int j=0;j<3;j++) { + System.out.println("\n"+(j+1)+"."+allPackages[j]); + + } + break; + + } + case 2: { + + for (int j=3;j<6;j++) { + System.out.println("\n"+(j+1)+"."+allPackages[j]); + + } + break; + } + + } + + } + +} From 190c387ce427131cea443b4cdd523da0992110d0 Mon Sep 17 00:00:00 2001 From: siddhi247 <152321352+siddhi247@users.noreply.github.com> Date: Tue, 30 Apr 2024 23:44:08 +0530 Subject: [PATCH 4/7] Create Person.java --- Team25-TourismBooingSystem/Person.java | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Team25-TourismBooingSystem/Person.java diff --git a/Team25-TourismBooingSystem/Person.java b/Team25-TourismBooingSystem/Person.java new file mode 100644 index 0000000..50667a7 --- /dev/null +++ b/Team25-TourismBooingSystem/Person.java @@ -0,0 +1,38 @@ +package tourismbooking; + +public class Person{ + + private String fname; + private String lname; + private int age; + private String aadhaar; + private char gender; + + public Person(String firstName, String lastName, int age, String aadhaar, char gender) { + this.fname = firstName; + this.lname = lastName; + this.age = age; + this.aadhaar = aadhaar; + this.gender = gender; + + } + public String getFirstName() { + return fname; + } + + public String getLastName() { + return lname; + } + + public int getAge() { + return age; + } + + public String getAadhaar() { + return aadhaar; + } + + public char getGender() { + return gender; + } + } From f8f23412801246347ccbbf4c89849287b156bfe1 Mon Sep 17 00:00:00 2001 From: siddhi247 <152321352+siddhi247@users.noreply.github.com> Date: Tue, 30 Apr 2024 23:44:30 +0530 Subject: [PATCH 5/7] Create Places.java --- Team25-TourismBooingSystem/Places.java | 82 ++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Team25-TourismBooingSystem/Places.java diff --git a/Team25-TourismBooingSystem/Places.java b/Team25-TourismBooingSystem/Places.java new file mode 100644 index 0000000..403ab1f --- /dev/null +++ b/Team25-TourismBooingSystem/Places.java @@ -0,0 +1,82 @@ +package tourismbooking; + +import java.util.ArrayList; + +public class Places { + // Inner class representing a place + public static class Place { + String destination; // Attribute for destination + String[] attractions; // Fixed-size array for attractions + int index = 0; + + // Constructor + public Place(String destination) { + this.destination = destination; // Initialize the destination + this.attractions = new String[3]; // Initialize the attractions array + } + + // Method to add an attraction + public void addAttraction(String attraction) { + if (index < 3) { // Check if there's room to add + attractions[index] = attraction; + index++; // Move to the next position + } else { + System.out.println("Cannot add more than three attractions."); + } + } + + // Method to get all attractions + public String[] getAttractions() { + return attractions; + } + + // Method to get the destination + public String getDestination() { + return destination; + } + } + + // List to store hill stations (places) + private static ArrayList hillStations = new ArrayList<>(); + + // Static method to add places + public static void addHillStations() { + // Create five hill stations + Place hillStation1 = new Place("Manali"); + hillStation1.addAttraction("Solang Valley"); + hillStation1.addAttraction("Rohtang Pass"); + hillStation1.addAttraction("Hadimba Temple"); + + Place hillStation2 = new Place("Shimla"); + hillStation2.addAttraction("The Ridge"); + hillStation2.addAttraction("Mall Road"); + hillStation2.addAttraction("Jakhoo Temple"); + + Place hillStation3 = new Place("Ooty"); + hillStation3.addAttraction("Botanical Gardens"); + hillStation3.addAttraction("Ooty Lake"); + hillStation3.addAttraction("Doddabetta Peak"); + + Place hillStation4 = new Place("Darjeeling"); + hillStation4.addAttraction("Tiger Hill"); + hillStation4.addAttraction("Batasia Loop"); + hillStation4.addAttraction("Padmaja Naidu Himalayan Zoological Park"); + + Place hillStation5 = new Place("Nainital"); + hillStation5.addAttraction("Naini Lake"); + hillStation5.addAttraction("Naina Peak"); + hillStation5.addAttraction("Tiffin Top"); + + // Add the hill stations to the list + hillStations.add(hillStation1); + hillStations.add(hillStation2); + hillStations.add(hillStation3); + hillStations.add(hillStation4); + hillStations.add(hillStation5); + } + + // Method to get all hill stations + public static ArrayList getHillStations() { + return hillStations; + } +} From 1538d40cd2b01887d354e4284246d324ab302148 Mon Sep 17 00:00:00 2001 From: siddhi247 <152321352+siddhi247@users.noreply.github.com> Date: Tue, 30 Apr 2024 23:44:53 +0530 Subject: [PATCH 6/7] Create Bill.java --- Team25-TourismBooingSystem/Bill.java | 95 ++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 Team25-TourismBooingSystem/Bill.java diff --git a/Team25-TourismBooingSystem/Bill.java b/Team25-TourismBooingSystem/Bill.java new file mode 100644 index 0000000..02bb8e0 --- /dev/null +++ b/Team25-TourismBooingSystem/Bill.java @@ -0,0 +1,95 @@ +package tourismbooking; + +import java.util.*; + +// Assuming Booking is defined in the same package +public class Bill { + private double total; // To store the total bill amount + + // Constructor to create a bill from a booking + + public Bill(Booking booking) { + + // Simple calculation based on the number of persons + this.total = booking.getNoOfPersons() * booking.selectedPackage.price; + // Calculate the total bill + } + public void bday_anvys() + { Scanner sc= new Scanner(System.in); + System.out.println("Does anybody in your group have birthday or anniversary during tour? (only one date can be used) , enter y for yes"); + char ch=sc.nextLine().charAt(0); + + + if (ch=='y') + { System.out.println("CONGRATULATIONS!!! you get an additional 5% discount on your bill !"); + System.out.println("Enter birth date of said person, format = DD/MM/YYYY(It will be verified on spot during check in, a fine will be implied if false information provided)"); + String bdate= sc.nextLine(); + total = total - (0.05*total); + System.out.println("You saved : Rs."+0.05*total); + } + else + System.out.println("Sorry. No discount."); + + + System.out.println("Your bill (excluding taxes) comes out to be:" + total); + + } + public void srctz() + { Scanner sc= new Scanner(System.in); + System.out.println("Is any senior citizen , age greater than or equal to 75 in your group?, enter y for yes : "); + char ch=sc.nextLine().charAt(0); + + + if (ch=='y') + { System.out.println("CONGRATULATIONS!!! you get an additional 5% discount on your bill !"); + System.out.println("Enter age of said person(It will be verified on spot during check in, a fine will be implied if false information provided)"); + String bdate= sc.nextLine(); + total= total - (0.05*total); + System.out.println("You saved Rs: "+0.05*total); + } + else + System.out.println("Sorry. No discount."); + + System.out.println("Your bill (excluding taxes) comes out to be:" +total); + + } + public void couple(Booking booking) + { Scanner sc= new Scanner(System.in); + if (booking.getNoOfPersons()==2) + { System.out.println("CONGRATULATIONS!!! you get an additional 10% discount on your bill !"); + total= total - (0.10*total); + System.out.println("You saved : Rs."+0.10*total); + } + else + System.out.println("Sorry. No discount."); + System.out.println("Your bill (excluding taxes) comes out to be:" +total); + + } + public void group(Booking booking) + { + if (booking.getNoOfPersons()>5) + { System.out.println("CONGRATULATIONS!!! you get an additional 7% discount per person on your bill !"); + + total= total - (0.07*total); + System.out.println("You saved : Rs."+0.07*total); + + } + else + System.out.println("Sorry. No discount."); + + + System.out.println("Your bill (excluding taxes) comes out to be:" +total); + + + + } + public double getTotal() { + System.out.println("GST (18%) : "+0.18*total); + return total + 0.18*total; // Return the total bill + } + + @Override + public String toString() { + return "Total Bill: " + total; + } +} From 0b3d54c4cf46222ad59517520f1d9c55a8721bff Mon Sep 17 00:00:00 2001 From: siddhi247 <152321352+siddhi247@users.noreply.github.com> Date: Tue, 30 Apr 2024 23:54:14 +0530 Subject: [PATCH 7/7] Create README.md --- Team25-TourismBooingSystem/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Team25-TourismBooingSystem/README.md diff --git a/Team25-TourismBooingSystem/README.md b/Team25-TourismBooingSystem/README.md new file mode 100644 index 0000000..f47d49f --- /dev/null +++ b/Team25-TourismBooingSystem/README.md @@ -0,0 +1,18 @@ +Team N0. 25 +Team name- Team BBC + +Team Members: +-Siddhi Chaudhari (FY E&TC) +-Arpita Barjibhe (FY Comp) +-Maitreyee Badgire (FY Mech) + +Theme: Tourism +Problem Statement: Design and implement a program that automates the tourism package booking process for a travel agency. + +Links for reports: +Report 1: +https://docs.google.com/document/d/1VJ69pqeiYEoA2vU878k07cvAYZNDkuJ1Oj0_sOA-7kU/edit +Report 2: +https://docs.google.com/document/d/1zgkuorFIZpd3cQJna8MP-X8KYuofWhGZJ9mPvyMlPRQ/edit?usp=sharing +Video Link: +https://drive.google.com/drive/folders/15V27L_Lp6DyGbzCSGZ2_4DOuT0lQhtWP?usp=drive_link