Answered You can hire a professional tutor to get the answer.

QUESTION

Java application program to calculate property tax. Prompt users for the number of properties. Prompt users for property tax.

Java application program to calculate property tax.

  1. Prompt users for the number of properties.
  2. Prompt users for property tax.
  3. Prompt users to input the value for each property
  4. Calculate the TOTAL amount of all property tax combined - Cant get it to multiply each property by property tax then combine all.
  5. User must press "E" to terminate the program.

package module3spl;

import javax.swing.JOptionPane;

public class module3spl {

 public static void main(String[] args) {

   String strNumberProperties ="";

   int intNumberProperties =0;

   double propertyTax=0.0;

   double totalPropertyTax=0.0;

   double totalPropertyValue=0.0;

   strNumberProperties = JOptionPane.showInputDialog("Enter the number of properties or E to exit program");//Prompt users for the number of properties.

   if(strNumberProperties.equalsIgnoreCase("E"))//User must press "E" to terminate the program

   {

     System.exit(0);

   }

   else

   {

     propertyTax=Double.parseDouble(JOptionPane.showInputDialog("Please enter property tax"));//Prompt users for property tax 

     intNumberProperties= Integer.parseInt(strNumberProperties);

     double[] propertyValue = new double[intNumberProperties];

     for(int i=0;i<intNumberProperties;i++)

     {

     propertyValue[i]=Double.parseDouble(JOptionPane.showInputDialog("Enter the value for property "+(i+1)));//Prompt users to input the value for each property 

     }

     for(int i=0;i<intNumberProperties;i++)//Calculate the TOTAL amount of all property tax combined

     {

     totalPropertyTax =totalPropertyTax+propertyTax; 

     totalPropertyValue=totalPropertyValue+propertyValue[i];

     }

     JOptionPane.showMessageDialog(null,"The total property value is "+(totalPropertyValue)+" and total property tax is "+(totalPropertyTax));

   }

 }

}

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question