Subject: Week 6
Style | APA |
Number of words | 815 |
Number of sources | 0 |
Spacing | Double |
PowerPoint slides | 0 |
Task 6
Implement a Simple Program using API and User-defined Classes
Step 1: Using the Java Library or Java API
a) Learn about the String class
b) Learn about the Math class
c) Learn about the Random class
d) Lean about the Scanner class
e) Learn about the File class
f) Learn about the Graphics class
Create a visual or flashcards to review the terms and their properties.
Import and use Java Library or Java API classes a) Import packages containing needed classes
b) Explore the io, util, and awt packages. Define the terms and describe their features.
c) Access class member data and methods
Sub Classes and Super Classes
Read about Subclasses and Superclasses and do the following:
a) Define a subclass from a superclass using inheritance
b) Invoke superclass constructors and methods using the super keyword
c) Understand abstract class and interface class
d) Overriding and overloading messages
Select one of the following classes from Step 1. Explore it more in-depth using at least two library resources. in LIRN. Include an example and cite your submission in APA style. It should be between 300-500 words.
Part 2
1) Brainstorm in groups to enhance the Circle class by importing and using the File and Random classes from the Java library to generate a random value for the radius value read from a file.
2) Work individually to implement the Circle class discuss in (1), use, compile and run the class using NetBeans. Students then work together to resolve errors (if any).
3) Brainstorm in groups to create an abstract class Shape that contains two abstract methods print Area () and print Priementer() and then extend the Circle class implemented in (2) using the abstract class Shape.
4) Work individually to implement the Circle class extending the Shape class, use, compile and run the class using NetBeans.
Assessment:
Work individually or in groups to implement a Rectangle class that utilizes the Scanner class to get the values entered by the user for the rectangle length and width. Student(s) then extend the Rectangle class using the Shape class they have created during in class, use, compile and run the extended class using NetBeans.