Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- public class Matteprov {
- public static void main(String[] arg) {
- String s;
- s = JOptionPane.showInputDialog (null, "hur många poäng");
- double betyg;
- double a = Double.parseDouble (s);
- if (a >= 45)
- betyg = A;
- else if (a < 45)
- betyg = B;
- else if (a < 40)
- betyg = C;
- else if (a < 35)
- betyg = D;
- else if (a < 30)
- betyg = E;
- else if (a < 25)
- betyg = F;
- JOptionPane.showMessageDialog(null, "Betyget blir " + betyg);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement