I seem to really be lost. I have included the instructions for this problem, for you clarity only. I'm not asking you to do the work.I really want to learn java. I have read this complete chapter Three times now and seem to not be getting through my thick skull what I should add to this code from the second file (shown below).If you could show me the syntax for calling the setter/getters and how to implement the first if statement. I think i could finish the project.
A software company sells a package that retails for $99. Quantity discounts are given according to the following table:
Quantity Discount
10–19 20% 20–49 30% 50–99 40% 100 or more 50%
Design a class that stores the number of units sold and has a method that returns the total cost of the purchase.
import java.util.Scanner;
class SoftwareSales {
public static void main(String[] args) {
// Data Members
String software, discount, or, more;
double sales, product, units, number;
Scanner keyboard = new Scanner(System.in);{
System.out.print("Please enter the number of units sold.");
keyboard.nextDouble();
import java.util.Scanner;
class SoftwareSales {
public static void main(String[] args) {
// Data Members
String software, discount, or, more;
double sales, product, units, number;
sales = 99;
Scanner keyboard = new Scanner(System.in);{
System.out.print("Please enter the number of units sold.");
keyboard.nextDouble();
if (units < 10)
(units * sales);
else if (units > 9 && < 20)
(99 - (99 * 0.2));
else if (units > 19 && < 50)
(99 - (99 * 0.3));
else if (units > 49 && < 100)
(99 - (99 * 0.4))
else if (units > 99)
(99 -(99 * 0.5;)
}
I'm missing something here and cant figure out what it is. Please Help!
Including class file:
import java.util.Scanner;
public class SoftwareSales {
// Data Members
private String software, discount, or, more;
private double sales, product, units, number;
//Constructor
public SoftwareSales(String software, String discount, String or, String more, double sales, double product, double units, double number){
sales = sales;
product = product;
units = units;
number = number;
software = software;
discount = discount;
or = or;
more = more;
}
//Methods
public double getSales() {
return sales;
}
public double getProduct() {
return product;
}
public double getUnits() {
return units;
}
public double getNumber() {
return number;
}
//Mutator Methods
public void setSales (double sales) {
sales = sales;
}
public void setProduct(double product) {
product = product;
}
public void setUnits(double units) {
units = units;
}
public void setNumber(double number) {
number = number;
}
}