Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void menu(){
- String a, name, password;
- Boolean editor;
- InputStreamReader input = new InputStreamReader(System.in);
- BufferedReader reader = new BufferedReader(input);
- while(true){
- String message;
- //something --> mensagem a receber e analisar
- System.out.print("\nType login or register\n> ");
- a = reader.readLine();
- if(a.equals("login")){
- System.out.print("\nWhat is your username?\n> ");
- name = reader.readLine();
- System.out.print("\nWhat is your password?\n> ");
- password = reader.readLine();
- //verificar a info
- if (something.equals("no")){//informação errada
- System.out.println("\nWrong information, try again");
- continue;
- }
- else if (something.equals("yes")){
- System.out.println("\nStatus Logged | Welcome back to DropMusic");
- if(something.equals("yes")){
- editor = true;
- //c.setEditor(true);
- }
- else{
- editor = false;
- //c.setEditor(false);
- }
- //c.setUsername(name);
- }
- }
- else if(a.equals("register")){
- System.out.print("\nWhat is your username?\n> ");
- name = reader.readLine();
- System.out.print("\nWhat is your password? \n> ");
- password = reader.readLine();
- //verificar a info
- if (something.equals("no")){
- System.out.println("Username already exists, try again");
- continue;
- }
- else if (something.equals("yes")){
- System.out.println("\nStatus Subscribed | Welcome to DropMusic");
- //c.setUsername(name);
- }
- }
- else{
- System.out.println("Something went wrong, try again");
- continue;
- }
- }
- while(true){
- System.out.println("\n1- Search song");
- System.out.println("2- Details of an album");
- System.out.println("3- Details of an artist");
- System.out.println("4- Write a review of an album");
- System.out.println("5- Share with friends uploaded song");
- if (/*c.getEditor()*/) {
- System.out.println("6- Manage information");
- System.out.println("7- Make an user a new editor");
- }
- System.out.println("0- Logout");
- System.out.print("> ");
- Scanner sc = new Scanner(System.in);
- String num = sc.next();
- switch(num){
- case "1":
- System.out.println("\n1- Trough artist");
- System.out.println("2- Trough album");
- System.out.print("3- By song name\n> ");
- String aux1 = sc.next();
- String artist11 = "";
- switch(aux1){
- case "1":
- System.out.print("\nType artist's name:\n> ");
- artist11 = reader.readLine();
- //procurar artista
- if(something.equals("yes-artist")){
- System.out.print("\nChoose one song:\n> ");
- String song11 = reader.readLine();
- System.out.println("\n1- Duration");
- System.out.println("2- Composer");
- System.out.println("3- Lyrics");
- System.out.println("4- Upload");
- System.out.print("5- Download\n> ");
- String aux11 = reader.readLine();
- switch(aux11){
- case "1":
- //send message
- continue;
- case "2":
- //send message
- continue;
- case "3":
- //send message
- continue;
- case "4":
- //send message
- continue;
- case "5":
- //send message
- continue;
- default:
- continue;
- }
- }
- else{
- continue;
- }
- case "2":
- System.out.print("\nType album's name:\n> ");
- String album12 = reader.readLine();
- //procurar album
- if(something.equals("yes-album")){
- System.out.print("\nChoose one song:\n> ");
- String song12 = reader.readLine();
- System.out.println("\n1- Duration");
- System.out.println("2- Composer");
- System.out.println("3- Lyrics");
- System.out.println("4- Upload");
- System.out.print("5- Download\n> ");
- String aux12 = reader.readLine();
- switch(aux12){
- case "1":
- //send message
- continue;
- case "2":
- //send message
- continue;
- case "3":
- //send message
- continue;
- case "4":
- //send message
- continue;
- case "5":
- //send message;
- default:
- continue;
- }
- }
- else{
- continue;
- }
- case "3":
- System.out.print("\nType song's name:\n> ");
- String song13 = reader.readLine();
- System.out.println("\n1- Duration");
- System.out.println("2- Composer");
- System.out.println("3- Lyrics");
- System.out.println("4- Upload");
- System.out.print("5- Download\n> ");
- String aux13 = reader.readLine();
- switch(aux13){
- case "1":
- //send message
- continue;
- case "2":
- //send message
- continue;
- case "3":
- //send message
- continue;
- case "4":
- //send message;
- case "5":
- //send message
- continue;
- default:
- continue;
- }
- default:
- continue;
- }
- case "2":
- System.out.print("\nType artist's name:\n> ");
- String artist2 = reader.readLine();
- System.out.print("\nType album's name:\n> ");
- String album2 = reader.readLine();
- System.out.println("\n1- Description");
- System.out.println("2- List of songs");
- System.out.print("3- Reviews\n> ");
- String aux2 = sc.next();
- switch(aux2){
- case "1":
- //send message
- continue;
- case "2":
- //send message
- continue;
- case "3":
- //send message
- continue;
- default:
- continue;
- }
- case "3":
- System.out.print("\nType artist's name:\n> ");
- String artist3 = reader.readLine();
- //send message
- continue;
- case "4":
- System.out.print("\nType album's name:\n> ");
- String album4 = reader.readLine();
- String score4 = null;
- while(true){
- System.out.print("\nType album's score (0 to 10):\n> ");
- score4 = reader.readLine();
- try{
- int score41 = Integer.parseInt(score4);
- if(score41>=0 && score41<=10){
- break;
- }
- else{
- System.out.println("That input is invalid");
- continue;
- }
- }
- catch(NumberFormatException e){
- System.out.println("That input is invalid");
- continue;
- }
- }
- System.out.print("\nWrite review (300 characters):\n> ");
- String review4 = reader.readLine();
- String review42;
- if(review4.length()>300)
- review42 = review4.substring(0,300);
- else
- review42 = review4;
- //send message
- continue;
- case "5":
- System.out.print("\nType album's name:\n> ");
- String album5 = reader.readLine();
- System.out.print("\nType song's name:\n> ");
- String song5 = reader.readLine();
- System.out.println("\nType your friends usernames (write BREAK to end):");
- String user_friends5 = "";
- while(true){
- System.out.print(">");
- String friend5 = reader.readLine();
- if (friend5.equals("BREAK")){
- break;
- }
- else{
- user_friends5 += friend5 + "//";
- continue;
- }
- }
- //send message
- continue;
- case "6":
- if(/*c.getEditor()*/){
- System.out.println("\n1- Insert");
- System.out.print("2- Change\n> ");
- String aux8 = sc.next();
- switch(aux8){
- case "1":
- System.out.println("\n1- Artist");
- System.out.println("2- Album");
- System.out.print("3- Song\n> ");
- String aux81 = sc.next();
- switch(aux81){
- case "1":
- System.out.print("\nType artist's name:\n> ");
- String artist811 = reader.readLine();
- System.out.print("\nType artist's description:\n> ");
- String description811 = reader.readLine();
- System.out.print("\nType artist's working period:\n> ");
- String period811 = reader.readLine();
- //send message
- continue;
- case "2":
- System.out.print("\nType artist's name:\n> ");
- String artist812 = reader.readLine();
- System.out.print("\nType album's name:\n> ");
- String album812 = reader.readLine();
- System.out.print("\nType album's genre:\n> ");
- String genre812 = reader.readLine();
- System.out.print("\nType album's description:\n> ");
- String description812 = reader.readLine();
- System.out.print("\nType album's date:\n> ");
- String date812 = reader.readLine();
- //send message
- continue;
- case "3":
- System.out.print("\nType artist's name:\n> ");
- String artist813 = reader.readLine();
- System.out.print("\nType album's name:\n> ");
- String album813 = reader.readLine();
- System.out.print("\nType song's name:\n> ");
- String song813 = reader.readLine();
- System.out.print("\nType song's duration:\n> ");
- String duration813 = reader.readLine();
- System.out.print("\nType song's composer:\n> ");
- String composer813 = reader.readLine();
- System.out.print("\nType song's lyrics:\n> ");
- String lyrics813 = reader.readLine();
- //send message
- continue;
- default:
- continue;
- }
- case "2":
- System.out.println("\n1- Artist");
- System.out.println("2- Album");
- System.out.print("3- Song\n> ");
- String aux82 = sc.next();
- switch(aux82){
- case "1":
- System.out.println("\n1- Artist's name");
- System.out.println("2- Artist's description");
- System.out.print("3- Artist's working period\n> ");
- String aux821 = reader.readLine();
- System.out.print("\nType artist's name:\n> ");
- String artist821 = reader.readLine();
- switch(aux821){
- case "1":
- System.out.print("\nType artist's new name:\n> ");
- String newartist8211 = reader.readLine();
- //send message
- continue;
- case "2":
- System.out.print("\nType artist's new description:\n> ");
- String newd8212 = reader.readLine();
- //send message
- continue;
- case "3":
- System.out.print("\nType artist's new working period:\n> ");
- String newp8213 = reader.readLine();
- //send message
- continue;
- default:
- continue;
- }
- case "2":
- System.out.println("\n1- Album's name");
- System.out.println("2- Album's description");
- System.out.println("3- Album's genre");
- System.out.print("4- Album's date\n> ");
- String aux822 = reader.readLine();
- System.out.print("\nType artist's name:\n> ");
- String artist822 = reader.readLine();
- System.out.print("\nType album's name:\n> ");
- String album822 = reader.readLine();
- switch(aux822){
- case "1":
- System.out.print("\nType album's new name:\n> ");
- String newalbum8221 = reader.readLine();
- //send message
- continue;
- case "2":
- System.out.print("\nType album's new description:\n> ");
- String newdesc8222 = reader.readLine();
- //send message
- continue;
- case "3":
- System.out.print("\nType album's new genre:\n> ");
- String newgenre8223 = reader.readLine();
- //send message
- continue;
- case "4":
- System.out.print("\nType album's new date:\n> ");
- String newdate8224 = reader.readLine();
- //send message
- continue;
- default:
- continue;
- }
- case "3":
- System.out.println("\n1- Song's name");
- System.out.println("2- Song's duration");
- System.out.println("3- Songs's composer");
- System.out.print("4- Song's lyrics\n> ");
- String aux823 = reader.readLine();
- System.out.print("\nType artist's name:\n> ");
- String artist823 = reader.readLine();
- System.out.print("\nType album's name:\n> ");
- String album823 = reader.readLine();
- System.out.print("\nType song's name:\n> ");
- String song823 = reader.readLine();
- switch(aux823){
- case "1":
- System.out.print("\nType song's new name:\n> ");
- String newsong8231 = reader.readLine();
- //send message
- continue;
- case "2":
- System.out.print("\nType song's new duration:\n> ");
- String newdur8232 = reader.readLine();
- //send message
- continue;
- case "3":
- System.out.print("\nType song's new composer:\n> ");
- String newcomp8233 = reader.readLine();
- //send message
- continue;
- case "4":
- System.out.print("\nType song's new lyrics:\n> ");
- String newlyrics8234 = reader.readLine();
- //send message
- continue;
- default:
- continue;
- }
- default:
- continue;
- }
- default:
- continue;
- }
- }
- else{
- continue;
- }
- case "7":
- if(c.getEditor()){
- System.out.print("\nType username:\n> ");
- String user9 = reader.readLine();
- //send message
- continue;
- }
- else
- continue;
- case "0":
- System.exit(0);
- default:
- continue;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement