import java.util.Scanner
public class ping{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
int pball;
double fprice = 5.25;
double sprice = 3.75;
double tcost;
System.out.print("Number of PingPong Balls Purchased: ");
pball = input.nextInt();
if(pball>10)
tcost = pball *fprice;
System.out.print("The total cost is " + tcost);
if (pball <= 11){
tcost = pball *sprice;
System.out.print("The total cost is " + tcost);
; }
} public double compute(int pball, double fprice)
{
return pball * fprice;
}
public double compute1(int pball, double sprice)
{
return pball * sprice;
}
}
This post has been edited by eyeore: 19 November 2009 - 04:34 AM

New Topic/Question
Reply




MultiQuote






|