Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE FOLLOW ALL THE INSTRUCTIONS USE THE CODE BELOW package Model;import java.util.ArrayList;public interface TableMember{ public String getAttribute(int n); public ArrayList getAttributes(); public String getAttributeName(int n);

PLEASE FOLLOW ALL THE INSTRUCTIONS
USE THE CODE BELOW
package Model;import java.util.ArrayList;public interface TableMember{ public String getAttribute(int n); public ArrayList getAttributes(); public String getAttributeName(int n); public ArrayList getAttributeNames();}
package View;
public class View {
public View()
{
}
public void basicDisplay(String s)
{
System.out.println(s);
}
}
package Model;
public class Person{
private String name;
private int weight;
private String hometown;
private String highSchool;
public Person(){
this.name="";
this.weight=0;
this.hometown="N/A";
this.highSchool="N/A";
}
public Person(String name, int weight, String hometown, String highSchool) {
this.name = name;
this.weight = weight;
this.hometown = hometown;
this.highSchool = highSchool;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getWeight() {
return weight;
}
public void setWeight(int weight) {
this.weight = weight;
}
public String getHometown() {
return hometown;
}
public void setHometown(String hometown) {
this.hometown = hometown;
}
public String getHighSchool() {
return highSchool;
}
public void setHighSchool(String highSchool) {
this.highSchool = highSchool;
}
@Override
public String toString() {
return "Person{" + "name=" + name + ", weight=" + weight + ", hometown=" + hometown + ", highSchool=" + highSchool + '}';
}
}
package Controller;
import Model.Model;
import View.View;
public class Controller {
Model model;
View view;
public Controller(View v, Model m){
model = m;
view = v;
view.basicDisplay(model.getData());
}
}
package Person;
public class Height {
private int feet;
private int inches;
public Height(int feet, int inches) {
this.feet = feet;
this.inches = inches;
}
public Height() {
this.feet = 0;
this.inches = 0;
}
public int getFeet() {
return feet;
}
public void setFeet(int feet) {
this.feet = feet;
}
public int getInches() {
return inches;
}
public void setInches(int inches) {
this.inches = inches;
}
@Override
public String toString() {
return "" + feet + "'" + inches +'"';
}
}
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Alter reading all Lo2 content pages in Lesson 02:chen and interfaces you will complete this assignment according to the information below. Do not use the scanner class or any other user input request. You application should be self-contained and run without seringut Assignment Objectives 1. Practice on implementing interfaces in Java Football player will implement the interface TableMember 2. Overriding methods when Footballplayer implements TableMember Football player wit have to write the real lava code for all the interface attract methods Deliverables A zipped Java project according to the How to submit labs and Accentude O.O. Requirements (these items will be part of your grade) 1. One class, one le Don't create multiple classes in the same wa 2. Don't use static variables and methods 3. Encapsulation make sure you protect your class variables and provide access to them through eet and se methods 4. All the classes are required to have a constructor that receive all the attributes as parameters and update the attributes accordingly 5. All the cases are required to have an empty constructor that receives no parameters but updates all the tributs as needed 6. Follow HostmasayaLa Codor Gece 7. Orged in packages (MVC.Model. View Controller Contents app Table Member Art Array Model ATM members para contro Methode vodo Get and the Person String Hugh int we String hometown school Two constructors - No parameter Alparameter 1 Controller Madame Wewe Encaption - Private bus Genset methods Alpo - String toering) View percon Methods extend mments . Get and set methods Arrondo String toering) View No para contra Methods Wold helpling + obitev extends implements Height intet Int inches Football Player It number String position Two constructor . No . All para The constructor No parameter . All parameter .than Private attributes Get and methods Encantation Private les Get andet mods Stringtostrine . Modified to display 999 You can been developing on your previous sent within of the new interface Teto Model package tofault package # Anja Controller - Controllera - Model Footba Parra Helga Madelava # Person Table Memo View LOBAL M Suns Pack del ca App Controller Centre Model Footbalove High Medija Perja Table ww Data The Model will create Table Member objects. The Member does not have any estabes, so the data is the same in the using the full power constructor with the data below Macus - Macho Alloh Data The Model class will create Members Member does not have any bless theme using the parameter constructor with the data below O Ganj 10 wewe 220 Choo in the no-parameter constructor Functionality . Four classes will be updated FootPlayer implementing Table Member will have added functional methods coming from the interface Table Member Attribute Attribute) Attribute to Attribute Model will be redered to be more. Although the data method is the same rything she will be updated to work with . Anablemer members and methods ArrayMember Member Membatialement - Controller will have now required code wild to your nemen leone vodite trom the previous gent In order to display the items in one canto Simetriad of System.out.prin her some high we hotchool 37 HK Nito 100 tot View it will lean output starta 59 sition NA ANI The desses - Ape it has the main method which is the wthod that love for and run to start any aplication it creates 3 je, one of the Model class, one of the Verwca and one of Controller When it creates Controle i paves the two other objects as input parameters tut Contacto Madeland View del o It creates objects, one of the Model class one of the View ass and one of the Controller class When it creates Controller, it passes the two other objects as input parameters so that Controller has access to Model and View Model model Vi vien View Controller control. Controlleriem, Controller will be used to test the new updates in Model and Football Player tic Controller vim , adet ) veislynedelgem (1) Attribute(3) vious modelet (1) rite()) vien bici (1) Attributes) vi.bancosplayCode. Attributes) Visoisplay of webs(1). Atributes()) view.plays of attributed to tribute Model It needs to be redesigned to be more genetic working with Table Member instead of the specific classes Football player of Person, ArrayList Table Member members ArrayListTableMemberget Members .setMembers(ArrayListTableMember members View . it just needs to display the text data that it will receive from Controller there is one update from the previous asment In order to display the items in one line, bas DisplayArrayList String an needs to use System out print Instead of System.out.println number position name height weight hometown highschool 37CB Kyle Alston 59100 Robbinsville, N. Robbinsville Person uses encapsulation private attributes . age and a set method for each attribute has the following attributes String name Height height . int weight: Strine hometown String highschool has two constructor - one with no parameters one with all the parameters lone for each attribute Intrine method one with all the parameters one for each atributel toString method Football Player has the following attributes int number String position two constructors - one with no parameters one with all the parameters lone for each attribute and a method String to bring toprinel overrides the superclass Object to method .toString) returns information about this class attributes as ring Height It is a class for typel which is used in Person defining the type of the route uses encapsulation private attributes and a set method for each attribute it has two attributes - int feet: Int inches two constructors . one with no parameters one with all the parameters (one for each attribute and a method . String totring .toString() overrides the superbis Object toStrine) method toString() returns information about this class attributes as a string It returns a formatted String with feet and inches for instance 52 The Interface - Table Member . It is an interface remember the interface definition Interfaces are often compared to contract to a promise to the wethode debe in the Mitfacin Juve does not have any real code for station of the thinly the ot of the When a cost decides to implementate it has to contain the real code for each other in the face . These are the four methods that Football Player has to implement pelie Strin puttribute(int): Return the value of a specific attribute. The trut pater start with a for the first attribute that for the These are the four methods that Football player has to imblement public String getAttribute(int): Returns the value of a specific attribute the mout porter stort with for the first attribute, then for the secondott bute and so on. public ArrayList String getAttributes: Returns the value of all attributes as an arrayList of Strings public String getAttributeNone(int) Returns the name of a specific attribute. The interneter start with for the first attribute then 1 for the condotti ute and so on. public ArrayList string getto: Return the name of all attributes os reytist or strings the stract methods are You are building an application to display data in the form of a table. This is the first step. With FootbalPlayer implementing Table Member FootbalPlayer objects can be displayed in a tabi The methods you are implementing will support that Below a screenshot of the waphics application in a future assignment that will use what you are building now re raphics appcation in a future animent that will what you are building how A strategy if you develop getAttribute(int i) first, then you can use it in getAttributes with a for loop getting each yetAttributelinen) The other way is also true if you develop getAttributes) first, then you can use it to retrieve one element at a time as needed by getAttributes(int n) The same is true for getAttributeName(int n) and getAttributeNames) Output It should look like: height 5'9" number position name height weight hometown highSchool 37 C8 Kyle Alston 5'9" 180 Robbinsville, N.J. Robbinsville size of names size of attributes- Next Previous Alter reading all Lo2 content pages in Lesson 02:chen and interfaces you will complete this assignment according to the information below. Do not use the scanner class or any other user input request. You application should be self-contained and run without seringut Assignment Objectives 1. Practice on implementing interfaces in Java Football player will implement the interface TableMember 2. Overriding methods when Footballplayer implements TableMember Football player wit have to write the real lava code for all the interface attract methods Deliverables A zipped Java project according to the How to submit labs and Accentude O.O. Requirements (these items will be part of your grade) 1. One class, one le Don't create multiple classes in the same wa 2. Don't use static variables and methods 3. Encapsulation make sure you protect your class variables and provide access to them through eet and se methods 4. All the classes are required to have a constructor that receive all the attributes as parameters and update the attributes accordingly 5. All the cases are required to have an empty constructor that receives no parameters but updates all the tributs as needed 6. Follow HostmasayaLa Codor Gece 7. Orged in packages (MVC.Model. View Controller Contents app Table Member Art Array Model ATM members para contro Methode vodo Get and the Person String Hugh int we String hometown school Two constructors - No parameter Alparameter 1 Controller Madame Wewe Encaption - Private bus Genset methods Alpo - String toering) View percon Methods extend mments . Get and set methods Arrondo String toering) View No para contra Methods Wold helpling + obitev extends implements Height intet Int inches Football Player It number String position Two constructor . No . All para The constructor No parameter . All parameter .than Private attributes Get and methods Encantation Private les Get andet mods Stringtostrine . Modified to display 999 You can been developing on your previous sent within of the new interface Teto Model package tofault package # Anja Controller - Controllera - Model Footba Parra Helga Madelava # Person Table Memo View LOBAL M Suns Pack del ca App Controller Centre Model Footbalove High Medija Perja Table ww Data The Model will create Table Member objects. The Member does not have any estabes, so the data is the same in the using the full power constructor with the data below Macus - Macho Alloh Data The Model class will create Members Member does not have any bless theme using the parameter constructor with the data below O Ganj 10 wewe 220 Choo in the no-parameter constructor Functionality . Four classes will be updated FootPlayer implementing Table Member will have added functional methods coming from the interface Table Member Attribute Attribute) Attribute to Attribute Model will be redered to be more. Although the data method is the same rything she will be updated to work with . Anablemer members and methods ArrayMember Member Membatialement - Controller will have now required code wild to your nemen leone vodite trom the previous gent In order to display the items in one canto Simetriad of System.out.prin her some high we hotchool 37 HK Nito 100 tot View it will lean output starta 59 sition NA ANI The desses - Ape it has the main method which is the wthod that love for and run to start any aplication it creates 3 je, one of the Model class, one of the Verwca and one of Controller When it creates Controle i paves the two other objects as input parameters tut Contacto Madeland View del o It creates objects, one of the Model class one of the View ass and one of the Controller class When it creates Controller, it passes the two other objects as input parameters so that Controller has access to Model and View Model model Vi vien View Controller control. Controlleriem, Controller will be used to test the new updates in Model and Football Player tic Controller vim , adet ) veislynedelgem (1) Attribute(3) vious modelet (1) rite()) vien bici (1) Attributes) vi.bancosplayCode. Attributes) Visoisplay of webs(1). Atributes()) view.plays of attributed to tribute Model It needs to be redesigned to be more genetic working with Table Member instead of the specific classes Football player of Person, ArrayList Table Member members ArrayListTableMemberget Members .setMembers(ArrayListTableMember members View . it just needs to display the text data that it will receive from Controller there is one update from the previous asment In order to display the items in one line, bas DisplayArrayList String an needs to use System out print Instead of System.out.println number position name height weight hometown highschool 37CB Kyle Alston 59100 Robbinsville, N. Robbinsville Person uses encapsulation private attributes . age and a set method for each attribute has the following attributes String name Height height . int weight: Strine hometown String highschool has two constructor - one with no parameters one with all the parameters lone for each attribute Intrine method one with all the parameters one for each atributel toString method Football Player has the following attributes int number String position two constructors - one with no parameters one with all the parameters lone for each attribute and a method String to bring toprinel overrides the superclass Object to method .toString) returns information about this class attributes as ring Height It is a class for typel which is used in Person defining the type of the route uses encapsulation private attributes and a set method for each attribute it has two attributes - int feet: Int inches two constructors . one with no parameters one with all the parameters (one for each attribute and a method . String totring .toString() overrides the superbis Object toStrine) method toString() returns information about this class attributes as a string It returns a formatted String with feet and inches for instance 52 The Interface - Table Member . It is an interface remember the interface definition Interfaces are often compared to contract to a promise to the wethode debe in the Mitfacin Juve does not have any real code for station of the thinly the ot of the When a cost decides to implementate it has to contain the real code for each other in the face . These are the four methods that Football Player has to implement pelie Strin puttribute(int): Return the value of a specific attribute. The trut pater start with a for the first attribute that for the These are the four methods that Football player has to imblement public String getAttribute(int): Returns the value of a specific attribute the mout porter stort with for the first attribute, then for the secondott bute and so on. public ArrayList String getAttributes: Returns the value of all attributes as an arrayList of Strings public String getAttributeNone(int) Returns the name of a specific attribute. The interneter start with for the first attribute then 1 for the condotti ute and so on. public ArrayList string getto: Return the name of all attributes os reytist or strings the stract methods are You are building an application to display data in the form of a table. This is the first step. With FootbalPlayer implementing Table Member FootbalPlayer objects can be displayed in a tabi The methods you are implementing will support that Below a screenshot of the waphics application in a future assignment that will use what you are building now re raphics appcation in a future animent that will what you are building how A strategy if you develop getAttribute(int i) first, then you can use it in getAttributes with a for loop getting each yetAttributelinen) The other way is also true if you develop getAttributes) first, then you can use it to retrieve one element at a time as needed by getAttributes(int n) The same is true for getAttributeName(int n) and getAttributeNames) Output It should look like: height 5'9" number position name height weight hometown highSchool 37 C8 Kyle Alston 5'9" 180 Robbinsville, N.J. Robbinsville size of names size of attributes- Next Previous

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

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago