Assignment 2 – Adding Encapsulation to a Java Class
Subscribe
- Use the Java class you posted last week (corrected based on any feedback you may have received) and add encapsulation to it to include making all attributes private, adding constructor, and adding get and set methods. The main method should create an instance of the class and demonstrate the correct functionality of all the methods.
- Reply to another student’s post. Suggest different constructors and/or methods and/or behavior of the class that would be consistent with the real object that the class is modeling, or suggest a different version of the code. Write the main method to demonstrate the correct functionality of the additions/modifications. As you reply to the other students, try to reply to a post that does not have a reply yet, and if not; try to reply to a post with a fewer number of replies.
Be sure to create a program different from any of the programs already posted by your classmates or the examples in the class materials.
As you answer these questions, use proper Java naming convention (Camel case), name the class, attribute, and method in a meaningful way to represent the business meaning, and add comments to the Java code as applicable.
The deliverables are the Java code and the documentation. The documentation is a single Microsoft Word document, or PDF containing the screenshot of the results obtained by running the code.
Assignment 3 – Creating Class Hierarchy (Inheritance)
Subscribe
- Create a Java class with two subclasses (children). Each class should have at least one attribute and a method. Parent class should have the attribute/method that is common to both children and children should have the attribute/method that is unique to what they represent. Write the main method to demonstrate the correct functionality of the code and to demonstrate that the children inherit from the parent class.
Be sure to create a program different from any of the programs already posted by your classmates or the examples in-class materials.
- Reply to another student’s post. Modify the student’s code by adding another child class with an attribute and a method that is unique to that object, or suggest a different child class. Write the main method to demonstrate the correct functionality of the additions. As you reply to the other students, try to reply to a post that does not have a reply yet, and if not; try to reply to a post with a fewer number of replies.
Be sure to create a program different from any of the programs already posted by your classmates or the examples in the class materials.
As you answer these questions, use proper Java naming convention (Camel case), name the class, attribute, and method in a meaningful way to represent the business meaning, and add comments to the Java code as applicable.
The deliverables are the Java code and the documentation. The documentation is a single Microsoft Word document, or PDF containing the screenshot of the results obtained by running the code.
Assignment 4 – GUIs
Subscribe
- Research different widgets that are included in this Java swing package.
Post a short description of one widget that you selected to write a program for. Some widgets include JCheckBox, JRadioButton, JLabel, JMenu, JComboBox, JList, JPasswordField, JTable, JTextField, JColorChooser, etc.
Select a widget that another student has not chosen yet or one that has enough functionality where you can add to the description and have a different program. For example, many widgets can have an event handler and your program can do different actions for an event.
Create a Java program that creates a GUI using JFrame and JPanel and adds your selected widget. Make sure you check out the example programs in this week’s materials first.
Create a small code example to demonstrate the execution of the recursion feature.
- Find the post of another student and respond to it with suggestions to further improve. or suggest a different approach. As you reply to the other students, try to reply to a post that does not have a reply yet, and if not; try to reply to a post with a fewer number of replies.
Be sure to create a program different from any of the programs already posted by your classmates or the examples in the class materials.
As you answer these questions, use proper Java naming convention (Camel case), name the class, attribute, and method in a meaningful way to represent the business meaning, and add comments to the Java code as applicable.
The deliverables are the Java code and the documentation. The documentation is a single Microsoft Word document, or PDF containing the screenshot of the results obtained by running the code.
Assignment 5 – Polymorphism: Overloading and Overriding
Subscribe
- Use the Java hierarchy you posted in Week 3 (corrected based on any feedback you may have received) add one overriding method and one overloading. The main method should create an instance of the class and demonstrate the correct functionality of the overriding and overloading methods.
- Reply to another student’s post. Suggest a different overloading or overriding method. Write the main method to demonstrate the correct functionality of the additions/modifications. As you reply to the other students, try to reply to a post that does not have a reply yet, and if not; try to reply to a post with a fewer number of replies.
Be sure to create a program different from any of the programs already posted by your classmates or the examples in the class materials.
As you answer these questions, use proper Java naming convention (Camel case), name the class, attribute, and method in a meaningful way to represent the business meaning, and add comments to the Java code as applicable.
The deliverables are the Java code and the documentation. The documentation is a single Microsoft Word document, or PDF containing the screenshot of the results obtained by running the code.
Assignment 6 – Dynamic Binding
Subscribe
- Write a small program that uses the dynamic binding. In your comments explain which statement(s) is doing the dynamic binding.
- Reply to another student’s post. Suggest another way to take advantage of the dynamic binding in that code. Write the main method to demonstrate the correct functionality of the additions/modifications. As you reply to the other students, try to reply to a post that does not have a reply yet, and if not; try to reply to a post with a fewer number of replies.
Be sure to create a program different from any of the programs already posted by your classmates or the examples in the class materials.
As you answer these questions, use proper Java naming convention (Camel case), name the class, attribute, and method in a meaningful way to represent the business meaning, and add comments to the Java code as applicable.
The deliverables are the Java code and the documentation. The documentation is a single Microsoft Word document, or PDF containing the screenshot of the results obtained by running the code.
Assignment 7 – Exceptions
Subscribe
- Use the Java hierarchy you posted in week 5 (corrected based on any feedback you may have received). Add a user-defined exception that can be thrown by one of the methods as part of the validation or error checking. The main method should then create an instance of the class and call the method in such a way that the exception is thrown (e.g. invalid input or state of the system). Submit your program as an attached .java file and post a screenshot to show that you have been able to successfully run that program. Make sure your submission adheres to the Submission Requirements document.
- Reply to another student’s post. Suggest another path and/or method where the new exception could be thrown or suggest a different user-exception and where it could be used or suggest a path where Java built-in exception could be used. Write the main method to demonstrate the correct functionality of the additions. As you reply to the other students, try to reply to a post that does not have a reply yet, and if not; try to reply to a post with a fewer number of replies.
Be sure to create a program different from any of the programs already posted by your classmates or the examples in the class materials.
As you answer these questions, use proper Java naming convention (Camel case), name the class, attribute, and method in a meaningful way to represent the business meaning, and add comments to the Java code as applicable.
The deliverables are the Java code and the documentation. The documentation is a single Microsoft Word document, or PDF containing the screenshot of the results obtained by running the code.
Assignment 8: Two-Dimensional Arrays and File Handling
Subscribe
- Write a small program that reads data from a file and stores it in a two-dimensional array and then uses nested for-loop to print the values in a table format. Submit your program as an attached .java file and post a screenshot to show that you have been able to successfully run that program. Make sure your submission adheres to the Submission Requirements document.
- Reply to another student’s post. Modify the student’s program to change/process the data in some way and then write it to a file. As you reply to the other students, try to reply to a post that does not have a reply yet, and if not; try to reply to a post with a fewer number of replies.
Be sure to create a program different from any of the programs already posted by your classmates or the examples in the class materials.
As you answer these questions, use proper Java naming convention (Camel case), name the class, attribute, and method in a meaningful way to represent the business meaning, and add comments to the Java code as applicable.
The deliverables are the Java code and the documentation. The documentation is a single Microsoft Word document, or PDF containing the screenshot of the results obtained by running the code.