CEIS420 Week 6 Lab – Object-Oriented Programming and Exception and Event Handling – With Lab Report -Perfect Solution – Instant Delivery

Lab Price = $12
Please feel free to send us your queries at: support@iqrajavaid.com
Payment methods

Add to Cart

Buy Now

View Cart


Problem Statement
Week 6: Lab Overview
TABLE OF CONTENTS
Lab 6 of 7: Object-Oriented Programming and Exception and Event Handling (30 points)
Lab Overview
Scenario/Summary
Download the Week 6 Lab and complete all the questions listed on the page. You will notice that the readings, including lessons, the examples we worked on during the lesson, and other audio and visual aids provided, will help you tackle this week’s lab. Remember to use the weekly discussion related to the lab and the Course Q & A Forum for additional help. Be specific and state the problem you are having clearly, including what you have done to resolve it, in the discussion.
Deliverables
Please save the completed Word document using the following naming convention. Save it personalized as CEIS420_LastName_FirstName_iLab6.
Required Software
Microsoft Word
Access the software at https://lab.devry.edu (Links to an external site.).
Lab Steps
STEP 1: Complete Lab
• Download the Week 6 Lab (Links to an external site.) to prepare for your deliverable this week.
• Answer the questions for the lab.
• Create the application to practice using a design pattern.
• Copy-paste your code into the lab report.
• Take a screenshot of your working application using ALT-PrtScrn and paste the screenshot into your report.
STEP 2: Grading Rubric
Category Points % Description
Lab: Design Patters 50 100 Create an application and analyze common design patterns.
Total 50 100

Week 6 Lab—Design Patterns

Scenario
In this week’s lab, you will implement a design pattern.

Rubric
Point distribution for this activity:
Lab Activity
Document Points possible Points received
Lab 20
Total Points 50

1. List five design patterns commonly used in programming.
1.
2.
3.
4.
5.
2. We will create a factory pattern. The factory pattern is useful when you have to create objects based on user input or when you need to defer the instantiation of objects to subclasses. An object is created by calling a factory method. The factory method uses an abstract class for the superclass. Any subclasses extend the super class. Below, you will have an example of a Factory Design Pattern. This is one of the most popular design patterns used in industry today. Use this example to create your own! It can be a factory of colors, shapes, animals, vehicles, toys, food, products, employees, and so on. Anything you want!
Include ALL of your classes (you should have five at the minimum), and a screenshot of the output.

Below is an example using an abstract phone class as the superclass. The two subclasses are iPhone and Android. The PhoneFactory class provides the instantiation of the class. The factory is the main class. Notice that the Samsung and iPhonex variables are of type Phone).
Phone.java—This is the super class and it is abstract.
public abstract class Phone {
//The abstract methods in Phone must be implemented in the subclasses
public abstract String getRAM();
public abstract String getStorage();
public abstract String getSize();
public abstract void slogan();
@Override
public String toString(){
return “RAM= “+this.getRAM()+”, Storage=”+this.getStorage()+”, Size=”+this.getSize();
}
}
Android.java—subclass 1
public class Android extends Phone{
private String ram;
private String storage;
private String size;

public Android(String r, String s, String sz){
ram=r;
storage=s;
size=sz;
}
@Override
public String getRAM() {
return this.ram;
}

@Override
public String getStorage() {
return this.storage;
}

@Override
public String getSize() {
return this.size;
}
public void slogan()
{
System.out.println(“Be together, not the same”);
}
}

iPhone.java—subclass 2
public class iPhone extends Phone {
private String ram;
private String storage;
private String size;

public iPhone(String r, String s, String sz){
ram=r;
storage=s;
size=sz;
}
@Override
public String getRAM() {
return this.ram;
}

@Override
public String getStorage() {
return this.storage;
}

@Override
public String getSize() {
return this.size;
}
public void slogan()
{
System.out.println(“Think different”);
}
}
PhoneFactory—factory class that instantiates the object requested
public class PhoneFactory {
public Phone getPhone(String PhoneType, String r, String s, String sz)
{
//Create object here
if(PhoneType.equalsIgnoreCase(“ANDROID”))
return new Android(r, s, sz);
else if(PhoneType.equalsIgnoreCase(“IPHONE”))
return new iPhone(r, s, sz);
else
return null;
}
}
Main—Factory.java
public class Factory {

public static void main(String[] args) {
PhoneFactory pf = new PhoneFactory();
Phone samsung= pf.getPhone(“android”,”6 GB”,”64 GB”,”6.0 inches”);
Phone iphonex= pf.getPhone(“iphone”,”3 GB”,”64 GB”,”5.8 inches”);
System.out.println(“Android Configuration:”+samsung);
samsung.slogan();
System.out.println(“iPhone Configuration:”+iphonex);
iphonex.slogan();
}
}

Results of the above code:
Android Configuration:RAM= 6 GB, Storage=64 GB, Size=6.0 inches
Be together, not the same
iPhone Configuration:RAM= 3 GB, Storage=64 GB, Size=5.8 inches
Think different
BUILD SUCCESSFUL (total time: 0 seconds)

Your code:

Screenshot showing it working:

Relevant Material
Screenshots
Lab 6: Screenshot
Lab 6: Screenshot
Instructions
* If you want to purchase multiple products then click on “Buy Now” button which will give you ADD TO CART option.Please note that the payment is done through PayPal.
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at support@iqrajavaid.com.
* As soon as the payment is received, download link of the solution will automatically be sent to the address used in selected payment method.
* Please check your junk mails as the download link email might go there and please be patient for the download link email. Sometimes, due to server congestion, you may receive download link with a delay.
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at support@iqrajavaid.com and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.
* In case of any query, please donot hesitate to contact us at support@iqrajavaid.com.
* MOST IMPORTANT Please use the tutorials as a guide and they need NOT to be used for any submission. Just take help from the material.
******************************************** Good Luck ***************************************************
Privacy Policy
We take your privacy seriously and will take all measures to protect your personal information.
Any personal information received will only be used to fill your order. We will not sell or redistribute your information to anyone.
Refund Policy
Incase you face any issues with the tutorial, please free to contact us on support@iqrajavaid.com
We will try our best to resolve the issue and if still persists we can discuss for a refund in case its required.
Payment Details
Lab Price = $12
Please feel free to send us your queries at: support@iqrajavaid.com
Payment methods

Add to Cart

Buy Now

View Cart