Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Hotelroom {
- public static void main(String[]args){
- Scanner scanner = new Scanner(System.in);
- String month = scanner.nextLine();
- int stay = Integer.parseInt(scanner.nextLine());
- double prizeSudio = 0;
- double prizeApart = 0;
- if ("May".equals(month) || ("October".equals(month))) {
- if (stay > 7 && stay<=14) {
- prizeSudio = stay * (50 * 0.95);
- prizeApart = stay * 65;
- } if (stay > 14) {
- prizeSudio = stay * (50 * 0.7);
- prizeApart = stay * (65 * 0.9);
- } else {
- prizeApart = stay * 50;
- prizeApart = stay * 65;
- }
- }
- if ("June".equals(month) || ("September".equals(month))) {
- if (stay > 14) {
- prizeSudio = stay * (75.20 * 0.8);
- prizeApart = stay * (68.70 * 0.9);
- } else {
- prizeSudio = stay * 75.20;
- prizeApart = stay * 68.70;
- }
- }
- if ("July".equals(month) || ("August".equals(month))) {
- if (stay > 14) {
- prizeSudio = stay * 76.00 ;
- prizeApart = stay * (77.00 * 0.9);
- } else {
- prizeSudio = stay * 76.00;
- prizeApart = stay * 77.00;
- }
- }
- System.out.printf("Apartment: %.2f lv.%n", prizeApart);
- System.out.printf("Studio: %.2f lv.", prizeSudio);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement