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: Writing a Driver Program to interact with a Class?

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

    Default Writing a Driver Program to interact with a Class?

    So I have a project that's due soon, and I'm really not sure where to start. Below are the requirements for my project, and I really have no idea what they mean. So if someone could please look through it and kinda give me an overview of what I need to do that would be great. Thanks so much. (Also, if needed I can attach the Files provided to me for this project.)

    CSCI-1250 Project 4
    Check the course calendar in D2L for the due date
    You are to write a driver program that will interact with the CustomerOrder class to process a customer’s order. Your program is to interact with the user by getting all customer input related to the order. It should then use the CustomerOrder class to store the information and get information back related to the order for display to the user. Ultimately, you will be asking for the order information and displaying their order results to the screen in the form of a bill statement as shown in the screen shot below. While your output does not need to look exactly like what is shown, it should have the same information and should be displayed in a neat, readable format with all currency formatted to 2 decimal places.
    Example output for a customer order once it has been processed:

    What you have been given:
    • UML diagram for the CustomerOrder class
    • The javadocs for the CustomerOrder class
    • The .class file for the CustomerOrder class (necessary to be able to interact with it since you are not being given the CustomerOrder.java file. This file MUST be placed in your project 3 folder with your Project3.java file in order for it to work.)
    What you need to submit:
    • A LastnameFirstnameProject4 folder, zipped, with the following inside:
    o Project4.java, Project4.class
    o CustomerOrder.class
    o Javadocs for CustomerOrder and Project4.java
    o CustomerOrder UML diagram modified to show your Project4 class interacting with the CustomerOrder class
    • A hard copy of your driver program source code (Project4.java)
    Driver program details:
    Your program should provide all input and output interaction with the user. You will prompt for the following information:
    • Customer name (last name). MUST BE AT LEAST 4 CHARACTERS LONG. Prompt should indicate to the user that if it isn’t, they should add X’s to the end.
    • Customer phone number (in the format ###-####). MUST BE IN THIS FORMAT. Prompt should make this clear to the user.
    • Number of gadgets being ordered
    • Number of widgets being ordered
    • Shipping option (check the javadocs for CustomerOrder to see what the available options are). Prompt should make clear to the user their options for shipping.
    • Taxable option (check the javadocs for CustomerOrder to see what the available options are). Prompt should make clear to the user their option of tax status.
    • Discount code (check the javadocs for CustomerOrder to see what the available options are). Prompt should make clear to the user their options for a discount.
    • Note: you will NOT be prompting the user for the customer number. That will be automatically generated by the CustomerOrder class.
    Once you have all of the required order information, you should store that information in an object of the CustomerOrder class using the appropriate methods. At that point, you can begin to process the order and display the final bill to the user. You may not do any calculations in your driver program. All of the functionality is provided in the CustomerOrder class. You are to call the appropriate methods to get the information that you need in order to display the bill to the customer.
    Note: There is one method in the CustomerOrder class that may not be used at this point. It is the toString method. It has been provided for functionality later on, but may not be used in this assignment.

    The following should be the last thing you add to your program because we will not be covering this until you have already started working on your program…
    Once the program has displayed the bill to the customer, it should ask the user if they would like to place another order. If they answer yes, your program should repeat from the beginning. This should continue until the user indicates that they have no more orders to place.

    UML Diagram for the CustomerOrder class

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Eastern Florida
    Thanked 2,417 Times in 2,370 Posts

    Default Re: Writing a Driver Program to interact with a Class?

    You'll get more responses if you make some effort.
    Do you have any specific questions about your assignment?
    Please post your code and any questions about problems you are having.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Class Driver help
    By Kseidel in forum Object Oriented Programming
    Replies: 2
    Last Post: November 2nd, 2012, 01:06 PM
  2. [SOLVED] Help with creating a class and driver
    By JackCannon15 in forum Object Oriented Programming
    Replies: 1
    Last Post: October 27th, 2011, 03:50 PM
  3. [SOLVED] Project help...confusion with changing a getter/setter for a driver class
    By coolidge in forum Java Theory & Questions
    Replies: 1
    Last Post: September 30th, 2011, 11:08 PM
  4. [SOLVED] Writing a program with arrays and class methods... PLEASE HELP?
    By syang in forum What's Wrong With My Code?
    Replies: 17
    Last Post: August 8th, 2011, 07:02 AM
  5. Link From A Driver Class To The Subclasses
    By angels in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 29th, 2011, 07:39 AM