Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package yourmama;
- import java.util.*;
- /**
- *
- * @author Student
- */
- public class Yourmama {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Scanner scan =new Scanner (System.in);
- System.out.print("Choose color - r/R y/Y b/B p/P g/G: ");
- char c=scan.nextLine().charAt(0);
- System.out.println(" ");
- if(c=='R'|| c=='r')
- {System.out.println("Red");}
- else if(c=='Y'|| c=='y')
- {System.out.println("Yellow");}
- else if(c=='B'|| c=='b')
- {System.out.println("Blue");}
- else if(c=='P'|| c=='p')
- {System.out.println("Purple");}
- else if(c=='G'|| c=='g')
- {System.out.println("Green");}
- else
- {System.out.println("Out of range");}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement