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.
Submit:
- Zipped NetBeans project
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. If you do not pass this competency exam, you will not be able to proceed to the second Java course in this series, IT252. Answer each question True or False.
- Java supports multiple inheritance.
- To say that class B extends from class A is to say that class B inherits from class A.
- 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.
- In the NetBeans debugger, you can set a breakpoint on any line number including comments and nonexecutable statements.
- To observe how variables change as a program executes, you would watch the call stack using the NetBeans debugger.
- The step-over command in NetBeans allows you to skip a line in the program from being executed.
- The GeneralPath class is in the java.awt.geom package.
- The Font and Color classes are in the java.awt package.
- Programming to an interface is another term for programming to an implementation.
- A Concrete class has at least one abstract method.
- An Interface contains no method implementations.
- A benefit of inheritance is code reusability.
- Overridden methods are a form of polymorphism.
- Overriding the toString() method facilitates printing the current state of an object.
- Overridden methods cannot have the same name and same signature.
- A call to the superclass’s constructor, super(), has to be the first line in a subclass’s constructor.
- In Inheritance, the more general class is the subclass and the more specialized class is the superclass.
- All classes extend from class Object.
- You can instantiate an abstract class as long as you have declared all methods as final.
- Polymorphism is used to make programs easily extensible.