Answered step by step
Verified Expert Solution
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 +'"';
}
}
Step 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