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.


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

Results 1 to 2 of 2

Thread: Help with Project

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Thanked 0 Times in 0 Posts

    Default Help with Project

    Hello everyone, This is my first time posting here.
    I have this assignment that is due this week. I am having a few issues with some of the aspects of the assignment.
    Here is a summary of the assignment

    You are a consultant for an IT consulting firm. You need a program that will calculate the invoice for a client and then print out an invoice to the screen. The consulting rate is $200 per hour.

    Your program should have the following options:
    1. Add Client
    2. Create Invoice
    3. Quit

    If the first option is selected the consultant will enter the clients name, id #, address and number of hours worked.

    If the second option is selected the consultant will be asked for a client's ID #. If the client exists then an invoice will be displayed to the screen that shows the client's Id#, address, name, the number of hours worked, the consulting rate, and the total amount of the bill. Also, include a tax rate of 8%. If the client does not exist then display a message to the screen telling the consultant that the client must be added before an invoice can be created for the client.

    You should be able to add multiple clients and create multiple invoices before quitting the program.

    You will need a client and an invoice class. Identify the attributes needed for the client class and the invoice class. You will need accessor, mutator methods, and constructors. Your invoice class will need to calculate the total price for the hours worked, the amount of tax owed, and return the total for your invoice.

    So far In the client class i have clientname,clientaddress,clientid,clienthours.
    In the invoice class I have payrate and taxrate.
    I think I may need to use arrays to store the values since it says that we should be able to add multiple clients and invoices.
    I also wanted to know how to loop the switch statement so that if you select 1 or 2 it continues to ask you to select an option.
    Here is some of the code that I have for the switch statements

    int select = scan.nextInt();

    case 1:
    System.out.println("Please enter the Client's Name: ");
    String name = scan.next();
    System.out.println("Please enter the Client's ID Number: ");
    int id = scan.nextInt();
    System.out.println("Please enter the Client's Address: ");
    String address = scan.next();
    System.out.println("Please enter the number of hours worked: ");
    double hours = scan.nextDouble();

    case 2:


    case 3:


    System.out.println("Invalid Selection, please select again.");

    Thank you for any help you can give.

  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Washington, DC
    My Mood
    Thanked 636 Times in 540 Posts

    Default Re: Help with Project

    Recommended reading: http://www.javaprogrammingforums.com...e-posting.html
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Uni project - help please :)
    By sameer in forum Java Theory & Questions
    Replies: 0
    Last Post: November 6th, 2010, 10:54 AM
  2. Project
    By Mac in forum What's Wrong With My Code?
    Replies: 15
    Last Post: June 4th, 2010, 04:39 AM
  3. help with project
    By pairenoid in forum Object Oriented Programming
    Replies: 1
    Last Post: May 7th, 2010, 08:55 AM
  4. Project - Please Help
    By toxikbuni in forum Java Theory & Questions
    Replies: 0
    Last Post: April 20th, 2010, 09:58 AM
  5. Can anyone help me on my project?
    By alesana514 in forum Paid Java Projects
    Replies: 1
    Last Post: December 16th, 2009, 09:24 AM