Part 1

Using Java and the concepts covered in the reading, implement your class diagram. Your application will use the Accounts inheritance hierarchy designed in the Discussion Board. There are three types of sales accounts that track sales for your company: supplies, services, and paper. Create a test class that tests each subclass's constructor and display each instance created. Override the toString() method so that your object data is printed.

Select a name for your company and start a design document. You will add to this document as you move through this course, which will culminate into the Final Key Assignment. For now, include your UML class diagram and verbiage that explains your design.

Part 2

Modify your implemented classes to include the overridden method, computeSales(), that computes the current sales in each of the following categories:

  • Supplies = office supplies sold dollar amount + books sold dollar amount + apparel sold dollar amount
  • Services = number of hours * rate per hour
  • Paper = number of pounds * price per pound
  • Modify your pseudocode from the Phase 2 Discussion Board to include any improvements that were suggested through the discussion. Update your design document with these improvements. Implement your sales tracker application.
  • Implement your sales tracker application according to your pseudocode.
  • Test your application, and provide screenshots demonstrating that your application runs.

Intermediate-level Java programming should be demonstrated in your application:

  • There should be implemented constructors for each class.
  • The toString() method should be overridden to provide readable string representation of each object.
  • Getters and setters need to be implemented to enforce data hiding.
  • Code should be fully commented.
  • Program flow should be logical.
  • Behavior should be encapsulated into methods avoiding all encompassing large main() methods.
  • Projects should be developed in NetBeans and zipped prior to submission.
  • Code should compile and run free of exceptions, indicating that debugging tools were used to eliminate any run time errors.

Part 3

Modify your Account superclass so that it is abstract and contains the abstract method, computeSales(). If you added default behavior in the earlier task for computeSales(), remove this default behavior.

Leave your implementation of computeSales() in the subclasses as:

  • Supplies = office supplies sold dollar amount + books sold dollar amount + apparel sold dollar amount
  • Services = number of hours * rate per hour.
  • Paper = number of pounds * price per pound
  • Update your design document so that the UML class diagrams reflect the abstract class and abstract method.
  • Modify your application so that it polymorphically processes any account objects created. Store each account object created into an array of type Account. For each element in this array, call the computeSales() method and display the results. Use the example of polymorphically processing employee objects in Chapter 10 as inspiration.
  • Test your application and verify your results. Take screenshots to demonstrate that your application works.

Intermediate-level Java programming should be demonstrated in your application:

  • There should be implemented constructors for each class.
  • The toString() method should be overridden to provide readable string representation of each object.
  • Getters and setters need to be implemented to enforce data hiding.
  • Code should be fully commented.
  • Program flow should be logical.
  • Behavior should be encapsulated into methods avoiding all encompassing large main() methods.
  • Projects should be developed in NetBeans and zipped prior to submission.
  • Code should compile and run free of exceptions, indicating that debugging tools were used to eliminate any run time errors.

Part 4

It is time to complete your sales tracker application. Your marketing department would like the current dollar amount of goods sold this year to be calculated. Total of the goods sold is the combined total of supplies, services, and paper sold, for all sales accounts. This information will be used to promote the success of the company.

Your application needs to be modified to allow all sales personnel to enter their sales data.

For each sales personnel in the company, complete the following:

  • F1: Accept a sales person's entry for the dollar amount of office supplies sold, books sold, and apparel sold.
    • The sum of these three categories will be the total of their supplies sold.
  • F2: Accept a sales person's entry for the number of hours of service hours sold and rate per hour.
  • F3: Accept a sales person's entry for the number of pounds of paper sold and the price per pound.
  • Displays the total current sales to date in all 3 categories for the sales person: supplies, books, and paper.
  • Modify the application to display the total aggregate sales for all sales personnel combined.
    • Example: Total sales for 2010: $12,500,552

Your application will use the Accounts inheritance hierarchy designed previously to compute the total of goods sold.

There are three types of sales accounts that track sales for your company:

  • Supplies
  • Services
  • Paper.

Each has their own formula for computing the current sales:

  • Supplies = office supplies sold dollar amount + books sold dollar amount + apparel sold dollar amount
  • Services = number of hours * rate per hour
  • Paper = number of pounds * price per pound
  • Update your design document with these modifications

Intermediate-level Java programming should be demonstrated in your application:

  • There should be implemented constructors for each class.
  • The toString() method should be overridden to provide readable string representation of each object.
  • Getters and setters need to be implemented to enforce data hiding.
  • Code should be fully commented.
  • Program flow should be logical.
  • Behavior should be encapsulated into methods avoiding all encompassing large main() methods.
  • Projects should be developed in NetBeans and zipped prior to submission.
  • Code should compile and run free of exceptions, indicating that debugging tools were used to eliminate any run time errors.

Preparation for what will be submitted in Discussion Board - Key Assignment Draft:

Update your design document with any final changes. Your design document must include at a minimum:

  • Functional requirements.
  • Class diagrams used to describe the system.
  • Description of any design requirements imposed by your technical leadership.
  • Pseudocode for application.

Part 5

Your company is ready to market their ability to sell goods. You will need to create a graphic that includes a business logo and a dollar amount of current sales. Your logo must include at least 1 shape, defined by a geometric path, using class GeneralPath, and the name of your business. Although the logo may be a compilation of shapes, including basic shapes provided by the Graphics class (i.e., rectangle, polygon, oval, arc or line), the logo must contain at least 1 shape that is not a basic shape and the name of the business. You want to impress your customers; therefore, your logo will flash on and off at a smooth rate, like a neon sign.

Current dollars in goods sold this year should also be displayed in the graphic. Your application will use the Accounts inheritance hierarchy designed previously to compute the total of goods sold. There are 3 types of sales accounts that track sales for your company: supplies, services, and paper.

Each sales account has its own formula for computing the current sales:

  • Supplies = office supplies sold dollar amount + books sold dollar amount + apparel sold dollar amount
  • Services = number of hours * rate per hour
  • Paper = number of pounds * price per pound

Intermediate-level Java programming should be demonstrated in your application:

  • There should be implemented constructors for each class.
  • The toString() method should be overridden to provide readable string representation of each object.
  • Getters and setters need to be implemented to enforce data hiding.
  • Code should be fully commented.
  • Program flow should be logical.
  • Behavior should be encapsulated into methods avoiding all encompassing large main() methods.
  • Projects should be developed in NetBeans and zipped prior to submission.
  • Code should compile and run free of exceptions, indicating that debugging tools were used to eliminate any run time errors.

It is important to keep the design document up-to-date. Please add the pseudocode developed for the drawing of the logo in the Phase 5 Discussion Board to your design document.

Competency Test

The second part of the key assignment is a competency test that will test you on UML; inheritance and polymorphism; Java API class libraries; Java 2-D graphics with Java API methods, properties, and events; and debugging tools. Answer each question True or False.

1.Java supports multiple inheritance.

2.To say that class B extends from class A is to say that class B inherits from class A.

3.Inheritance, in UML 2.0, is denoted by a solid line drawn from the child class with a closed, unfilled arrowhead pointing to the super class.

4.In the NetBeans debugger, you can set a breakpoint on any line number including comments and nonexecutable statements.

5.To observe how variables change as a program executes, you would watch the call stack using the NetBeans debugger.

6.The step-over command in NetBeans allows you to skip a line in the program from being executed.

7.The GeneralPath class is in the java.awt.geom package.

8.The Font and Color classes are in the java.awt package.

9.Programming to an interface is another term for programming to an implementation.

10.A Concrete class has at least one abstract method.

11.An Interface contains no method implementations.

12.A benefit of inheritance is code reusability.

13.Overridden methods are a form of polymorphism.

14.Overriding the toString() method facilitates printing the current state of an object.

15.Overridden methods cannot have the same name and same signature.

16.A call to the superclass's constructor, super(), has to be the first line in a subclass's constructor.

17.In Inheritance, the more general class is the subclass and the more specialized class is the superclass.

18.All classes extend from class Object.

19.You can instantiate an abstract class as long as you have declared all methods as final.

20.Polymorphism is used to make programs easily extensible.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.