Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Modify the sales tax program to accept an arbitrary number of prices, total them, calculate the sales tax and print the total amount.

Have Programming Question? Ask it here!
 
 
 


Lunakar Reddy
Modify the sales tax program to accept an arbitrary number of prices, total them, calculate the sales tax and print the total amount.
1 Answer(s)      2 years and 10 months ago
Posted in : Java Beginners


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

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

  }

}


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
Calculate Sales Tax using Java Program
Calculate Sales Tax using Java Program In this section, you will learn how to calculate the sales tax and print out the receipt details for the purchased... Products [y/n]: n 1 Chocolate at 15.75(including tax) Sales Taxes: 0.75 Total: 15.75
Advertisements
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
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
Calculate total number of elements remaining in the buffer.
Calculate total number of elements remaining in the buffer. In this tutorial, we will discuss how to calculate total number of elements remaining...     .println("Number of remaining elements 
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
how to calculate the employee tax - JSP-Servlet
how to calculate the employee tax  How to calculate the employee tax.Can u please send to me calculation tables
PHP Tax Calculator - PHP
PHP Tax Calculator  In my project i required a tax calculator that can calculate the property tax
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
Write a query to find the total number of rows in a table
Write a query to find the total number of rows in a table  Write a query to find the total number of rows in a table?   Hi, Here is the answer, we can find the total number of rows in a table using following query
calculate total hours by start time and end time in javascript - Ajax
calculate total hours by start time and end time in javascript  hi, i... well. i want to display total hours by using start and end timepicker. pls clarify my doubts. how to calculate total hours by using start and end time field
total id
total id  how to print and total my id number ..for example if my id is 0123456789 the output will look like this : 0123456789 0+1+2+3+4+5+6+7+8+9=45 help me plz
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
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
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
Find total disk space in PHP, php disk_total_space, disk_total_space
Learn How to Get the total disk space in PHP Program. In this PHP Tutorial example we will use the disk_total_space() function in our PHP code to find the total disk space. syntax disk_total_space() Function PHP disk_total_space
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
Retail Point Of sales (using jsp and servlet)
Retail Point Of sales (using jsp and servlet)  Hi, i want to know how... module which you can list all the available products to process sales on new sales... to start coding for processing sales thats the only missing on my project please
Total summay from a sale table
Total summay from a sale table  Total summay from a sale table
Travelling Sales MAn Using GA - IoC
Travelling Sales MAn Using GA  travelling sales man problem using ga first i have randomly select few cities which will be called population size ex 10 cities are there then all the possible combination will be 10
Sales System.. Need Help!! - Java Beginners
Sales System.. Need Help!!  were going to make a sales system in our subject Database management and that will be our project, we already have a company to use. But the problem is.. our group dont know how to start, we dont have
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
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 total lost data in hard drive
java total lost data in hard drive  please help me, i need java source code about total lost data in hard drive. how to find the total deleted data ih hard drive using java programming... this my project...pls help me
JAVA TOTAL LOST DATA IN HARD DRIVE
JAVA TOTAL LOST DATA IN HARD DRIVE  please help me, i need java source code about total lost data in hard drive. how to find the total deleted data ih hard drive using java programming... this my project...pls help me
java total lost data in hard drive
java total lost data in hard drive  please help me, i need java source code about total lost data in hard drive. how to find the total deleted data ih hard drive using java programming... this my project...pls help me
java total lost data in hard drive
java total lost data in hard drive  please help me, i need java source code about total lost data in hard drive. how to find the total deleted data ih hard drive using java programming... this my project...pls help me
Combine Two Tables(Purchase and Sales) and getting Current Stock
Combine Two Tables(Purchase and Sales) and getting Current Stock  How can i combine both the Tables and Getting Current Stock
Java file get total space
Java file get total space In this section, you will learn how to get the total...("C:"); long totalSpace = file.getTotalSpace(); System.out.println("Total Space = " + totalSpace + " bytes"); } } You can find the total space
Simple java program
marks up the prices of its items by 25%. Write a Java program that declares... variable named original_price 3. a double variable named sales_tax_rate.... the sales tax rate 5. the sales tax 6. the final price of the item (the final
Tutorial for total beginner in Java
Tutorial for total beginner in Java - Explains the Basics of Java programming language. This is a video tutorial for total beginner in Java. In this video... language. This video is for total beginner in Java which will teach how to create
Display total disk drive capacity
of this example depends upon number of drive you have and the total disk capacity...Description: This example will demonstrate how to get the total disk space... This method gets the total disk capacity in the bytes. Code
Finding Average in JSP
of the middle of the data set. The average value is the total amount divided by the total number of elements.   The code of the program is given below:    ...; Output of the program:   Download this example
Write a program to calculate factorial of any given number
program to calculate factorial of any given number. First of all define a class... Factorial Examples - Java Factorial Example to calculate factorial of any given number      
"$a dollars" or "{$a} dollars" to print out the amount of dollars.
"$a dollars" or "{$a} dollars" to print out the amount of dollars.  Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example
Total Quality Management
the success of a company, no company can ignore them for its survival... for your lapses. Total Quality Management (TQM) is a part of business management... identify their goals and then tries to fulfill them however customer satisfaction
Maximize Sales By Setting up Your Shopping Cart
Maximize Sales By Setting up Your Shopping Cart Setting up a shopping cart... have got your business right in line heading to make a good sales profit... the features which boost up your sales. One of the main features is the auto responders
What will be the total cost for Golden Triangle Package tour from Delhi
What will be the total cost for Golden Triangle Package tour from Delhi   Hi, Can anyone give me the idea about Golden Triangle Package tour cost from New Delhi? I want's to travel by car. Thanks
Calculation Example
; This Example shows, how to calculate using velocity. This code displays the product name and their price with the total amount...; total+=p.getPrice();   }   context.put("
Calculate factorial of a number.
Calculate factorial of a number.  How to calculate factorial of a given number?   import java.io.BufferedReader; import java.io.IOException...("Please Input Any Number"); int num = 0; BufferedReader br = new
print square of any number
print square of any number  using c++ language, write aprogram to print the square of any number entered by the user
write a java program to print marklist of "n " students. input Register number, name and marks of three subjects.
write a java program to print marklist of "n " students. input Register number, name and marks of three subjects.  write a java program to print marklist of "n " students. input Register number, name and marks of three subjects
How to calculate number of weeks in a specified month
How to calculate number of weeks in a specified month  I am create one program that contain three combo box. 1.cmbyear 2.cmbmonth 3.cmbweek i am select year and month. then automatically calculate number of weeks in a specified
total time calculator (starttime+endtime) in servlet USING DATABASE IN SQL2000 PLZ ANY ONE HELPME
total time calculator (starttime+endtime) in servlet USING DATABASE IN SQL2000 PLZ ANY ONE HELPME   <%-- Document : insertdate Created on : Jul 19, 2013, 3:48:28 PM Author : CG0T4908 --%> <
Prime Number program in Java
Prime Number program in Java will print the prime numbers between 1 to any given number. Prime Number is a number that is not divisible by any number other than 1 or itself. Similar logic is used in program will displaying the result
accept sentence from user and print all word starts with vowel and end with consonent
accept sentence from user and print all word starts with vowel and end with consonent  Write a program to accept a sentence. Print all the words that starts with vowel and end with a consonant. e.g. input by user "the purpose
Sales Marketing Job
Sales Marketing Job      ... potential agents and distributors and initiating business with them. Good... acumen and ability to close deals in B2B environment. Passion for Sales &
Need someone to check and modify my simple code - Java Beginners
Need someone to check and modify my simple code   How to write a class that contains Variables that hold hourly rate of pay, number of hours worked. Display gross pay, withholding tax, which is 15% and net pay. I have tried
 

 

 

DMCA.com