473,490 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

inventory Program

1 New Member
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:
Expand|Select|Wrap|Line Numbers
  1. public class MovieInventory
  2. {
  3.     public static void main(String args[]){
  4.         DVD dvd;
  5.  
  6.         dvd = new DVD("Grumpy old men",1,1,17.00);
  7.         System.out.println(dvd);
  8.  
  9.         dvd = new DVD("Grumpier Old Men",2,1,17.00);
  10.         System.out.println(dvd);
  11.  
  12.         dvd = new DVD("Pretty Woman",3,1,19.95);
  13.         System.out.println(dvd);
  14.  
  15.         dvd = new DVD("Goast",4,1,19.95);
  16.         System.out.println(dvd);
  17.  
  18.         dvd = new DVD("Gone with the Wind",5,1,11.00);
  19.         System.out.println(dvd);
  20.  
  21.     }//end main
  22.  
  23.     public Object getPrice;
  24.  
  25.     public Object getPrice() {
  26.         return null;
  27.     }
  28. }//end class MovieInventory
  29.  
  30. class DVD{
  31.     private String dvdTitle;
  32.     private double dvdStock;
  33.     private double dvdPrice;
  34.     private double dvdItem;
  35.     public Object reStockFee;
  36.  
  37. public DVD(String Title, double Stock, double Price, double Item){
  38.     dvdTitle = Title;
  39.     dvdStock = Stock;
  40.     dvdPrice = Price;
  41.     dvdItem = Item;
  42. }//end constructor argument
  43.  
  44. //set DVD Item
  45. public void setDVDItem(int item){
  46.     dvdItem = item;
  47. }//end method set DVD Item
  48.  
  49. //return DVD Item
  50. public double getDVDItem(){
  51.     return dvdItem;
  52. }//end method get DVD Item
  53.  
  54. //set DVD Title
  55. public void setDVDTitle(String Title){
  56.     dvdTitle = Title;
  57. }//end method set DVD Title
  58.  
  59. //return DVD Title
  60. public String detDVDTitle(){
  61.     return dvdTitle;
  62. }//end method get DVD Title
  63.  
  64. public void setDVDStock(double Stock){
  65.     dvdStock = Stock;
  66. }//end method set DVD Stock
  67.  
  68. //return DVD Stock
  69. public double getDVDStock(){
  70.     return dvdStock;
  71. }//end method get DVD Stock
  72.  
  73. public void setDVDPrice(double Price){
  74.     dvdPrice = Price;
  75. }//end method Set DVD Price
  76.  
  77. //return DVD price
  78. public double getDVDPrice(){
  79.     return dvdPrice;
  80. }//end method get DVD Price
  81.  
  82. //calculate inventory value
  83. public double value(){
  84.     return dvdPrice * dvdStock;
  85. }//end method value
  86.  
  87. public double calcValue(int Price, int Stock )
  88. {
  89.     return Stock*Price;
  90. }
  91.  
  92. public String toString1()
  93. {
  94.     return "Product: " + dvdTitle + "\n" +
  95.            "Product Item: " + dvdItem + "\n" +
  96.            "Qty In Stock: " + dvdStock + "\n" + 
  97.            "Product Price: $"  + dvdPrice + "\n" + 
  98.            "Stock Value: $" + calcValue(0, 0);}
  99.  
  100. public class Dvd extends  MovieInventory{
  101.     private double price;
  102.  
  103.     public Dvd(double price) {
  104.         this.price = price;
  105.     }
  106.         public double getprice(){
  107.             return this.price;
  108.     }
  109.     public String toString1() {
  110.         return new StringBuffer().append("Price:" + getPrice()).toString();
  111.     }    
  112.     {
  113. }
  114.  
  115. public String toString(){
  116.     return String.format("%-20s %-20s %-20s %-20s", dvdTitle,dvdItem,dvdStock,dvdPrice, value());
  117.     }
  118. }
  119. }
  120. //end class DVD
Feb 28 '08 #1
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.
Feb 28 '08 #2
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
Feb 28 '08 #3
hollywood115
16 New Member
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.
Feb 28 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

13
3956
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...
109
25697
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...
0
7091
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...
4
2294
nexcompac
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...
9
7594
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...
3
6966
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...
2
2501
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...
1
2646
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...
3
4459
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...
2
4420
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...
0
7112
marktang
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,...
0
6974
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...
0
7146
Oralloy
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,...
0
7183
jinu1996
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...
0
7356
tracyyun
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...
1
4878
isladogs
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...
0
3084
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...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.