Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. package tps.tp1.pack1Decisoes;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P03OpTernario {
  6.  
  7. public static void main(String[] args) {
  8. Scanner keyboard = new Scanner(System.in);
  9. String fase;
  10. String faseseguinte;
  11. System.out.println("Introduza a fase");
  12. fase = keyboard.nextLine();
  13. if(fase.equalsIgnoreCase("Analysis") || fase.equalsIgnoreCase("Design") || fase.equalsIgnoreCase("Implementation")
  14. ||fase.equalsIgnoreCase("Testing") || fase.equalsIgnoreCase("Evolution")) {
  15.  
  16. faseseguinte = fase.equalsIgnoreCase("Analysis")? ("Design"): (fase.equalsIgnoreCase("Design")? ("Implementation") :
  17. (fase.equalsIgnoreCase ("Implementation")?("Testing"): (fase.equalsIgnoreCase("Testing")?("Evolution"):
  18. (fase.equalsIgnoreCase("Evolution")?("Analysis"):("inválida")))));
  19.  
  20. System.out.println("Próxima Fase:" + faseseguinte);
  21. }
  22. else {
  23. System.out.println("Fase inválida");
  24. }
  25. keyboard.close();
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement