# Program should read in a file called “sales.txt”

Program should read in a file called “sales.txt”. The contents of the text file are below. Create the sales.txt file with the following data: 10 100.00 9 18.18 100 50.00 64 121.22 560 1020.00 Read in all data from the file. (refer to pages 102-103) Sore units in integers and store sales in doubles. The first integer is the first unit sales. The first double is the first \$ of all the sales combined. This continues through all five units. Utilize a constant called taxRate to hold the tax rate of 8.5%. Output the following items per the sample below: Total Unit Sales (the sum of all units) Total Sales (the sum of all sales) Total Tax (rounded) (sales times taxRate) Type cast to int * 100, then double / 100. Total Sale (not rounded) (sales plus tax) Output results in table format using the escape character for a tab as shown in the sample. Round the sales tax using basic math to round it. Do NOT use printf or any rounding function to perform this. Here is a few hints that I got. So the tax rate is a double as you know. What you need to do is convert it to an integer first by multiplying by 100 and storing as integer. Then convert it back to a double and store it as a double. What this does is round it by getting rid of anything that is going to be over 2 decimal places. This is what I have so far. I just need the Total Tax and Total Sales . This is what I have so far. import java.util.Scanner; import java.io.File; public class SalesTax { public static void main (String[] args) throws Exception { //Scanner stdIn = new Scanner(System.in); Scanner stdIn = new Scanner (new File (“sales.txt”)); int fUnit = stdIn.nextInt(); // First number of units double fPrice = stdIn.nextDouble(); // First Unit Price int sUnit = stdIn.nextInt(); // Second number of units double sPrice = stdIn.nextDouble(); // Second Unit Price int tUnit = stdIn.nextInt(); // Third number of units double tPrice = stdIn.nextDouble(); // Third Unit Price int foUnit = stdIn.nextInt(); // Fourth number of units double foPrice .nextDouble(); // Fourth Unit Price int fiUnit = stdIn.nextInt(); // Fifth number of units double fiPrice .nextDouble(); // Firth Unit price double taxRate= 0.085; double TotalSales = (fPrice + sPrice+ tPrice + foPrice + fiPrice); double TotalTaxes = (TotalSales * taxRate); double GrandTotal = (TotalSales + TotalTaxes); System.out.println(“TotalUnits = t” + (fUnit + sUnit + tUnit + foUnit + fiUnit)); System.out.println(“TotalSales = t\$” + (fPrice + sPrice+ tPrice + foPrice + fiPrice)); System.out.println(“TotalTaxes =t\$” + (TotalSales * taxRate)); System.out.println (“GrandTotal=t\$” + (TotalSales + TotalTaxes));// end main// SalesTax

Pages (550 words)
Approximate price: -

Quality Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Qualified Writers

We have hired a team of professional writers experienced in academic and business writing. Most of them are native speakers and PhD holders able to take care of any assignment you need help with.

Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account.

Prompt Delivery

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. We will always strive to deliver on time.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text.

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

## Calculate the price of your order

Total price:
\$0.00

How it works?

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

If you are looking for exceptional academic writing services, then you are in the right place. Studyacer offers customised academic assignments and academic papers for students at all levels.

## Essay Writing Help

Writing an essay can be a challenge. However, we know what every student needs. And we purpose to deliver. Here at StudyAcer, we do all we can to help with academic essays and assignments. We have a dedicated team of professional essay writers.

Assignment Help

We understand students need satisfactory results. Our cheap assignment writing service helps and never leaves any doubt. We always strive to ensure the ultimate and best results. It is our joy to offer a cheap reliable essay writing service.

Term Paper Help

Have you been asking yourself, where can get a pre written research papers for sale? Worry no more, the fact that you have a term paper that is due tonight and you haven’t touched it. At Study Acer it is our responsibility to get your paper on time.

Dissertation Writing Service

Several master’s students seek professional help with their thesis.Students from different parts of the world experience different challenges. Dissertations have different stages and the challenges are different too. Do not struggle in silence, order now .