Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by Anatoliy on 10.07.2016.
- * Task 5.1.4
- */
- import java.util.Scanner;
- public class Task8 {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- String planetName = null;
- double weight = in.nextDouble();
- System.out.println("1. Mercury");
- System.out.println("2. Venus");
- System.out.println("3. Mars");
- System.out.println("4. Jupiter");
- System.out.println("5. Saturn");
- System.out.println("6. Uranus");
- System.out.println("7. Neptune");
- int num = in.nextInt();
- if (num == 1) {
- weight = weight * 0.38;
- planetName = "Меркурий";
- }
- if (num == 2) {
- weight = weight * 0.91;
- planetName = "Венера";
- }
- if (num == 3) {
- weight = weight * 0.38;
- planetName = "Марсе";
- }
- if (num == 4) {
- weight = weight * 2.36;
- planetName = "Юпитер";
- }
- if (num == 5) {
- weight = weight * 0.92;
- planetName = "Сатурн";
- }
- if (num == 6) {
- weight = weight * 0.89;
- planetName = "Уран";
- }
- if (num == 7) {
- weight = weight * 1.13;
- planetName = "Нептун";
- }
- System.out.println("На пленете " + planetName + " ваш вес будет равен " + weight + "кг");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement