Allright i had a prompt to follow for my class and wrote upa regular file here is the prompt
4.
Implement a class Product. A product has a name and a price, for example:
new Product(“Toaster”, 29.95);
Supply methods getName(), getPrice(), and setPrice(double newPrice). Write a client program that makes two products, prints the name and price, and reduces their prices by $5.00, and then prints them again.
here is my original file
/*Product.java
*Author: Habeeb Syed
*/
public class Product //Creates a Product class
{
private String name;
private double price;
public Product(String aName, double initialPrice)
{
price = initialPrice;
name = aName;
price = 0.0;
}
public String getName() //Returns name of the product
{
String aName=name;
return name;
}
public double getPrice() //Returns price of the product
{
double initialPrice=price;
return price;
}
public double setPrice(double newPrice) //gives the new price of the product
{
price=newPrice;
return newPrice;
}
}
now I need to make a test class that does what the prompt states if neone can help me out it would be appreciated.