Please Help With This Programming Assignment Here Is The Code Below?

import javax.swing.*;
class Sales{
private double price;
private double commissionRate;
private double discountRate;
private double finalPrice;
public Sales(){
double price = 0;
double commissionRate = 0.0;
double discountRate = 0.0;
double finalPrice;
}
public Sales(double pirce,double commissionRate,double discountRate,double finalPrice){
super();
}
public void setPrice(double price)
{this.price = price;}
public void setCommissionRate(double commissionRate)
{this.commissionRate = commissionRate;}
public void setDiscountRate(double discountRate)
{this.discountRate = discountRate;}
public double getPrice()
{return price;}
public double getCommissionRate()
{return commissionRate;}
public double getDiscountRate()
{return discountRate;}
public static void main(String[] args) {
double price = 0;
double commissionRate = 0.0;
double discountRate = 0.0;
double finalPrice;
finalPrice = calculation(price, commissionRate, discountRate);
System.out.println(“Final Price: ” + finalPrice);
}
private static double calculation(double price, double commissionRate, double discountRate) {
double finalPrice;
double priceWCommission = price + (price * (commissionRate / 100));
finalPrice = price – (priceWCommission * (discountRate / 100));
JOptionPane.showInputDialog(“Please enter price”, + price );
JOptionPane.showInputDialog(“please Enter CommissionRate”,+ commissionRate);
JOptionPane.showInputDialog(“Please enter discount Rate”,+ discountRate);
JOptionPane.showMessageDialog(null,fin…
return finalPrice;
}
}
the code dosent return the correct answer

Both comments and pings are currently closed.

Comments are closed.

Powered by WordPress | Designed by: free css template | Thanks to hostgator coupon and web hosting reviews