ROCODE
ROCODE
println("PhilHealth: " +
philhealthDeduction);
8
System.out.println("Total Deductions: " +
totalDeductions);
System.out.println("\nyour amount: " + netPay);
}
}
import java.util.Scanner; int finalPrice = price;
2
public class Main { if (vipChoice.equals("yes")) {
public static void main(String[] args) { finalPrice += 200;
Scanner scanner = new Scanner(System.in); }
if (choice < 1 || choice > MovieNames.length) { UIFruits(String concertName, int price, String time,
String date) {
System.out.println("Invalid choice.");
this.concertName = concertName;
return;
this.price = price;
}
this.time = time;
String MovieName = MovieNames[choice - 1];
this.date = date;
int price = prices[choice - 1];
}
String time = times[choice - 1];
void displayDetails() {
String date = dates[choice - 1];
System.out.println("Movie: " + concertName);
}
System.out.print("\nIf you want VIP? (yes or no): ");
}
String vipChoice = scanner.next().toLowerCase();
package main; displayMovieDetails(e4); 3
System.out.print("\nWould you want to select another if (hours >= 1 && hours <= 2) {
patient? (yes/no): "); System.out.println("Category 1: Self-care (1 to 2
van.nextLine();
System.out.println("Category 4: Modified intensive } else if (age >= 12 && age <= 14) {
care (7 to 8 hours)");
System.out.println("Age Group: Primary School
} else if (hours <= 10) { Boy");
System.out.println("Category 5: Intensive care (up } else if (age >= 18 && age <= 25) {
to 10 hours)");
System.out.println("Age Group:
} Adolescent/Teenager");
} } else if (age >= 30 && age <= 35) {
System.out.println("Age Group: Adult");
void billingWithDiscount() { } else if (age >= 40 && age <= 55) {
Scanner scanner = new Scanner(System.in); System.out.println("Age Group: Middle
System.out.print("Is the patient a PWD or Senior adulthood");
Citizen? (yes/no): ");
} else if (age >= 60 && age <= 70) {
String isDiscounted =
System.out.println("Age Group: Old Person");
scanner.nextLine().toLowerCase();
} else {
int rate = roomType.equalsIgnoreCase("Private") ?
1000 : 400; System.out.println("Age Group: Unidentified");
int totalCost = rate * hours; }
if (isDiscounted.equals("yes")) { }
double discount = totalCost * 0.20;
} else {
}
package main; System.out.println("4. Close/Exit");
5
import java.util.Scanner; System.out.print("Enter your choice: ");
public class Main { int choice = user.nextInt();
public static void main(String[] args) { if (choice < 1075376987 || choice >
1075376991) {
Scanner user = new Scanner(System.in);
System.out.println("Invalid input\n");
System.out.println("~~~~Welcome to BDO San
Mateo~~~"); continue;
System.out.println("Branch Number: 1234579"); }
System.out.println("Branch Address: Ampid Uno, switch (choice) {
San Mateo, Rizal");
case 1:
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
System.out.print("\nEnter amount to
~~");
withdraw: Php ");
System.out.println("\n97629 Kathryn Bernardo\
int withdrawAmount = user.nextInt();
n74927 Enn Botardo\n73619 Yunna Labbao");
if (withdrawAmount >
System.out.print("Enter the Account Number: ");
selectedAccount.getAmount()) {
int accnum = user.nextInt();
System.out.println("Insufficient
acc selectedAccount = null; balance.");
if (accnum == 97629) { continue;
selectedAccount = new acc("\nKathryn } else {
Bernardo", "May 14, 2005", 3976, 97629, "Kathryn",
selectedAccount.withdraw(withdrawAmount);
"12345", "[email protected]", 1000);
System.out.println("Withdrawal
} else if (accnum == 74927) {
successful. Updated balance: Php " +
selectedAccount = new acc("\nEnn Botardo", selectedAccount.getAmount());
"July 30, 2007", 4782, 74927, "Enn", "38626",
}
"[email protected]", 5000);
break;
} else if (accnum == 73619) {
case 2:
selectedAccount = new acc("\nYunna Labbao",
"July 9, 2007", 8652, 73619, "Yunna", "07526", System.out.print("\nEnter amount to
"[email protected]", 1200); deposit: Php ");
} else { int depositAmount = user.nextInt();
System.out.println("No fund user with this selectedAccount.deposit(depositAmount);
account number.");
System.out.println("Deposit successful.
return; Updated balance: Php " +
selectedAccount.getAmount());
}
break;
System.out.println("\nAccount Details:");
case 3:
System.out.println(selectedAccount);
System.out.println("\nYour current balance
while (true) {
is: Php " + selectedAccount.getAmount());
System.out.println("\nSelect a Transaction:");
break;
System.out.println("1. Withdraw");
case 4:
System.out.println("2. Deposit");
System.out.println("\nThank you for
System.out.println("3. Check Balance"); banking with BDO San Mateo. Have a great day!");
return;
default: 5
System.out.println("\nInvalid choice. Please "Birth Date: " + birthDate + "\n" +
try again.");
"Card Number: " + cardNumber + "\n" +
}
"Account Number: " + accountNumber + "\n" +
} "User Name: " + uusername + "\n" +
} "Password: " + password + "\n" +
} "Email: " + email + "\n" +
private int cardNumber; "Amount: Php" + amount + "\n";
private int accountNumber; }
} void displayPay() {
double totalSalary = calculateTotalSalary();
@Override
} package main; 8
7
package main; import java.util.Scanner;
}
case 2: case 2:
break; break;
default:
case 1:
System.out.println("Invalid input! Please try
paymentMethod = "Cash";
again.");
break;
}
case 2:
}
paymentMethod = "Card Payment";
return room;
break;
}
default: }
System.out.println("Invalid input! Please try package main;
again.");
public class room {
}
private String type;
}
private double price;
System.out.println("\nPayment Method: " +
paymentMethod); public room(String type, double price) {
this.type = type;
System.out.println("Thank you for staying with us!
Come back again!"); this.price = price;
scanner.close(); }
while (true) { }
} }
break;
case 2:
amenities.add(new Gym());
System.out.println("2. Peach Mango Pie - 80.00"); }
6
System.out.println("3. Coke Float - 90.00"); private static double getValidPayment(Scanner
scanner, double totalCost) {
System.out.println("0. Receipt");
while (true) {
while (true) {
System.out.print("\nEnter payment amount: ");
System.out.print("Enter choice: ");
try {
int choice = getValidInteger(scanner);
double payment = scanner.nextDouble();
switch (choice) {
if (payment >= totalCost) return payment;
case 1: return new Desserts("Sundae", 100.0,
getQuantity(scanner, "Sundae")); System.out.println("Insufficient amount.
Please enter again.");
case 2: return new Desserts("Peach Mango
Pie", 80.0, getQuantity(scanner, "Peach Mango Pie")); } catch (InputMismatchException e) {
} return quantity;
}
package main; public double computeTotal() { 6
food = getFoodChoice(scanner); }