0% found this document useful (0 votes)
7 views7 pages

2

sadadasdaw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views7 pages

2

sadadasdaw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

package javaapplication11;

import java.util.Scanner;
public class JavaApplication11 {

public static void main(String[] args) {


Scanner scan = new Scanner(System.in);
System.out.print("Would you like to book or shop at our store? (SHOP/BOOK):
");
String deci = scan.next().toUpperCase();
switch(deci){
case "BOOK":
{
appointment();
break;
}
case "SHOP":
{
shop();
break;
}
default:
{
System.out.println("Invalid Choice!");
}
}
}
public static void shop(){
Scanner scan = new Scanner(System.in);
int totalItems = 0;
while (true) {
System.out.println("\nWelcome! Please select the category of the items
you would like to purchase.");
System.out.println("1. Food");
System.out.println("2. Grooming Supplies");
System.out.println("3. Toys");
System.out.println("4. Basic Pet Supplies");
System.out.println("5. First Aid and Hygiene Supplies");
System.out.println("6. Exit");
System.out.print("Enter your choice: ");
String choice = scan.nextLine();

switch (choice) {
case "1":
System.out.println("You selected Food. Available items:");
System.out.println("a. Dog Food");
System.out.println("b. Cat Food");
System.out.println("c. Bird Food");
System.out.print("Choose an item (a/b/c): ");
char foodChoice = scan.nextLine().charAt(0);
if (foodChoice == 'a' || foodChoice == 'b' || foodChoice ==
'c') {
System.out.println("Item added to cart!");
totalItems++;
} else {
System.out.println("Invalid choice.");
}
break;
case "2":
System.out.println("You selected Grooming Supplies. Available
items:");
System.out.println("a. Shampoo");
System.out.println("b. Brush");
System.out.println("c. Nail Clippers");
System.out.print("Choose an item (a/b/c): ");
char groomingChoice = scan.nextLine().charAt(0);
if (groomingChoice == 'a' || groomingChoice == 'b' ||
groomingChoice == 'c') {
System.out.println("Item added to cart!");
totalItems++;
} else {
System.out.println("Invalid choice.");
}
break;

case "3":
System.out.println("You selected Toys. Available items:");
System.out.println("a. Chew Toy");
System.out.println("b. Ball");
System.out.println("c. Squeaky Toy");
System.out.print("Choose an item (a/b/c): ");
char toysChoice = scan.nextLine().charAt(0);
if (toysChoice == 'a' || toysChoice == 'b' || toysChoice ==
'c') {
System.out.println("Item added to cart!");
totalItems++;
} else {
System.out.println("Invalid choice.");
}
break;

case "4":
System.out.println("You selected Basic Pet Supplies. Available
items:");
System.out.println("a. Collar");
System.out.println("b. Leash");
System.out.println("c. Bowl");
System.out.print("Choose an item (a/b/c): ");
char suppliesChoice = scan.nextLine().charAt(0);
if (suppliesChoice == 'a' || suppliesChoice == 'b' ||
suppliesChoice == 'c') {
System.out.println("Item added to cart!");
totalItems++;
} else {
System.out.println("Invalid choice.");
}
break;

case "5":
System.out.println("You selected First Aid and Hygiene
Supplies. Available items:");
System.out.println("a. Bandages");
System.out.println("b. Antiseptic");
System.out.println("c. Wet Wipes");
System.out.print("Choose an item (a/b/c): ");
char hygieneChoice = scan.nextLine().charAt(0);
if (hygieneChoice == 'a' || hygieneChoice == 'b' ||
hygieneChoice == 'c') {
System.out.println("Item added to cart!");
totalItems++;
} else {
System.out.println("Invalid choice.");
}
break;

case "6":
System.out.println("Thank you for shopping with us!");
System.out.println("Total items in your cart: " + totalItems);
System.out.println("Goodbye!");
scan.close();
return;

default:
System.out.println("Invalid choice. Please try again.");
}
}
}
public static void appointment(){
Scanner scan = new Scanner(System.in);
System.out.println("Hello, this is Paws Vet Clinic. Book an appppointment
with us!\nWe are open Mondays through Thursdays, 8:00am to 5:00pm.");
System.out.println(" ");
System.out.println("If you'd like to book an appointment press [A]");

System.out.println("If you'd like to cancel booking press [X]");

System.out.print("Type your decision here: ");


String dec = scan.next().toUpperCase();

int groom = 500;


int vaccine= 400;
int check=700;
int ag=300;
int av=400;
int aav = 100;

switch(dec)
{
case "A":
{
System.out.print("What kind of pet do you have?(dog, cat): ");
String pet = scan.next().toUpperCase();

switch (pet) {
case "DOG":
{
System.out.print("What is the breed of your pet?: ");
String breed = scan.next().toUpperCase();
System.out.print("How old is your pet?: ");
int age = scan.nextInt();
System.out.print("Please choose a procedure (groom, checkup,
vaccination):");
String procedure = scan.next().toUpperCase();
switch (procedure) {
case "GROOM":
System.out.println("You have selected grooming services.");
System.out.print("Would you like parasite control service included?
There would be an additional 300php in your balance. (yes/no): ");
String pc = scan.next().toLowerCase();
int tp = 0;

if (pc.equals("yes")) {
System.out.println("Parasite Control will be included in the
grooming.");tp = groom + ag;

} else {
System.out.println("Only grooming will be provided.");tp=groom;

}
System.out.println("");
System.out.println("Here's the information about your
appointment:");

System.out.println("PET: " + pet);


System.out.println("BREED: "+ breed);
System.out.println("AGE: "+age);

System.out.println("PROCEDURE: " + procedure);


System.out.println("Total price: " + tp );
break;

case "CHECKUP":
System.out.println("You have selected a routine check-up.");
System.out.print("Do you want to include vaccinations during the
check-up? There would be an additional 400php in your balance.(yes/no):");
String vaccination = scan.next().toLowerCase();
int p = 0;

if (vaccination.equals("yes")) {
System.out.println("Vaccinations will be administered during
the check-up.");p= check + av;

} else {
System.out.println("Only the check-up will be performed.");p =
check;
}
System.out.println("");
System.out.println("Here's the information about your
appointment:");

System.out.println("PET: " + pet);


System.out.println("BREED: "+ breed);
System.out.println("AGE: "+age);

System.out.println("PROCEDURE: " + procedure);


System.out.println("Total price: " + p );
break;

case "VACCINATION":
System.out.println("You have selected vaccination services.");
System.out.print("Is this for a specific vaccine? (yes/no):");
String specificDisease = scan.next().toLowerCase();
int t = 0;

if (specificDisease.equals("yes")) {
System.out.print("Please specify the vaccine (CPV, FPV, etc.):
");
String vac = scan.next();
System.out.println("Preparing vaccination for " + vac +
".");t=vaccine+aav;

} else {
System.out.println("Administering standard
vaccinations.");t=vaccine;
}
System.out.println("");
System.out.println("Here's the information about your
appointment:");

System.out.println("PET: " + pet);


System.out.println("BREED: "+ breed);
System.out.println("AGE: "+age);

System.out.println("PROCEDURE: " + procedure);


System.out.println("Total price: " + t );

break;

}
break;
}
case "CAT":
{
System.out.print("What is the breed of your pet?: ");
String breed = scan.next().toUpperCase();
System.out.print("How old is your pet?: ");
int age = scan.nextInt();
System.out.print("Please choose a procedure (groom, check-up,
vaccination):");
String procedure = scan.next().toLowerCase();

switch (procedure) {
case "GROOM":
System.out.println("You have selected grooming services.");
System.out.print("Would you like parasite control service included?
There would be an additional 300php in your balance. (yes/no): ");
String pc = scan.next().toLowerCase();
int tp = 0;

if (pc.equals("yes")) {
System.out.println("Parasite Control will be included in the
grooming.");tp = groom + ag;

} else {
System.out.println("Only grooming will be provided.");tp=groom;
}
System.out.println("");
System.out.println("Here's the information about your
appointment:");

System.out.println("PET: " + pet);


System.out.println("BREED: "+ breed);
System.out.println("AGE: "+age);

System.out.println("PROCEDURE: " + procedure);


System.out.println("Total price: " + tp );
break;

case "CHECKUP":
System.out.println("You have selected a routine check-up.");
System.out.print("Do you want to include vaccinations during the
check-up? There would be an additional 400php in your balance.(yes/no):");
String vaccination = scan.next().toLowerCase();
int p = 0;

if (vaccination.equals("yes")) {
System.out.println("Vaccinations will be administered during
the check-up.");p= check + av;

} else {
System.out.println("Only the check-up will be performed."); p =
check;
}
System.out.println("");
System.out.println("Here's the information about your
appointment:");

System.out.println("PET: " + pet);


System.out.println("BREED: "+ breed);
System.out.println("AGE: "+age);

System.out.println("PROCEDURE: " + procedure);


System.out.println("Total price: " + p );
break;

case "VACCINATION":
System.out.println("You have selected vaccination services.");
System.out.print("Is this for a specific vaccine? (yes/no):");
String specificDisease = scan.next().toLowerCase();
int t = 0;

if (specificDisease.equals("yes")) {
System.out.print("Please specify the vaccine (CPV, FPV, etc.):
");
String vac = scan.next();t=vaccine;
System.out.println("Preparing vaccination for " + vac + ".");
t=vaccine+aav;

} else {
System.out.println("Administering standard vaccinations.");
t=vaccine;
}
System.out.println("");
System.out.println("Here's the information about your
appointment:");

System.out.println("PET: " + pet);


System.out.println("BREED: "+ breed);
System.out.println("AGE: "+age);

System.out.println("PROCEDURE: " + procedure);


System.out.println("Total price: " + t );
break;

default:
System.out.println(" ");
System.out.println("Thank you for your inquiry! Unfortunately, we do
not provide services for all pet types. We specialize in certain animals, so we
recommend reaching out to a clinic that can better meet your needs. \nIf you have
any other questions or need assistance, feel free to ask!");
break;
}

}
}
break;

}
case "X":
{
System.out.println("You've successfully canceled your booking.");
}

default:
{
System.out.println("Thank you so much.");

}
}
}

You might also like