Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package jan25lec;
- import java.util.Scanner;
- public class fruit {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- String input = scan.nextLine();
- boolean isFruit = input.equals("apple") || input.equals("banana") || input.equals("lemon") || input.equals("kiwi") || input.equals("grapes");
- boolean isVegetable = input.equals("cucumber") || input.equals("pepper") || input.equals("carrot");
- if (isFruit) {
- System.out.println("Fruit");
- }else if (isVegetable) {
- System.out.println("Vegetable");
- } else
- System.out.println("Unknown");
- }
- }
- package jan25lec;
- import java.util.Scanner;
- //public class lab11 {
- // public static void main(String[] args) {
- // Scanner scanner = new Scanner(System.in);
- //
- // int daysCount = Integer.parseInt(scanner.nextLine());
- // String roomType = scanner.nextLine();
- // String feedback = scanner.nextLine();
- //
- // int nightsCount = daysCount - 1;
- // double price = 0;
- //
- // switch (roomType) {
- // case "room for 1 person"
- // price = 18;
- // break;
- // case "apartment"
- // price = 25;
- // if (nightsCount < 10) {
- // price = price * 0.7;
- // }else if (nightsCount < 15) {
- // price = price * 0.65;
- // }else
- // price = price * 0.5;
- // case "president suite"
- // price = 35;
- // if (nightsCount < 10) {
- // price = price * 0.9;
- // }else if (nightsCount < 15) {
- // //not finished
- // }
- //
- // double totalPrice = price * nightsCount;
- // if (feedback.equals("positive")) {
- // totalPrice = price * nightsCount;
- // }
- // }
- // }
- //}
- package jan26upr;
- import java.util.Scanner;
- public class upr1 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double x1 = Double.parseDouble(scanner.nextLine());
- double y1 = Double.parseDouble(scanner.nextLine());
- double x2 = Double.parseDouble(scanner.nextLine());
- double y2 = Double.parseDouble(scanner.nextLine());
- double x = Double.parseDouble(scanner.nextLine());
- double y = Double.parseDouble(scanner.nextLine());
- boolean firstCondition = false;
- boolean secondCondition = false;
- if ((x == x1) || (x == x2) && (y >= y1) && (y <= y2)) {
- firstCondition = true;
- }else if (((y == x1) || (y == x2) && (y >= y1) && (y <= y2))) {
- secondCondition = true;
- }
- if (firstCondition || secondCondition) {
- System.out.println("Border");
- }else {
- System.out.println("Inside/Outside");
- }
- }
- }
- package jan26upr;
- import java.util.Scanner;
- public class kino {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String type = scanner.nextLine();
- int rows = Integer.parseInt(scanner.nextLine());
- int columns = Integer.parseInt(scanner.nextLine());
- double revenue = 0;
- if (type.equals("Premiere")) {
- revenue = rows * columns * 12;
- }else if (type.equals("Normal")) {
- revenue = rows * columns * 7.5;
- }else if (type.equals("Discount")) {
- revenue = rows * columns * 5;
- }
- System.out.printf("%.2f leva", revenue);
- }
- }
- package jan26upr;
- import java.util.Scanner;
- public class summerclothes {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int degrees = Integer.parseInt(scanner.nextLine());
- String timeOfDay = scanner.nextLine();
- String outfit = "None";
- String shoes = "None";
- if ((degrees >= 10 && degrees <= 18)) {
- if (timeOfDay.equals("Morning")) {
- outfit = "Sweatshirt";
- shoes = "Sneakers";
- }else if (timeOfDay.equals("Afternoon")) {
- outfit = "Shirt";
- shoes = "Mocassins";
- }else if (timeOfDay.equals("Evening"))
- outfit = "Shirt";
- shoes = "Mocassins";
- }
- if ((degrees > 18 && degrees <= 24)) {
- if (timeOfDay.equals("Morning")) {
- outfit = "Shirt";
- shoes = "Mocassins";
- }else if (timeOfDay.equals("Afternoon")) {
- outfit = "T-Shirt";
- shoes = "Sandals";
- }else if (timeOfDay.equals("Evening"))
- outfit = "Shirt";
- shoes = "Mocassins";
- }
- if ((degrees >= 25)) {
- if (timeOfDay.equals("Morning")) {
- outfit = "T-Shirt";
- shoes = "Sandals";
- }else if (timeOfDay.equals("Afternoon")) {
- outfit = "Swim suit";
- shoes = "Barefoot";
- }else if (timeOfDay.equals("Evening"))
- outfit = "Shirt";
- shoes = "Mocassins";
- }
- System.out.printf("It's %d degrees, get your %s and %s.", degrees, outfit, shoes);
- }
- }
- package jan26upr;
- import java.util.Scanner;
- public class summerclothes {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int degrees = Integer.parseInt(scanner.nextLine());
- String timeOfDay = scanner.nextLine();
- String outfit = "None";
- String shoes = "None";
- if ((degrees >= 10 && degrees <= 18)) {
- if (timeOfDay.equals("Morning")) {
- outfit = "Sweatshirt";
- shoes = "Sneakers";
- }else if (timeOfDay.equals("Afternoon")) {
- outfit = "Shirt";
- shoes = "Mocassins";
- }else if (timeOfDay.equals("Evening"))
- outfit = "Shirt";
- shoes = "Mocassins";
- }
- if ((degrees > 18 && degrees <= 24)) {
- if (timeOfDay.equals("Morning")) {
- outfit = "Shirt";
- shoes = "Mocassins";
- }else if (timeOfDay.equals("Afternoon")) {
- outfit = "T-Shirt";
- shoes = "Sandals";
- }else if (timeOfDay.equals("Evening"))
- outfit = "Shirt";
- shoes = "Mocassins";
- }
- if ((degrees >= 25)) {
- if (timeOfDay.equals("Morning")) {
- outfit = "T-Shirt";
- shoes = "Sandals";
- }else if (timeOfDay.equals("Afternoon")) {
- outfit = "Swim suit";
- shoes = "Barefoot";
- }else if (timeOfDay.equals("Evening"))
- outfit = "Shirt";
- shoes = "Mocassins";
- }
- System.out.printf("It's %d degrees, get your %s and %s.", degrees, outfit, shoes);
- }
- }
- package jan25lec;
- import java.util.Scanner;
- public class numberinrange {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int number = Integer.parseInt(scan.nextLine());
- boolean isTrue = number >= -100 && number < 100 && number !=0;
- if (isTrue)
- System.out.println("Yes");
- else
- System.out.println("No");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement