Analyze the following Java Program and complete the missing codes:
public class Tut1_17032021_Qb {
public static void main(String[] args){
String name;
String AssessedValueString;
String outputStr;
name = JOptionPane.showInputDialog("Enter Property Name and press ok!");
AssessedValueString = JOptionPane.showInputDialog("Enter Assessed value and press
ok!");
AssessedValue = Double.parseDouble(AssessedValueString);
TaxableAmount = AssessedValue*TaxablePercentage;
PropertyTax = (TaxableAmount/100)*TaxRate;
outputStr = "Property Name: " + name + "\n" + "Assessed Value: R " + AssessedValue + "\n"
+
"Taxable Amount: R " + TaxableAmount + " \n" + "Tax Rate for each R100.00:
" + TaxRate + "
\n" + "Property Tax : R " + PropertyTax;
JOptionPane.showMessageDialog(null, outputStr, "Mafikeng Local Municipality",
JOptionPane.INFORMATION_MESSAGE);
import javax.swing.*;
public class Tut1_17032021_Qb {
public static void main(String[] args) {
String name;
String AssessedValueString, TaxablePercentageString, TaxRateString;
String outputStr;
name = JOptionPane.showInputDialog("Enter Property Name and press ok!");
AssessedValueString = JOptionPane.showInputDialog("Enter Assessed value and press ok!");
double AssessedValue = Double.parseDouble(AssessedValueString);
TaxablePercentageString = JOptionPane.showInputDialog("Enter Taxable Percentage value and press ok!");
double TaxablePercentage = Double.parseDouble(TaxablePercentageString);
TaxRateString = JOptionPane.showInputDialog("Enter Tax Rate value and press ok!");
double TaxRate = Double.parseDouble(TaxRateString);
double TaxableAmount = AssessedValue * TaxablePercentage;
double PropertyTax = (TaxableAmount / 100) * TaxRate;
outputStr = "Property Name: " + name + "\n" + "Assessed Value: R " + AssessedValue + "\n" + "Taxable Amount: R " + TaxableAmount + " \n" + "Tax Rate for each R100.00: " + TaxRate + "\n" + "Property Tax : R " + PropertyTax;
JOptionPane.showMessageDialog(null, outputStr, "Mafikeng Local Municipality", JOptionPane.INFORMATION_MESSAGE);
}
}
Comments
Leave a comment