Driving me crazy!!!! Please help!!
Please help I need this code is print the following:
These are the current items on hand: Jacket, Designer Jeans & Shirt
Here is the current stock on each item: Jacket:12 Designer Jeans:40 Shirt:20
Below you will find the current item prices: Jacket:59.95 Designer Jeans:34.95
Shirt:24.95
This is what it is saying right now:
These are the current items on hand:
Here is the current stock on each item: Jacket:12 Designer Jeans:40 Shirt:20
Below you will find the current item prices: Jacket:59.95 Designer Jeans:34.95
Shirt:24.95
HERE IS THE CODE:
1 OF 2
public class RetailItem {
private String description1;
private String description2;
private String description3;
private int unitsOnHand1;
private int unitsOnHand2;
private int unitsOnHand3;
private double retailPrice1;
private double retailPrice2;
private double retailPrice3;
public RetailItem (String item1,String item2,String item3, int onHand1,int onHand2,int onHand3, double price1, double price2, double price3) {
description1 = item1;
description2 = item2;
description3 = item3;
unitsOnHand1 = onHand1;
unitsOnHand2 = onHand2;
unitsOnHand3 = onHand3;
retailPrice1 = price1;
retailPrice2 = price2;
retailPrice3 = price3;
}
public void setDescription(String item1,String item2,String item3)
{
description1 = item1;
description2 = item2;
description3 = item3;
}
public void setUnitsOnHand(int onHand1,int onHand2,int onHand3)
{
unitsOnHand1 = onHand1;
unitsOnHand2 = onHand2;
unitsOnHand3 = onHand3;
}
public void setRetailPrice(double price1,double price2, double price3 )
{
retailPrice1 = price1;
retailPrice2 = price2;
retailPrice3 = price3;
}
public String getDescription1()
{
return description1;
}
public String getDescription2()
{
return description2;
}
public String getDescription3()
{
return description3;
}
public int getUnitsOnHand1()
{
return unitsOnHand1;
}
public int getUnitsOnHand2()
{
return unitsOnHand2;
}
public int getUnitsOnHand3()
{
return unitsOnHand3;
}
public double getRetailPrice1()
{
return retailPrice1;
}
public double getRetailPrice2()
{
return retailPrice2;
}
public double getRetailPrice3()
{
return retailPrice3;
}
}
2 OF 2:
import java.util.Scanner;
public class RetailItemTest
{
public static void main(String [] args)
{
String testItem1;
String testItem2;
String testItem3;
int testOnHand1 = 12;
int testOnHand2 = 40;
int testOnHand3 = 20;
double testPrice1 = 59.95;
double testPrice2 = 34.95;
double testPrice3 = 24.95;
Scanner keyboard = new Scanner(System.in);
System.out.print("These are the current items on hand: ");
testItem1 = keyboard.nextLine();
testItem2 = keyboard.nextLine();
testItem3 = keyboard.nextLine();
System.out.print("Here is the current stock on each item: Jacket:" + testOnHand1 + "\nDesigner Jeans:" + testOnHand2 +
"\nShirt:" + testOnHand3);
System.out.print("Below you will find the current item prices: Jacket:" + testPrice1 + "\nDesigner Jeans:" + testPrice2 +
"\nShirt:" + testPrice3);
}
}