StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...

Java Program ShopKeeper - Essay Example

Cite this document
Summary
This java project is made by using Java2SDK 1.4.2 but the program can be interpreted by any version of J2SDK from 1.2 to higher. The project contains following classes, which are described briefly along with their functionality.
1. Item class: This class is capable of holding item name, quantity, price and have setter setter and getter methods for storing and retrieving correct data in these instance variables…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER94.7% of users find it useful
Java Program ShopKeeper
Read Text Preview

Extract of sample "Java Program ShopKeeper"

Download file to see previous pages

Some utility methods like getStockValue() and getNeededItems() are also there to return the over all value of the stock and the list of needed items respectively. 3. ShopKeeper class: This class gives the overall graphical user interface to the client so that the client can access both StockTake and Item classes in order to manipulate Items. This class uses some more user-defined classes to construct the GUI. The classes are: a. ShopKeeperDesktopManager class: This class helps to create multiple document interface environment.b. InsertItemFrame class: This class makes a child window for insert Item information.c. NeededItemFrame class: This class makes a child window for displaying the list of needed items whose quantity is zero.

Coding Source codes of all the classes are given along with their file names.Item.javaimport javax.swing.*;import java.io.*;public class Item{ String iName; int iQty; double iPrice; public Item(String iName) { this.iName=iName.toUpperCase(); iQty=0; iPrice=0; } public Item(String iName,int iQty,double iPrice) { setIName(iName.toUpperCase()); setIQty(iQty); setIPrice(iPrice); } public void setIName(String iName) { this.iName=iName.toUpperCase(); } public String getIName() { return iName; } public void setIQty(int iQty) { if(iQty>=0) this.

iQty=iQty; else JOptionPane.showMessageDialog(null,"Qty cannot be -ve","Check Qty",JOptionPane.ERROR_MESSAGE); } public int getIQty() { return iQty; } public void setIPrice(double iPrice) { if(iPrice>0) this.iPrice=iPrice; else JOptionPane.showMessageDialog(null,"Price cannot be -ve or zero","Check Price",JOptionPane.ERROR_MESSAGE); } public double getIPrice() { return iPrice; } public double getValue() { return iPrice*iQty; } public String toString() { return "[Item: "+iName+";Price: "+iPrice+";Quantity: "+iQty+";Value: "+getValue()+"]"; }}StockTake.

javapublic class StockTake{ Item itemsArray[]; int arrSize; int itemCount; public StockTake(int arrSize) { if(arrSize>0) { itemsArray=new Item[arrSize]; this.arrSize=arrSize; this.itemCount=0; } else { itemsArray=new Item[50]; this.arrSize=50; this.itemCount=0; } } public Item[] getItemsArray() { return itemsArray; } public boolean addItem(Item i) { if(itemCount

...Download file to see next pages Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Java Program ShopKeeper Essay Example | Topics and Well Written Essays - 1000 words”, n.d.)
Retrieved from https://studentshare.org/technology/1519824-java-program-shopkeeper
(Java Program ShopKeeper Essay Example | Topics and Well Written Essays - 1000 Words)
https://studentshare.org/technology/1519824-java-program-shopkeeper.
“Java Program ShopKeeper Essay Example | Topics and Well Written Essays - 1000 Words”, n.d. https://studentshare.org/technology/1519824-java-program-shopkeeper.
  • Cited: 2 times

CHECK THESE SAMPLES OF Java Program ShopKeeper

Advatages of using java programing language

A straightforward, easy-to-use program language became necessary with the rise in popularity of the Internet at the end of the 1970s and the beginning of 1980s.... As such, several computer program languages were developed around that time.... The interface is a one class inheritance scheme instead of a multiple inheritance programs that represent the object-oriented program.... Object-orientation refers to the ability of a program to simulate real life....
3 Pages (750 words) Essay

Program Description: Calculator

This paper ''Java Programming'' tells that Here we have used the access specifier as public which tells us that the class can be accessed anywhere in the program.... Moving into the class body, we have declared variables with the final keyword so that their value remains constant throughout the program.... Then from line no 41 onwards we have created the objects of classes that will be used in the program and are defined with access specified private so that only the code inside this class can manipulate them....
7 Pages (1750 words) Essay

Critical Difference Between Java and C#

At the same time as a java loper the earlier sentence could be explained as ‘a short description of the java language and platform' instead the words C# and the .... ET platform were replaced with words java and the java platform ( Obasanjo, 2007).... java is another programming language basically developed by Sun Microsystems and released in 1995 as a most important element of Suns java platform....
12 Pages (3000 words) Essay

Boxes and Tubes Application

Public static void main (String [] args) is the start point of every java application of which every application must have one and only one method named main without which the application will not execute.... This only offers as a description of these items and how to place an order....
3 Pages (750 words) Coursework

Integral Data Types in Java

For storing space and increasing the time of execution of program Java provides two data types (TutorialPoints, 2014; Oracle Corporation, 2014).... Hence, if BigDecimal or BigInteger becomes default it will require more space and the program execution will require additional time.... Yes, java programming language provides some rounding modes, which determine how a certain operation gives back the result in limited numbers of digits as compared to the number of digits that are returned by results....
1 Pages (250 words) Essay

Information Security of Java and NET

The paper "Information Security of java and NET" describes that both platforms and development environments offer their advantages and disadvantages to users as well as programmers and it remains up to the individual programmer or the company itself to select one or the other.... hellip; Security and the related configurations for both java and .... ET, the GUI can be used to adjust all security configurations much as the GUI tool supplied with java....
11 Pages (2750 words) Research Proposal

Program Analysis of Petri Chess

The purpose of this paper "program Analysis of Petri Chess" is to analyze the chess program to estimate its size, look at the functionalities, its relevance to the society, the actors, and stakeholders involved and such knowledge would help developers get some insights.... Perhaps that is why finding literature that comprehensively touches on this topic is very hard to find because program analysts have diverted their attention to other programs....
16 Pages (4000 words) Coursework
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us