# Trying to figure out next step

• September 17th, 2013, 06:48 PM
lg28
Trying to figure out next step
I am trying to create a stand-alone app that calculates the sales tax for products input by the user. I'm not sure if I'm supposed to have it in a frame, or what I'm missing to complete the process.
Code Java:

```//Sales Taxes Calculator   package SalesTaxesApp;   import.java.util.Scanner; import.java.util.Arrays;   public class SalesTaxApp{ public static void main(String[] args) class tax{ int qty=0; String prodName="null"; float price="false"; boolean imported="false"; boolean basic="false"; float tax=0.0f;   void calculateTaxes(){ float totalTax=0.0f; if (imported) totalTax=0.05; if (basic) totalTax=0.1; if (imported)&&(basic) totalTax=0.15; tax=price*totalTax; } public String toString(){ float p=price+tax; return qty+""+prodName+":"+p; } } public class SalesTax{ public staic void main(String[] args) throw Exception{ SalesTax st=new SalesTax(); Scanner input=new Scanner(System.in); ArrayList list= new ArrayList(); int no=1; while (true){ Tax tax=new Tax(); System.out.print("Quantity:") int qty=input.nextInt(); tax.qty=qty; System.out.print("Product:"); String prod=input.net(); tax.prodName=prod; System.out.print("Price:"); float p=input.nextFloat(); tax.price=p; System.out.print("Product Imported[y/n]:"); String imp.=input.next(); if (imp.toLowerCase().equals("y")) tax.basic=true; tax.calculateSalesTaxes(); list.add(tax); no++; System.out.print("Additional Products[y/n]:"); String add=input.next(); if(add.toLowerCase().equals("n")) break; } float tp=0.0f; float tt=0.0f; for (int i=o; i<list.size(); i++{ Tax tax=list.get(i); tp+=tax.price; tt+=tax.tax; System.out.print(tax); } System.out.println("Sales Tax:"+tt); System.out.println("Total:"+(tt+tp); } }```
• September 17th, 2013, 08:12 PM
Junky
Re: Trying to figure out next step
If this is an assignment then the instructions will tell you.

If this is your own pet project you decide if you need a GUI or not.
• September 17th, 2013, 09:04 PM
lg28
Re: Trying to figure out next step
fair enough. Am I at least correct with what I have thus far?
• September 17th, 2013, 10:11 PM
Junky
Re: Trying to figure out next step
I have no idea. Does it compile? Does it run? Does it display correct output?