Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Please help me with this Cashier program

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking Please help me with this Cashier program

    Write a java program that calculates the changes for a cashier. The program request the cost of the item. The Program then outputs the cost of the item including the sales tax. (use 6% as the sales tax value). The program next request is to receives the amount tendered by the customer, finally the program ouputs a summary of all figures, including the amount of change due to the customer.[/B]

    This is my code
    import java.io.*;
    public class Change{
    public static void main(String [] args)throws IOException{
    BufferedReader Stdin = new BufferedReader (new InputStreamReader(System.in));

    double cost;
    double tax;
    double payment;
    double getCost();
    double getTax();
    double getPayment();

    i need to apply these methods too:
    void setCost(double x)
    void setTax(double x)
    void setPayment(double x)

    using Peso currency and centavos
    Thank you,


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,130
    Thanks
    52
    Thanked 2,286 Times in 2,257 Posts

    Default Re: Please help me with this Cashier program

    Where are you having a problem?
    Make a list of the specific, detailed steps the program must do.
    Start at the first item in the list.
    Design and write the code for it, compile it, fix the errors, compile it, when no errors execute it to see what it does. You will need to add some println() statements to print out the values of variables to check if the code did the right thing.
    When that works, move to the next step in the list.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Invoke a Java program with windows program
    By jackhard in forum Object Oriented Programming
    Replies: 1
    Last Post: February 21st, 2013, 06:16 AM
  2. Program goes into infinite compilation. University project - Library Program.
    By clarky2006 in forum What's Wrong With My Code?
    Replies: 35
    Last Post: November 10th, 2012, 02:56 PM
  3. Replies: 1
    Last Post: July 8th, 2012, 10:23 AM
  4. how to run a java program..when the program using jar
    By miriyalasrihari in forum Java Theory & Questions
    Replies: 2
    Last Post: May 17th, 2012, 10:04 AM
  5. Help with class program!!! STUCK! Program not doing what I Want!!!
    By sketch_flygirl in forum What's Wrong With My Code?
    Replies: 7
    Last Post: April 4th, 2011, 07:29 AM