# 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 PriceCalculator{
public void method(double quantity)
{
double result;
if(quantity < 5)
{
result = 2.00*quantity;
System.out.printf(" is: %s",result);
}
if(quantity >= 6 & quantity <= 10)
{
result = 2.00*quantity*95/100;
System.out.printf(" is: %s",result);
}
if(quantity >= 11 & quantity<= 15)
{
result = 2.00*quantity*90/100;
System.out.printf(" is: %s",result);
}
if(quantity >= 16 & quantity<= 20)
{
result = 2.00*quantity*85/100;
System.out.printf(" is: %s",result);
}
if(quantity >20)
{
result = 2.00*quantity*80/100;
System.out.printf(" is: %s",result);
}
}
}

Second class
import java.util.Scanner;
public class PriceCalculatorTest{
public static void main(String[] args){
double enterQ;
System.out.println("*****WELCOMETO PRICE CALCULATOR FOR PURCHANGSING MILKS*****");
for(int counter = 1; counter <=8; ++counter)
{
Scanner input = new Scanner(System.in);
PriceCalculator m = new PriceCalculator();
System.out.printf("Enter the Name for Customer %s: ",counter);
String name = input.nextLine();
System.out.printf("Enter the number of cartons for Customer %s: ",counter);
enterQ = input.nextInt();
System.out.printf("The price for Customer - %s",name);
m.method(enterQ);
System.out.println();
System.out.println("---------");

}

}
}
```

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 PriceCalculator{ public void method(double quantity) { double result
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
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
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
how to write this program
how to write this program  Write a program in java which calculates... + Class2Hours *Class2GPA +â�?�¦ +Class6hours * Class6GPA) / Total Hours For this program... or numerical grade. You will be submitting TWO versions of this program. Write one
How to write Java Program
How to write Java Program  how to write a program to find average of 5 student marks
How to write calculator in J2ME program?
How to write calculator in J2ME program?  How to write calculator in J2ME program
how to write servlet program in eclipse?
how to write servlet program in eclipse?  how to write servlet program in eclipse
how to write a program to search a record using mvc2
how to write a program to search a record using mvc2   how can we write a code to search a record in table by using java bean as model, servlet as contoller and jsp as view
how do i write a java program for this??
how do i write a java program for this??  �??Ask the user if they have a dog. If �??yes�??, ask the user how old is and compute the dog�??s age... in your program
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
write a program
write a program  write a program add 2 no.s without use arithmetic,unary operaters in java
How to write program to show status of seats(i.e.free or reserve) in java?
How to write program to show status of seats(i.e.free or reserve) in java?  I have retrieved data from database table and I want to display status of seats i.e.free or reserved
how can i write this program ?please suggest me
how can i write this program ?please suggest me  Program to calculate the sum of two big numbers (the numbers can contain more than 1000 digits). Don't use any library classes or methods (BigInteger etc
how to write to java program to get the particular data from the website
how to write to java program to get the particular data from the website   i have to get the particular data by selecting the just numbers.. from the site .. how to get the ful details from the website by clicking the number
How to Write a Calculator Program in Java?
How to Write a Calculator Program in Java? In this Java Tutorial you will learn how to write a Calculator program in Java in easy steps. Calculator program..., subtraction, multiplication or division. In this example of writing program in Java
how to write a program in java to print numbers in equalateral triangle
how to write a program in java to print numbers in equalateral triangle  the output must be 1 324 76589   Here is an example of pattern 1 2 3 4 5 6 7 8 9 Example: public class NumberTriangle{ public
How do I write a program to manage an employee's business and personal contacts?
How do I write a program to manage an employee's business and personal contacts?  A. Input Requirements 1. Include a prompt that allows the user to enter a command from the following four options, repeating the process
write a java program
write a java program  write a program to print '*' in a circular form
How to write hello world example program in Hibernate?
How to write hello world example program in Hibernate? Hello World tutorial is first example program for a beginners leaning Hibernate ORM language... is for beginners which teaches you to write code for inserting data in the database
Write a java application program........?
Write a java application program........?  Welcome every One : I have Q in Java? Q : Write a java application program that reads 20 integer numbers input by the user and prints how many numbers > 100 and how many numbers
WRITE A PROGRAM IN JAVA
WRITE A PROGRAM IN JAVA  Write program which accepts five students id,name,age,department,courses, taken and its grade. a. calculate its GPA . display all student information in ascending order
write the java program?
write the java program?  1 11 121 1331 14641 15101051
write the java program?
write the java program?  1 11 121 1331 14641 15101051
Write java program?
Write java program?  1 11 121 1331 14641 15101051
Write java program?
Write java program?  1 11 121 1331 14641 15101051
write a program to print
write a program to print   write a program to print following 1 2 3 4 5 4 3 2 1 1 2 3 4 4 3 2 1 1 2 3 3 2 1 1 2 2 1 1 1
WRITE A PROGRAM IN JAVA
WRITE A PROGRAM IN JAVA  How do I write a program in Java, have the program display a message with your name in it and a number (Hello john Smith!1) The number must increment from zero to nine, or decrement fron nine to zero. You
How can I write a GUI stack program by Java to push Image files instead of other data type items?
How can I write a GUI stack program by Java to push Image files instead of other data type items?   How can I write a GUI stack program by Java to push Image files instead of other data type items? for the push instruction I
Write a program in java...
Write a program in java...  Hi, friends Please, can you help me? Q1: Write a program in java to simulate a calculator. Your program should take two... to enter an integer number. Write a program in java to find the factorial
Java Count Vowels
Java Count Vowels       In this program you will learn how to count vowels in a String. Here you... the number of vowels from that String. Description of the code: In the program code