Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MUST BE IN JAVA Please explain to me what was wrong with each item so that I may study it later. CSC 1302, Spring 2019,
MUST BE IN JAVA
Please explain to me what was wrong with each item so that I may study it later.
CSC 1302, Spring 2019, Quiz 1 Name Lab Day and time: public class PantherCardf String firstName: String lastName int pantherId; 1. Given the PantherCard class above, point out the errors in the following constructor and show how to fix them. (30 points) public void PantherCard (String inFirstName, String inlasthame)t String firstName = inFirstName ; String lastName inLastName; 2. Given the PantherCard class above what are the first, last names and pantherlds of PantherCards referred to as pl and p2 after the following code executes? Give your answer as first name, last name, panther Id (20 points) PantherCard pl new Panthe rCard(); PantherCard p2 new PantherCard): pl.firstName "John" pl.lastName "Doe" pl.pantherId 2; p2.firstName- "Andrew"; p2.lastName "Ryan" p2.panther!d = p1.panthe rid- 1; pl- p2- 3. Assume that instance variables of PantherCard class from above were changed to private, so that it is no longer possible to access or change them directly. Add the accessors and mutators to the following class so that you can access and change the values of these fields (noter you don't have to provide methods for every variable, just one is enough). (50 points) public class PantherCardfStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started