Answer to Question #315491 in Java | JSP | JSF for isaac

Question #315491

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);


 


1
Expert's answer
2022-03-22T03:58:38-0400
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);
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS