Advertisement
Guest User

Untitled

a guest
Apr 4th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Zad3 {
  4.     void wczytanie() {
  5.         Scanner sc = new Scanner(System.in);
  6.  
  7.         System.out.println("podaj A - liczbe calkowita ");
  8.         double a = sc.nextDouble();
  9.         System.out.println("podaj B - liczbe calkowita ");
  10.         double b = sc.nextDouble();
  11.         new Zad3().sprawdzenie(a, b);
  12.         new Zad3().jakiMaZnak(a,b);
  13.     }
  14.  
  15.     void sprawdzenie(double a, double b) {
  16.         if (a < b) {
  17.             System.out.println("liczba B jest większa od A");
  18.         }
  19.         else if (b > a) {
  20.             System.out.println("liczba A jest wieksza od B");
  21.         }
  22.         else {
  23.             System.out.println("liczby są równe");
  24.             }
  25.         }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement