Can I please get some help
Can someone please help me with this? I am not sure on how to finish it
of fix the errors I get. The errors so far are
inventorysupplystock2.java:45: ')' expected } // end method
setRestockingFee and
inventorysupplystock2.java:44: illegal start of expression
resstockingFee = (value * 5%)
public class inventorysupplystock2 implements Comparable{
protected int count;
protected int quantity;
protected String productName;
protected String productGenre;
protected double itemNumber;
protected double quantityNumber;
protected double unitPrice;
protected double unitValue;
protected double restockingFee;
public inventorysupplystock2() {
}
public int compareTo(Object o) {
return productName.compareTo(((inventorysupplystock2)
o).getName());
}
public void displayItems(){
System.out.printf( "%-2s %-2s %-2s
%-2s %.2f %.2f %.2f\n",
itemNumber, productGenre, productName,
quantityNumber, unitPrice, unitValue, restockingFee);
}
// total value per movie
public void setValue(double value){
unitValue = value;
}
public double getValue(){
return unitValue;
}
public void setRestockingFee(double restockingfee)
{
resstockingFee = (value * 5%)
} // end method setRestockingFee
// return restocking fee
public double getRestockingFee()
{
return restockingFee;
} // end method getRestockingFee
// caluculate value + restocking fee
public double total()
{
return restockingFee * Value;
} // end method total
public void setCount( int a ){
count = a;
}
// movie name
public void setName( String name ) {
productName = name;
}
public String getName() {
return productName;
}
// movie genre
public void setGenre( String genre ) {
productGenre = genre;
}
public String getGenre() {
return productGenre;
}
// item number
public void setNumber( double number ) {
itemNumber = number;
}
public double getNumber() {
return itemNumber;
}
// quantity of that movie
public void setquantity( double quantity ) {
quantityNumber = quantity;
}
public double getquantity() {
return quantityNumber;
}
// price for that movie
public void setPrice( double price ) {
unitPrice = price;
}
public double getPrice(){
return unitPrice;
}
}
*********************************************************************
import java.util.Scanner;
public class inventorysupplys2 { // start of class
public static void main(String[] args) { // start of program
Scanner input = new Scanner( System.in );
int c;
System.out.printf( "\n\nHow many new movies do you want to
enter? ");
c = input.nextInt();
input.nextLine();
inventorysupplystock2[] supply = new inventorysupplystock2[c];
String name; // for the name
String genre; // this should be the subclass genre
double number; // for the item number
double quantity; // number of units in stock
double price; // price per item
double value = 0; // value of that item
double totalValue = 0; // value of whole inventory
double restockingFee = 0; // this should be fo rthe restocking
fee
int a = 0;
int b = 0;
while (a < c){ // start of the loop getting the info for how
ever many you are putting in
supply[a] = new inventorysupplystock2();
supply[b] = new inventorysupplystock2();
System.out.printf( "What is the name of the movie being
entered: ");
name = input.nextLine();
supply[a].setName(name);
// you said i didnt need the extend keywrod
// so i have a feeling i am way off on this
System.out.printf( "What is the genre of the movie being
entered: ");
genre = input.nextLine();
supply[b].setGenre(genre);
System.out.printf( "What will be this movie's item number:
");
number = input.nextDouble();
input.nextLine();
supply[a].setNumber(number);
System.out.printf( "How many are you entering into stock:
");
quantity = input.nextDouble();
input.nextLine();
supply[a].setquantity(quantity);
System.out.printf( "How much did this movie cost: ");
price = input.nextDouble();
input.nextLine();
supply[a].setPrice(price);
System.out.printf( "How much is the restocking fee: ");
fee = input.nextDouble();
input.nextLine();
supply[a].setFee(fee);
value = supply[a].getquantity() * supply[a].getPrice();
supply[a].setValue(value);
supply[a].setCount(a);
// i could not get the restocking fee to work but i do know
its
// resstockingFee = (value * 5%) i just didnt know how to
do it over a/b
} // end of loop getting info
java.util.Arrays.sort(supply); //this sorts the stuff
System.out.printf( "Item number Genre Name Quantity Price
Value restockingFee\n");
a = 0;
while (a < c){ // total value of inventory
supply[a].displayItems();
totalValue += supply[a].getValue();
a++;
}
// total value
System.out.printf( "The total value of the inventory is: %.2f",
totalValue );
} // end of program
} // end of class