Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Volleyball {
- public static void main(String[] args) {
- Scanner console= new Scanner(System.in);
- String year = console.nextLine();
- double p = Double.parseDouble(console.nextLine());
- double h = Double.parseDouble(console.nextLine());
- double sofia = (48 - h) * 3/4 ;
- double holiday = p * 2/3;
- double total = sofia + h + holiday;
- double leap = total * 15/100;
- double total0 = total + leap;
- if (year.equals("leap")){
- System.out.println(Math.floor(total0));
- }else if(year.equals("normal")){
- System.out.println(Math.floor(total));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement