Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. import javax.swing.*;
  2.  
  3.  
  4. public class Matteprov {
  5. public static void main(String[] arg) {
  6. String s;
  7. s = JOptionPane.showInputDialog (null, "hur många poäng");
  8. double betyg;
  9.  
  10. double a = Double.parseDouble (s);
  11. if (a >= 45)
  12. betyg = A;
  13. else if (a < 45)
  14. betyg = B;
  15. else if (a < 40)
  16. betyg = C;
  17. else if (a < 35)
  18. betyg = D;
  19. else if (a < 30)
  20. betyg = E;
  21. else if (a < 25)
  22. betyg = F;
  23. JOptionPane.showMessageDialog(null, "Betyget blir " + betyg);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement