亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? company.java

?? it is an inventory system which is used to maintain all the accounts of stores
?? JAVA
字號:
// Code Written by Kevin Dela Rosa, Vinney LaPenna, and John Sameulson		June 14, 2004

/***********************************************************************************/
/**                                                                               **/
/**                      Inventory Deluxe v 1.03                                  **/ 
/**                      Company Class                                            **/ 
/**                                                                               **/
/***********************************************************************************/

// Company class
// Workload of our program
// Computes all of the necessary mathematical and manipulative functions
import java.io.*;
import java.text.*;
import java.util.*;


class Company
{
	private String fileName;
	// Stores the name of the file for save purposes
	
	private ArrayList currentItems;
	// Stores the inventory; collection of Item objects
	
	private double currentFunds;
	// Represents how much money the company has to spend on inventory
	
	public Company() throws IOException
	// Default constructor; loads all the inventory data from the file
	{
		currentItems = new ArrayList();
		fileName = "inventory.dat";
		BufferedReader cin = new BufferedReader(new FileReader(fileName));
		// For reading from the file
		currentFunds = Double.parseDouble(cin.readLine());
		String name;
		String description;
		String id;
		int amt;
		double sale;
		double order;
		while((name = cin.readLine()) != null)
		{
			description = cin.readLine();
			StringTokenizer st = new StringTokenizer(cin.readLine());
			id = st.nextToken();
			amt = Integer.parseInt(st.nextToken());
			sale = Double.parseDouble(st.nextToken());
			order = Double.parseDouble(st.nextToken());
			Item i = new Item(name, description,id,amt,sale,order);
			currentItems.add(i);
			// Adds the new Item to the list
		}
		cin.close();
	}
	
	public void openFile(String fileName) throws IOException
	{
		currentItems.clear();
		BufferedReader cin = new BufferedReader(new FileReader(fileName));
		// For reading from the file
		currentFunds = Double.parseDouble(cin.readLine());
		String name;
		String description;
		String id;
		int amt;
		double sale;
		double order;
		while((name = cin.readLine()) != null)
		{
			description = cin.readLine();
			StringTokenizer st = new StringTokenizer(cin.readLine());
			id = st.nextToken();
			amt = Integer.parseInt(st.nextToken());
			sale = Double.parseDouble(st.nextToken());
			order = Double.parseDouble(st.nextToken());
			Item i = new Item(name, description,id,amt,sale,order);
			currentItems.add(i);
			// Adds the new Item to the list
		}
		this.fileName = fileName;
		cin.close();
	}
	
	public void sortByName()
	 // Implements an insertion/selection sort on currentItems, sorting by item name 
	{
		ArrayList temp = new ArrayList(); // Empty ArrayList (for sorting)
		Item smallest; // Stores the smallest item (for sorting)
		Item go; // Temporary Item
		while(currentItems.size() > 0)
		{
			smallest = (Item) currentItems.get(0);
			for(int c = 0; c < currentItems.size(); c++)
			{
				go = (Item) currentItems.get(c);
				if(go.getName().toUpperCase().compareTo(
					smallest.getName().toUpperCase()) <= 0)
				{
					smallest = go;
				}
				
			}
			temp.add(smallest);
			currentItems.remove(smallest);
		}
		currentItems = temp;
	}
	
	public void sortById()
	 // Implements an insertion/selection sort on currentItems, sorting by ID number
	{
		ArrayList temp = new ArrayList(); // Empty ArrayList (for sorting)
		Item smallest; // Stores the smallest item (for sorting)
		Item go; // Temporary Item
		while(currentItems.size() > 0)
		{
			smallest = (Item) currentItems.get(0);
			for(int c = 0; c < currentItems.size(); c++)
			{
				go = (Item) currentItems.get(c);
				if(Integer.parseInt(go.getId()) <
					Integer.parseInt(smallest.getId()))
				{
					smallest = go;
				}
				
			}
			temp.add(smallest);
			currentItems.remove(smallest);
		}
		currentItems = temp;
	}
	
	
	public boolean newSales(String id, int amt)
	 // Checks to see if id is in currentItems
	 // If it is not, returns false
	 // If it is, it sells amt Items if there are enough Items
	 // If amount is insufficient, returns false
	 // If all conditions are met it sells amt of Item and returns true
	{
		boolean checkID = false; // Determines if id is in the list
		Item i = new Item(); 
		for(int c = 0; c < currentItems.size(); c++)
		{	
			if(id.equals(((Item) currentItems.get(c)).getId()))
			{
				checkID = true;
				i = (Item) currentItems.get(c);
			}
		}
		if(checkID)
		{
			if(amt > i.getAmount())
				return false; 
			else
			{
				currentFunds += i.sellItem(amt);
				return true;
			}
		}
		return false;
	}
	
	public boolean newOrders(String id, int amt)
	 //Checks to see if id is in currentItems
	 // If it is not, returns false
	 // If it is, it orders the passed amount if currentFunds is sufficient
	 // If money is insufficient, returns false
	 // If all conditions are met it orders amt of Item and returns true
	{
		boolean checkID = false;
		Item i = new Item(); 
		for(int c = 0; c < currentItems.size(); c++)
		{	
			if(id.equals(((Item) currentItems.get(c)).getId()))
			{
				checkID = true;
				i = (Item) currentItems.get(c);
			}
		}
		if(checkID)
		{
			if(currentFunds < i.getOrderPrice(amt))
			  return false; 
			else
			{
				currentFunds -= i.orderItem(amt);
				return true;
			}
		}
		return false;
	}
	
	public boolean liquidateItem(String id)
	 //Sells all of one item at order price and adds the money to currentFunds
	 //returns true if successful, and false if id is not an Item
	{
		Item i = new Item();
		Item go = new Item();
		boolean isInList = false;
		for(int c = 0; c < currentItems.size(); c++)
		{
			go = ((Item)currentItems.get(c));
			if(id.compareTo(go.getId()) == 0)
			{
				i = go;
				isInList = true;;
			}
		}
		
		if(isInList)
		{
			currentFunds += i.liquidate();
			currentItems.remove(i);
		}
		return isInList;
		//returns true if you can liquidate
	}

	public boolean makeItem(String n, String d, String id, double s, double o, int a)
	 // If id is not a current id in currentItems, creates new item with passes data and returns true
	 // Otherwise returns false
	{
		boolean isInList = false;		
		for(int c = 0; c < currentItems.size(); c++)
		{
			String temp = ((Item) currentItems.get(c)).getId();
			if(id.equals(temp))
			{
				isInList = true;
			}
		}
		if(!isInList)
		{
			Item i = new Item(n,d,id,a,s,o);
			if(currentFunds < i.getOrderPrice(a))
			{
				isInList = true;
			}
			else
			{
				currentFunds -= a * o;
				currentItems.add(i);
			}
		}
		return !isInList;
		// returns false if it is in the list, or 
		// if Company does not have enough money
	}
	
	public void endProgram() throws IOException
	 // Saves the current data to the data file
	{
		BufferedWriter cout = new BufferedWriter(new FileWriter(fileName));
		String cf = new Double(currentFunds).toString();
		cout.write(cf);
		cout.newLine();
		for(int c = 0; c < currentItems.size(); c++)
		{
			Item i = ((Item) currentItems.get(c));
			cout.write(i.getName());
			cout.newLine();
			cout.write(i.getDescription());
			cout.newLine();
			cout.write(i.getId() + " " + i.getAmount() + " " + i.getSalesPrice());
			cout.write(" " + i.getOrderPrice());
			cout.newLine();
			
		}
		cout.close();
	}

	public boolean changeSalesPrice(String id, double np)
	 //If the passed id is in the list, the Item's sales price is set to np and returns true
	 //Otherwise, returns false
	{
		boolean checkID = false;
		Item i = new Item();
		for(int c = 0; c < currentItems.size(); c++)
		{	
			if(id.equals(((Item) currentItems.get(c)).getId()))
			{
				checkID = true;
				i = (Item) currentItems.get(c);
			}
		}
		if(checkID)
		{
			i.setSalesPrice(np);
			return true;
		}
		return false;
		//returns true if it succeeded, false if id not in list
		//Please protect the double for negativity and zero
	}
	
	public boolean changeOrderPrice(String id, double np)
	 //If the passed id is in the list, the Item's order price is set to np and returns true
	 //Otherwise, returns false
	{
		boolean checkID = false;
		Item i = new Item();
		for(int c = 0; c < currentItems.size(); c++)
		{	
			if(id.equals(((Item) currentItems.get(c)).getId()))
			{
				checkID = true;
				i = (Item) currentItems.get(c);
			}
		}
		if(checkID)
		{
			i.setOrderPrice(np);
			return true;
		}
		return false;
		//returns true if it succeeded, false if id not in list
		//Please protect the double for negativity and zero
	}
	
	public ArrayList getItems()
	//Returns the current list of items
	{
		return currentItems;
	}
	
	public double getFunds()
	//Returns the current amount of money being used for inventory
	{
		return currentFunds;
	}
	
	public int getNumItems()
	 //returns the current number of Items in currentItems
	{
		return currentItems.size();
	}
	
	public void setFunds(double f)
	// Sets the company's funds to f
	{
		currentFunds = f;
	}
	
	public void setFileName(String name)
	{
		fileName = name;
	}
	
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
9191精品国产综合久久久久久| 中文字幕一区二区三区不卡 | 欧洲精品一区二区三区在线观看| 成人综合婷婷国产精品久久 | 欧美日韩国产精品成人| 欧美亚洲动漫制服丝袜| 色婷婷av一区二区三区软件| 色综合久久久久综合体| 日本二三区不卡| 欧美性xxxxxx少妇| 欧美日韩精品一区二区| 欧美二区在线观看| 精品国产凹凸成av人导航| 久久一夜天堂av一区二区三区| 精品国产在天天线2019| 久久先锋影音av鲁色资源| 中文字幕第一页久久| ...中文天堂在线一区| 一区二区三区四区不卡在线| 亚洲午夜一区二区| 奇米色777欧美一区二区| 久久99精品久久久久久动态图 | 91蝌蚪porny九色| 在线免费亚洲电影| 欧美一级免费观看| 久久久午夜精品| ㊣最新国产の精品bt伙计久久| 亚洲男人的天堂在线观看| 亚洲国产精品精华液网站| 日韩成人免费电影| 国产伦理精品不卡| 一本在线高清不卡dvd| 欧美日韩亚洲综合| 久久综合久久综合亚洲| 中文字幕 久热精品 视频在线| 亚洲精品国产视频| 日本不卡一二三区黄网| 国产成人高清在线| 在线视频你懂得一区| 日韩精品一区二区三区在线播放 | 波多野结衣中文字幕一区| 欧美午夜精品久久久久久孕妇| 日韩欧美国产综合一区| 国产欧美日本一区视频| 亚洲午夜国产一区99re久久| 国产一区二区调教| 色综合久久88色综合天天| 日韩欧美在线不卡| 国产精品成人在线观看| 婷婷开心激情综合| bt欧美亚洲午夜电影天堂| 欧美三级电影网站| 中文字幕第一区| 日韩不卡免费视频| proumb性欧美在线观看| 日韩一区二区三区观看| 国产精品久久福利| 另类综合日韩欧美亚洲| 91麻豆精品视频| 久久这里只精品最新地址| 亚洲成av人片| 99精品在线免费| 欧美精品一区二区久久婷婷| 亚洲v中文字幕| 99九九99九九九视频精品| 久久亚洲一级片| 日韩中文字幕一区二区三区| www.av精品| 久久久99精品免费观看不卡| 亚洲bdsm女犯bdsm网站| 成人黄色777网| 精品国产乱码久久久久久久| 天天色天天爱天天射综合| 99视频在线精品| 久久久亚洲欧洲日产国码αv| 三级久久三级久久| 色琪琪一区二区三区亚洲区| 国产精品素人一区二区| 日本不卡1234视频| 欧美日韩一区不卡| 亚洲免费毛片网站| 不卡的av电影在线观看| 国产喷白浆一区二区三区| 精品一区免费av| 91精品国产综合久久香蕉的特点 | 亚洲男人的天堂在线aⅴ视频| 国产高清一区日本| 欧美精品一区二区三区一线天视频| 日本女优在线视频一区二区| 欧美日韩三级一区| 亚洲一区二区在线免费观看视频| 成人黄色一级视频| 中文字幕乱码日本亚洲一区二区| 国产精品888| 久久品道一品道久久精品| 激情欧美一区二区| 欧美本精品男人aⅴ天堂| 免费在线观看成人| 日韩视频在线永久播放| 日本成人在线电影网| 69久久夜色精品国产69蝌蚪网| 日韩中文欧美在线| 777色狠狠一区二区三区| 日韩成人免费看| 欧美一级精品在线| 精品制服美女丁香| 久久综合久久鬼色中文字| 国产曰批免费观看久久久| 久久综合狠狠综合久久综合88 | 亚洲mv大片欧洲mv大片精品| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 国产亚洲欧美在线| 国产成人av资源| 国产精品麻豆一区二区| 94-欧美-setu| 亚洲成人第一页| 91精品国产福利| 国产在线日韩欧美| 国产精品沙发午睡系列990531| 成人国产亚洲欧美成人综合网| 亚洲激情第一区| 欧美日韩在线播放三区四区| 美腿丝袜一区二区三区| 26uuu精品一区二区| 成人免费视频app| 一区二区三区在线视频免费| 欧美日韩aaaaaa| 国产尤物一区二区在线| 亚洲欧洲韩国日本视频| 欧美午夜电影一区| 久久国产精品露脸对白| 国产情人综合久久777777| 日本丶国产丶欧美色综合| 奇米亚洲午夜久久精品| 国产精品免费av| 欧美精品亚洲二区| 国产乱子伦视频一区二区三区| 亚洲欧洲99久久| 欧美久久高跟鞋激| 成人在线一区二区三区| 午夜免费欧美电影| 国产无人区一区二区三区| 在线观看国产一区二区| 久久99精品国产麻豆不卡| 成人免费在线观看入口| 日韩欧美中文字幕精品| 99精品国产一区二区三区不卡| 天天综合色天天综合色h| 国产欧美日韩视频一区二区| 欧美色大人视频| 国产一区二区在线视频| 亚洲国产一区视频| 久久久久久久久久久久久久久99 | 亚洲综合一区在线| 精品久久久久久亚洲综合网| www.欧美亚洲| 久久电影网电视剧免费观看| 1000精品久久久久久久久| 日韩欧美第一区| 色吧成人激情小说| 国产成人三级在线观看| 亚洲第四色夜色| 中文字幕视频一区| 精品999在线播放| 欧美最猛性xxxxx直播| 国产大片一区二区| 日韩电影免费一区| 亚洲人成网站在线| 欧美韩日一区二区三区| 日韩欧美国产综合一区 | 欧美电影精品一区二区| 91蜜桃网址入口| 国产精品一卡二| 日本在线不卡一区| 夜夜夜精品看看| 中国av一区二区三区| 日韩欧美一区在线| 欧美日本在线视频| 日本高清视频一区二区| aaa欧美日韩| 国产精品888| 精品亚洲porn| 青青草97国产精品免费观看| 一区二区三区成人在线视频| 国产精品精品国产色婷婷| 精品美女一区二区三区| 制服.丝袜.亚洲.另类.中文 | 精品国产成人在线影院| 91精品国产91久久久久久一区二区| 91在线免费看| 成人动漫视频在线| 国产成人鲁色资源国产91色综| 久久国产精品色| 美女视频网站黄色亚洲| 青娱乐精品在线视频| 日韩黄色一级片| 亚洲国产日韩a在线播放性色| 亚洲精品国产a久久久久久| 综合网在线视频| 国产精品不卡视频|