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

📄 user.java

📁 电子商店
💻 JAVA
字号:
/**
 * 
 */
package product;

/**
 * @author 韦建艺 0658025
 * @2008.11.04
 * @
 */
import java.io.*;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.Graphics;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

public class user  {
	public static void main(String[] args) {
		String[][] Str = new String[100][7];// 存放商品
		double[][] Double = new double[100][4];//
		int[][] Int = new int[100][7];//
		int ID = -1;
		Boolean removable;// Y or N
		for (int i = 0; i < 100; i++) {
			BufferedReader in = new BufferedReader(new InputStreamReader(
					System.in));
			System.out.println("Please cin what you want to do");
			System.out.println("Cin A: Add a new product");
			System.out.println("Cin D:  Display products");
			System.out.println("Cin C: Change product information");
			System.out.println("Cin S: Search for a product");
			System.out.println("Cin R: Remove a product");
			System.out.println("Cin P: picture");
			System.out.println("Cin O: onSale plans");
			System.out.println("Cin Q: Quit");
			// Cin the choice
			String str = null;
			try {
				String anString = in.readLine();
				str = anString;
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			if (str.equals("A")) {
				System.out.println("Your selection: A");
				ID = ID + 1;
				Add Aproduct = new Add();
				Aproduct.input(ID, Str, Double, Int);// add product
			}

			else if (str.equals("D")) {
				System.out.println("Your selection: D");
				System.out.println();
				Show Displayproducts = new Show();
				Displayproducts.Display(Str, Double, Int);//Display products

			} else if (str.equals("C")) {
				System.out.println("Your selection: C");
				System.out.println();
				Change Changeprice = new Change();
				Changeprice.Change(Str, Double);// Change product information

			} else if (str.equals("S")) {
				System.out.println("Your selection: S");
				System.out.println();
				Search Searchproduct = new Search();
				Searchproduct.Sesrch(Str, Double, Int);//Search for a product

			} else if (str.equals("R")) {
				System.out.println("Your selection: R");
				Remove Removeproduct = new Remove();
				Removeproduct.Remove(Str, Double, Int);//Remove a product

			} else if (str.equals("P")) {//Show a picture
				System.out.println("Your selection: P");
				System.out
						.println("Please put the picture in this place:F:\\Photo\\2.jpg");
				System.out.println("You can see our pruduct in the picture!");
				System.out.println("");
				MyFrame my = new MyFrame();
				my.setSize(500, 500);
				my.setVisible(true);
			} else if (str.equals("O")) {//OnSale
				System.out.println("Your selection:o");
				System.out.println("You can take a onsaleplan!");
				
				Laptop aLaptop=new Laptop();//Laptop OnSale
				aLaptop.setSaleDate();
				aLaptop.setSaleDiscount(Str, Double, Int);
				
				Desktop aDesktop=new Desktop();//Desktop OnSale
				aDesktop.setSaleDate();
				aDesktop.setSaleDiscount(Str, Double, Int);
				
				Hometheater aHometheater=new Hometheater();//Hometheater OnSale
				aHometheater.setSaleDate();
				aHometheater.setSaleDiscount(Str, Double, Int);
				
				Cartheater aCartheater=new Cartheater();//Cartheater nOnSale
				aCartheater.setSaleDate();
				aCartheater.setSaleDiscount(Str, Double, Int);
				
				System.out.println("");;

			} else if (str.equals("Q")) {//Quit
				System.out.println("Your selection: Q");
				System.out.println("Think you for using me,kiss you goodbye!");
				break;

			} else {//cin again
				System.out
						.println("Your selection is not right,please cin again,OK?");
				System.out.println();

			}

		}
	}


}

⌨️ 快捷键说明

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