G
Guest
Guest
Hi, all!
I am stumped on this project, hoping someone can help me!
Here are the terms of the project:
You will create 4 Java classes for this project.
The first is a Product class. This will be a generic class for Products that a company may sell. It will have variables for the following: name, description, price and productID. Use appropriate data types. Write or generate getters and setters for all variables. Write a function called print() that prints the Product information to the screen.
The second is a Phone class. It will Inherit from the Product class. It will have variables for make (Apple, Motorola, Samsung, etc), model (iPhone 6, Moto X, Galaxy S5, etc), and storage space (in gigabytes). Write or generate getters and setters and Overload the print() method that's inherited from the Product class. Make use of the super.print() call.
The third is a TV class. It will Inherit from the Product class as well. It will have variables for make, screen size, type (LCD, LED, Plasma) and whether or not it is 3D capable. Write or generate getters and setters and Overload the print() method in the same manner you did with the Phone class.
Finally, write a driver class that instantiates a Product, a Phone and a TV, sets the variables and then prints them all three to the screen.
Below are my 4 classes that I have written.
My issue is with the printing. I can't get the info to pull into the right spaces when I print.
I know I'm missing something, like calling out the string that I'm printing from.
Any help/advice would be great! I'm still a rookie with java, but learning!
Thank you in advance!
I am stumped on this project, hoping someone can help me!
Here are the terms of the project:
You will create 4 Java classes for this project.
The first is a Product class. This will be a generic class for Products that a company may sell. It will have variables for the following: name, description, price and productID. Use appropriate data types. Write or generate getters and setters for all variables. Write a function called print() that prints the Product information to the screen.
The second is a Phone class. It will Inherit from the Product class. It will have variables for make (Apple, Motorola, Samsung, etc), model (iPhone 6, Moto X, Galaxy S5, etc), and storage space (in gigabytes). Write or generate getters and setters and Overload the print() method that's inherited from the Product class. Make use of the super.print() call.
The third is a TV class. It will Inherit from the Product class as well. It will have variables for make, screen size, type (LCD, LED, Plasma) and whether or not it is 3D capable. Write or generate getters and setters and Overload the print() method in the same manner you did with the Phone class.
Finally, write a driver class that instantiates a Product, a Phone and a TV, sets the variables and then prints them all three to the screen.
Below are my 4 classes that I have written.
My issue is with the printing. I can't get the info to pull into the right spaces when I print.
I know I'm missing something, like calling out the string that I'm printing from.
Any help/advice would be great! I'm still a rookie with java, but learning!
Thank you in advance!