Modify the sales tax program to accept an arbitrary number of prices, total them, calculate the sales tax and print the total amount.

Ads
 

Modify the sales tax program to accept an arbitrary number of prices, total them, calculate the sales tax and print the total amount.

Modify the sales tax program to accept an arbitrary number of prices, total them, calculate the sales tax and print the total amount.
View Answers

November 4, 2011 at 5:46 PM

class salestax {

  public static void main (String[] args) {

      double total = 0;
      double price;

      int i = 0;
      while (i < args.length) {
        price = Double.valueOf(args[i]).doubleValue();
        total = total + price;
        i = i + 1;
      }
      double salestax = total * 0.0825;     
      System.out.println("Sales tax is " + salestax);

  }

}

Ads









Related Tutorials/Questions & Answers:
Modify the sales tax program to accept an arbitrary number of prices, total them, calculate the sales tax and print the total amount.
Modify the sales tax program to accept an arbitrary number of prices, total them, calculate the sales tax and print the total amount.  Modify the sales tax program to accept an arbitrary number of prices, total them, calculate
program to print total marks
program to print total marks  program to input total marks out of 600 marks as an argument and print the stream allotted using the following criteria 401 & above - PCM 301-400 - ZBC 201-300- Commerce 101-200 - Arts
Advertisements
How to write a program count total prices
How to write a program count total prices  Hi. all I've got a assignment to write a program that count total prices of 8 costumers. First class... stuck in count total prices of 8 costumers like in this picture ![alt text][1
How to write a program count total prices
How to write a program count total prices  Hi. all I've got a assignment to write a program that count total prices of 8 costumers. class... the number of cartons for Customer %s: ",counter); enterQ = input.nextInt
sales detail
be displayed. ? Calculate the cost of the garments as given below: Total cost...sales detail  creation of applet for sales deatils form the applet for Sales Details must include the following: ? The CartID, OrderNo, OrderDate
Java program to generate the total count
Java program to generate the total count  I need a java program which would take a text file as an input and scans through it to generate the output. For Ex. : If the text file contains the following information: There is/are 3
ModuleNotFoundError: No module named 'odoo8-addon-account-compute-tax-amount'
ModuleNotFoundError: No module named 'odoo8-addon-account-compute-tax-amount...: ModuleNotFoundError: No module named 'odoo8-addon-account-compute-tax-amount' How...-tax-amount' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'odoo8-addon-account-compute-tax-amount'
ModuleNotFoundError: No module named 'odoo8-addon-account-compute-tax-amount...: ModuleNotFoundError: No module named 'odoo8-addon-account-compute-tax-amount' How...-tax-amount' error? Thanks   Hi, In your python environment
tax calculation
tax calculation  I want you to write a program while take some amount and do the tax calculation Sr.No. Particulars Present Rate Amount in INR... will take 132.3 and give the tax amounts from that.... WAP a java program
Total Hours Calculation.
Total Hours Calculation.   Hi,How to calculate the total hours by startime and endtime.not railway time just only normal time.please help. Thanks
I am creating one jsp page in which I read in a text file, then display that data in tabular format. Now I need to calculate a total.
that data in tabular format. Now I need to calculate a total.  I am reading...;" + "<th> Batch Number </th>" + "<th> amount <...... } The output displays 4 rows and 2 columns. How can I calculate the total
ModuleNotFoundError: No module named 'total'
ModuleNotFoundError: No module named 'total'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'total' How to remove the ModuleNotFoundError: No module named 'total'
Sales Letters Write Services
Sales Letter Writing One of the best tips for sales letter writing... page is a nightmare of most of the writers and if it is writing for the sales copy... of effective sales letter writing have increased a lot. And demand of a skilled writer
ModuleNotFoundError: No module named 'sales_contacts'
ModuleNotFoundError: No module named 'sales_contacts'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'sales_contacts' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sales_menu'
ModuleNotFoundError: No module named 'sales_menu'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'sales_menu' How to remove the ModuleNotFoundError: No module named '
Sales Management
of sales team and assist them in case of any difficulty during achieving... of advertisement. Under sales promotional program, sales manager select what should... is responsible for the handling of sales management and leading sales team called
ModuleNotFoundError: No module named 'total-ordering'
ModuleNotFoundError: No module named 'total-ordering'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'total-ordering' How to remove the ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'tax'
ModuleNotFoundError: No module named 'tax'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'tax' How to remove the ModuleNotFoundError: No module named 'tax' error
ModuleNotFoundError: No module named 'tax'
ModuleNotFoundError: No module named 'tax'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'tax' How to remove the ModuleNotFoundError: No module named 'tax' error
ModuleNotFoundError: No module named 'fio_sales_reports'
ModuleNotFoundError: No module named 'fio_sales_reports'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'fio_sales_reports' How to remove the ModuleNotFoundError: No module
ModuleNotFoundError: No module named 'odoo11-addon-sales-team-security'
ModuleNotFoundError: No module named 'odoo11-addon-sales-team-security'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo11-addon-sales-team-security' How to remove
ModuleNotFoundError: No module named 'odoo12-addon-sales-team-security'
ModuleNotFoundError: No module named 'odoo12-addon-sales-team-security'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo12-addon-sales-team-security' How to remove
ModuleNotFoundError: No module named 'odoo12-addon-sales-team-security'
ModuleNotFoundError: No module named 'odoo12-addon-sales-team-security'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo12-addon-sales-team-security' How to remove
ModuleNotFoundError: No module named 'odoo8-addon-sales-team-security'
ModuleNotFoundError: No module named 'odoo8-addon-sales-team-security'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo8-addon-sales-team-security' How to remove
ModuleNotFoundError: No module named 'odoo9-addon-sales-team-multicompany'
ModuleNotFoundError: No module named 'odoo9-addon-sales-team-multicompany'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'odoo9-addon-sales-team-multicompany' How to remove
Total summay from a sale table
Total summay from a sale table  Total summay from a sale table
modify program
modify program  Hi how could I modify this program so that if I say... the information and would stop if no is selected.As the program is now if I say.... address 1: address 2: address 3: post code: code: quantity: the is the program
Java Applet - Adding a Button to Decrease a Total
it will count the total number of times you click the button. What I need is for their to be a second button that when clicked will decrease that total amount...); } public void paint(Graphics g) { g.drawString("Total: " + gettestone
What is total AWS EMR cluster price
What is total AWS EMR cluster price  Hi, I want to calculate the AWS EMR cluster usage price. How to calculate the price of AWS EMR Cluster? Thanks... python program to calculate the usage of aws emr cluster. It currently supports
ModuleNotFoundError: No module named 'location-history-total'
ModuleNotFoundError: No module named 'location-history-total'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'location-history-total' How to remove the ModuleNotFoundError
ModuleNotFoundError: No module named 'mantid-total-scattering'
ModuleNotFoundError: No module named 'mantid-total-scattering'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'mantid-total-scattering' How to remove the ModuleNotFoundError

Ads