Hy Friends,
Have to submit a small routine program.
So this is how it goes:
There are soaps on the shelves.
One soap costs $1 and the next soap costs $1.2 until no money is left in the pocket
Each soap is 20% more in price than the previous one.
The Customer has $200 in his pocket.
So now im suppose to calculate the total soaps purchased by the customer , the total cost of the soaps and the total change remaining for the customer.
Please Help as i am suppose to submit it by tomorrow.
Thanks.
This is the code i have worked on so far:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Monetary_Calculation;
import java.util.Scanner;
/**
*
* @author SaguWesker
*/
public class Foobar_Calculator
{
public static void main(String args[])
{
Scanner Foobar_Calculator = new Scanner(System.in);
double pocket_money , percentage_value = 0.2 , total_foobars , foobar_price = 1 , total_cost = 0;
System.out.println("Please Enter The Amount You Have " + "\n$ ");
pocket_money = Foobar_Calculator.nextDouble();
do
{
total_cost = pocket_money - (foobar_price + foobar_price);
System.out.println("The Total Cost For The Foobars is $" + total_cost);
}
while(total_cost < pocket_money);
{
}
}
}