Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JOptionPane;
- public class Lab03 {
- public static void main(String[] args){
- JOptionPane.showInputDialog(null, "Enter number of cups purchased: ", JOptionPane.QUESTION_MESSAGE);
- int cups;
- cups = 0;
- switch(cups){
- case 0:
- JOptionPane.showMessageDialog(null,"You have earned 0 points.");
- break;
- case 1:
- JOptionPane.showMessageDialog(null,"You have earned 5 points.");
- break;
- case 2:
- JOptionPane.showMessageDialog(null,"You have earned 15 points.");
- break;
- case 3:
- JOptionPane.showMessageDialog(null,"You have earned 30 points.");
- break;
- default:
- JOptionPane.showMessageDialog(null,"You've entered a negative value.");
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment