I am having a hard time with this class. I am new to java and do not understand it or what I am doing. I need to add in a method for the 5% re-stocking fee and a sort array. I thought I had done that but the teacher said it is not there can anyone help me please?
Here is my code: -
public class MovieInventory
-
{
-
public static void main(String args[]){
-
DVD dvd;
-
-
dvd = new DVD("Grumpy old men",1,1,17.00);
-
System.out.println(dvd);
-
-
dvd = new DVD("Grumpier Old Men",2,1,17.00);
-
System.out.println(dvd);
-
-
dvd = new DVD("Pretty Woman",3,1,19.95);
-
System.out.println(dvd);
-
-
dvd = new DVD("Goast",4,1,19.95);
-
System.out.println(dvd);
-
-
dvd = new DVD("Gone with the Wind",5,1,11.00);
-
System.out.println(dvd);
-
-
}//end main
-
-
public Object getPrice;
-
-
public Object getPrice() {
-
return null;
-
}
-
}//end class MovieInventory
-
-
class DVD{
-
private String dvdTitle;
-
private double dvdStock;
-
private double dvdPrice;
-
private double dvdItem;
-
public Object reStockFee;
-
-
public DVD(String Title, double Stock, double Price, double Item){
-
dvdTitle = Title;
-
dvdStock = Stock;
-
dvdPrice = Price;
-
dvdItem = Item;
-
}//end constructor argument
-
-
//set DVD Item
-
public void setDVDItem(int item){
-
dvdItem = item;
-
}//end method set DVD Item
-
-
//return DVD Item
-
public double getDVDItem(){
-
return dvdItem;
-
}//end method get DVD Item
-
-
//set DVD Title
-
public void setDVDTitle(String Title){
-
dvdTitle = Title;
-
}//end method set DVD Title
-
-
//return DVD Title
-
public String detDVDTitle(){
-
return dvdTitle;
-
}//end method get DVD Title
-
-
public void setDVDStock(double Stock){
-
dvdStock = Stock;
-
}//end method set DVD Stock
-
-
//return DVD Stock
-
public double getDVDStock(){
-
return dvdStock;
-
}//end method get DVD Stock
-
-
public void setDVDPrice(double Price){
-
dvdPrice = Price;
-
}//end method Set DVD Price
-
-
//return DVD price
-
public double getDVDPrice(){
-
return dvdPrice;
-
}//end method get DVD Price
-
-
//calculate inventory value
-
public double value(){
-
return dvdPrice * dvdStock;
-
}//end method value
-
-
public double calcValue(int Price, int Stock )
-
{
-
return Stock*Price;
-
}
-
-
public String toString1()
-
{
-
return "Product: " + dvdTitle + "\n" +
-
"Product Item: " + dvdItem + "\n" +
-
"Qty In Stock: " + dvdStock + "\n" +
-
"Product Price: $" + dvdPrice + "\n" +
-
"Stock Value: $" + calcValue(0, 0);}
-
-
public class Dvd extends MovieInventory{
-
private double price;
-
-
public Dvd(double price) {
-
this.price = price;
-
}
-
public double getprice(){
-
return this.price;
-
}
-
public String toString1() {
-
return new StringBuffer().append("Price:" + getPrice()).toString();
-
}
-
{
-
}
-
-
public String toString(){
-
return String.format("%-20s %-20s %-20s %-20s", dvdTitle,dvdItem,dvdStock,dvdPrice, value());
-
}
-
}
-
}
-
//end class DVD
3 1185 BigDaddyLH 1,216
Recognized Expert Top Contributor
I need to add in a method for the 5% re-stocking fee and a sort array. I thought I had done that but the teacher said it is not there can anyone help me please?
If you have done that could you point out the code that
1) implements the 5% re-stocking fee
and
2) "a sort array"
Like your teacher I have trouble finding them.
BigDaddyLH 1,216
Recognized Expert Top Contributor
Please enclose your posted code in [code] tags (See How to Ask a Question).
This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.
Please use [code] tags in future.
MODERATOR
If you have done that could you point out the code that
1) implements the 5% re-stocking fee
and
2) "a sort array"
Like your teacher I have trouble finding them.
i don't see it either...
point out to us what u believe to be the method you are talking about.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: royaltiger |
last post by:
I am trying to copy the inventory database in Building Access Applications
by John L Viescas but when i try to run the database i get an error in the
orders form when i click on the allocate...
|
by: zaidalin79 |
last post by:
I have a java class that goes for another week or so, and I am going to fail if I can't figure out this simple program. I can't get anything to compile to at least get a few points... Here are the...
|
by: south622 |
last post by:
I'm taking a beginning Java course and I'm stuck in week eight of a nine week course. If anyone could help me I would greatly appreciate it. This assignment was due yesterday and each day I go past...
|
by: nexcompac |
last post by:
Ok, I posted a similar post but now need to jump back into it. Here is what I have been able to clean up. I am using textpad and jbuilder.
Still getting used to the whole java world and I am...
|
by: xxplod |
last post by:
I am suppose to modify the Inventory Program so the application can handle multiple items. Use an array to store the items. The output should display the information one product at a time, including...
| |
by: cblank |
last post by:
I need some help if someone could help me. I know everyone is asking for help in java. But for some reason I'm the same as everyone else when it comes to programming in java. I have an inventory...
|
by: pinkf24 |
last post by:
I cannot figure out how to add the following:
Modify the Inventory Program to include an Add button, a Delete button, and a Modify button on the GUI. These buttons should allow the user to perform...
|
by: jcato77 |
last post by:
I need help with a class project I'm working on, Below is my assignment and the code I have currently created.
Assignment:
Modify the Inventory Program by creating a subclass of the product class...
|
by: 100grand |
last post by:
Modify the Inventory Program to use a GUI. The GUI should display the information one
product at a time, including the item number, the name of the product, the number of
units in stock, the price...
|
by: blitz1989 |
last post by:
Hello all, I'm new to this forum and Java and having a alot of problems understanding this language. I am working on an invetory program part 4. The assignment requirements are listed but the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |