Question: For this exercise you must implement two types of constructors . 1 . A Default Constructor and.. . 2 . A Parameterized ConstructorAs you should
For this exercise you must implement two types of constructors A Default Constructor and.. A Parameterized ConstructorAs you should know, the default constructor will be a default version of an object in a class. Like let's say we create a Human object, maybe a default constructor for a human would be to have head, hands, feet, etc. You simply call Human; And that'll create a Human object with head, hands, feet etc.A Parameterized Constructor on the other hand allows you to define to values or 'characteristics' for the object. So maybe we want a human object with heads, hand, and feet. For that we would use the parameters. What are the parameters you ask? Well it's those little values inside the parentheses. So in a Parameterized Constructor defined as Humanint numOfHeads, int numOfHands, int numOfFeet we would call something like Human; and that'll create a Human object with heads, hand and feet.That's what you need to implement. Create a default constructor and a parameterized constructor for the Phone class.IMPORTANT: Your default values for your default constructor will be the following:brand: Applemodel: iPhone ProreleaseYear: storage: OSVersion: price: hasWarranty: trueisG: trueIMPORTANT x : Your parameterized Constructor must have the parameters inside the parentheses in this exact order:First the brand of type string, then the model of type string, then releaseYear of type int, then storage of type int, then price of type int, then warranty of type bool, then isG of type bool. For the OSVersion make it equal to inside the body of the constructor. Don't add it on the parameters of the constructor
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
