Purchase Solution

Java Payroll Program to Create an Inventory

Not what you're looking for?

Ask Custom Question

Choose a product that lends itself to an inventory (for example, products at your workplace, office supplies, music CDs, DVD movies, or software).

? I need to create a product class that holds the item number, the name of the product, the number of units in stock, and the price of each unit.

?I need to create a Java application that displays the product number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory (the number of units in stock multiplied by the price of each unit). Pay attention to the good programming practices in the text to ensure your source code is readable and well documented.

You need to create two files. The first contains the main method and the second is a class file

Instead of having a compute average method on the class file, you will have compute value method.

You would have getter and setter methods for these variables.
You would also have a computeValue method.

For this problem I want to use office supplies such as Pencils, pens, notepad, Highlighters, folders etc..

Purchase this Solution

Solution Summary

A) A product class that holds the item number, the name of the product, the number of units in stock, and the price of each unit.

B) Displays the product number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory (the number of units in stock multiplied by the price of each unit). Pay attention to the good programming practices in the text to ensure your source code is readable and well documented.

Solution Preview

I have attached the files inventory.java and inventoryMain.java in a compressed file. The first one is the class and has many getters and setters. It also has two methods valueOfInventory() and showInventory().

/**
* Created by IntelliJ IDEA.
* User: Mahmood
* Date: Sep 13, 2006
* Time: 1:48:41 AM
* To change this template use File | Settings | File Templates.
*/
public class inventory {
private int itemNum;
private String name = new String();
private int units;
private double price;

// All getters and setters
public int getItemNum() {
return itemNum;
}

public void setItemNum(int itemNum) {
this.itemNum = itemNum;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public int getUnits() {
return units;
...

Purchase this Solution


Free BrainMass Quizzes
C# variables and classes

This quiz contains questions about C# classes and variables.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Basic Networking Questions

This quiz consists of some basic networking questions.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.