⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.java

📁 simulates coin tossing. Let the program toss a coin each time the user chooses the “Toss Coin” menu
💻 JAVA
字号:
/*
 * Main.java
 *
 * Created on 2007年8月10日, 下午1:00
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package javaapplication7;
import javax.swing.JOptionPane;
/**
 *
 * @author xue hao
 */
public class Main {
    
    /** Creates a new instance of Main */
    public Main() {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
    String s1 = JOptionPane.showInputDialog("Enter number sold of product #1");
   int n1 = Integer.parseInt(s1);
   
   String s2 = JOptionPane.showInputDialog("Enter number sold of product #2");
   int n2 = Integer.parseInt(s2);
   
   String s3 = JOptionPane.showInputDialog("Enter number sold of product #3");
   int n3 = Integer.parseInt(s3);
   
   String s4 = JOptionPane.showInputDialog("Enter number sold of product #4");
   int n4 = Integer.parseInt(s4);
   
   double earn1 = n1 * 239.99;
   double earn2 = n2 * 129.75;
   double earn3 = n3 * 99.95;
   double earn4 = n4 * 350.89;
   
   JOptionPane.showMessageDialog(null,"Enter earnings this week" + "$" + (200 + (earn1 + earn2 + earn3 + earn4) * 9 / 100));
    }
    
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -