Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.PrintWriter;
- import java.util.Objects;
- import java.util.Scanner;
- /**
- * Created by Kamil on 18.02.2017.
- */
- public class JestProgress {
- public static int menu() {
- System.out.println(" ****************************************");
- System.out.println(" * JEST PROGRESS *");
- System.out.println(" ****************************************");
- System.out.println("1. Nowy Uzytkownik");
- System.out.println("2. Wyswietl dane");
- System.out.println("3. Zaloguj sie");
- System.out.println("0. Wyjscie");
- Scanner in = new Scanner(System.in);
- int w = in.nextInt();
- return w;
- }
- public static void main(String[] args) throws FileNotFoundException {
- int choice = menu();
- while (choice != 0) {
- Scanner in = new Scanner(System.in);
- User newuser = new User();
- String login1;
- int password1;
- switch (choice) {
- case 1:
- newuser.userdata();
- break;
- case 2:
- ControlPanel.show();
- break;
- case 3:
- System.out.print("Podaj login:");
- login1 = in.next();
- System.out.print("Podaj haslo:");
- password1 = in.nextInt();
- if (newuser.login == login1 && newuser.password == password1) {
- System.out.println("Zalogowales sie poprawnie.");
- }
- else {
- System.out.println("Niepoprawny login lub haslo, sprobuj ponownie.");
- }
- }
- choice = menu();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement