Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Create a new Java project called inlab4. 2. Create a package called model and a package called test. 3. In the model package, add

image text in transcribed
image text in transcribed
1. Create a new Java project called inlab4. 2. Create a package called model and a package called test. 3. In the model package, add the following class: package model; public class Laptop f private String maker; private double price; private static int numberOfLaptops public Laptop(String maker, double price) ( this.maker maker this.price - price; numberOjLaptops+; public String getMakerO i public double getPrice0 public void setMaker(String maker) ( public void setPrice(double price) f return maker; return price; this.maker maker; if (pricec0) this.price price; this.price- 0 else public String toString0f return String,format("Marker: %s, Price: QR%.2f", maker,price); 4. In the model, add a class called Person that contains three data fields: id (int), name (String) and laptop (Laptop). Your class should have a constructor that initializes the three instance variables. Provide the setter and the getter method for each instance variable. a) Add a method called hasLaptop0 that returns true if the laptop instance variable is not null and returns false otherwise

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago