SlideShare a Scribd company logo
Write a class called Student that extends the provided Person class. Ensure that your student
class is a concrete class. The foo method for a person should display (to standard output) the
person's age and name in a nice way (e.g, "Nigel's age is 14"). When a person makes a noise it
is their name repeated N times where N is the person's age. public abstract class Person
implements Noisy Person Class public String name; 3 ublic int age; s public abstract void foo);
public interface Noisy 2 String noise) 1 public interface Noisy{ Noisy Interface 1 public
interface Comparable 2 i Comparable Interface int compareTo(Type other); 1 public class Date 2
int day, month, year; Date Class public Date(int d, int m, int y){ dayd; month - m; year-y;
Solution
public class Student extends Person{
Student(String name, int age){
this.name = name; // initialising the student properties
this.age = age;
}
public void foo(){
if(isNoisy()){ //check if person makes noise
for(int i=0 ; i< age; i++ ){
System.out.print(" "+name+" ");
}
}else{
System.out.println(name+"'s age is "+age);
}
}
}
// Note: Information about the Noisy class is required.

More Related Content

More from info961251

What is isomerism How many kinds are there Define each kind and.pdf
What is isomerism How many kinds are there Define each kind and.pdfWhat is isomerism How many kinds are there Define each kind and.pdf
What is isomerism How many kinds are there Define each kind and.pdf
info961251
 
What is the definition of the words, and state the diffe.pdf
What is the definition of the words, and state the diffe.pdfWhat is the definition of the words, and state the diffe.pdf
What is the definition of the words, and state the diffe.pdf
info961251
 
Two sources of radio waves (call them 1 and 2) are separated by a dis.pdf
Two sources of radio waves (call them 1 and 2) are separated by a dis.pdfTwo sources of radio waves (call them 1 and 2) are separated by a dis.pdf
Two sources of radio waves (call them 1 and 2) are separated by a dis.pdf
info961251
 
Use the information in the table to select the image that represents .pdf
Use the information in the table to select the image that represents .pdfUse the information in the table to select the image that represents .pdf
Use the information in the table to select the image that represents .pdf
info961251
 
Triggers can only be used to update table values. PLSQL blocks have.pdf
Triggers can only be used to update table values.  PLSQL blocks have.pdfTriggers can only be used to update table values.  PLSQL blocks have.pdf
Triggers can only be used to update table values. PLSQL blocks have.pdf
info961251
 
TB is a major worldwide disease with new cases arising at an alarmin.pdf
TB is a major worldwide disease with new cases arising at an alarmin.pdfTB is a major worldwide disease with new cases arising at an alarmin.pdf
TB is a major worldwide disease with new cases arising at an alarmin.pdf
info961251
 
7. How did printing technology impact literacy and educationSol.pdf
7. How did printing technology impact literacy and educationSol.pdf7. How did printing technology impact literacy and educationSol.pdf
7. How did printing technology impact literacy and educationSol.pdf
info961251
 
Question 1Theories of Law Subject__________ is a collaborative.pdf
Question 1Theories of Law Subject__________ is a collaborative.pdfQuestion 1Theories of Law Subject__________ is a collaborative.pdf
Question 1Theories of Law Subject__________ is a collaborative.pdf
info961251
 
Q Describe the 2 types of homologs. (1) Orthologs (2) ParalogsS.pdf
Q Describe the 2 types of homologs. (1) Orthologs (2) ParalogsS.pdfQ Describe the 2 types of homologs. (1) Orthologs (2) ParalogsS.pdf
Q Describe the 2 types of homologs. (1) Orthologs (2) ParalogsS.pdf
info961251
 
Please fix the java code (using eclipse)package hw4p1;import jav.pdf
Please fix the java code (using eclipse)package hw4p1;import jav.pdfPlease fix the java code (using eclipse)package hw4p1;import jav.pdf
Please fix the java code (using eclipse)package hw4p1;import jav.pdf
info961251
 
Overview You are tasked with writing a program called Social Security.pdf
Overview You are tasked with writing a program called Social Security.pdfOverview You are tasked with writing a program called Social Security.pdf
Overview You are tasked with writing a program called Social Security.pdf
info961251
 
A geneticist Dr. O. Sophila discovers a new mutation that causes the .pdf
A geneticist Dr. O. Sophila discovers a new mutation that causes the .pdfA geneticist Dr. O. Sophila discovers a new mutation that causes the .pdf
A geneticist Dr. O. Sophila discovers a new mutation that causes the .pdf
info961251
 
o Dfe the cefcien of hermal expansion. What is the relation between t.pdf
o Dfe the cefcien of hermal expansion. What is the relation between t.pdfo Dfe the cefcien of hermal expansion. What is the relation between t.pdf
o Dfe the cefcien of hermal expansion. What is the relation between t.pdf
info961251
 
Monohybrid crosses with incomplete dominance and co-dominance The red.pdf
Monohybrid crosses with incomplete dominance and co-dominance The red.pdfMonohybrid crosses with incomplete dominance and co-dominance The red.pdf
Monohybrid crosses with incomplete dominance and co-dominance The red.pdf
info961251
 
Match the tissues in column A with the characteristics in (Some answe.pdf
Match the tissues in column A with the characteristics in (Some answe.pdfMatch the tissues in column A with the characteristics in (Some answe.pdf
Match the tissues in column A with the characteristics in (Some answe.pdf
info961251
 
Jumbo shrimp are those that require 10 to 15 shrimp to make a pound..pdf
Jumbo shrimp are those that require 10 to 15 shrimp to make a pound..pdfJumbo shrimp are those that require 10 to 15 shrimp to make a pound..pdf
Jumbo shrimp are those that require 10 to 15 shrimp to make a pound..pdf
info961251
 
In metaphase 1 of meiosis, the homologous chromosomes line up side by.pdf
In metaphase 1 of meiosis, the homologous chromosomes line up side by.pdfIn metaphase 1 of meiosis, the homologous chromosomes line up side by.pdf
In metaphase 1 of meiosis, the homologous chromosomes line up side by.pdf
info961251
 
Implement the sequence class from Section 3.2 of the textbook. The d.pdf
Implement the sequence class from Section 3.2 of the textbook. The d.pdfImplement the sequence class from Section 3.2 of the textbook. The d.pdf
Implement the sequence class from Section 3.2 of the textbook. The d.pdf
info961251
 
Gene frequencies for the ABO alleles vary geographically. For exa.pdf
Gene frequencies for the ABO alleles vary geographically. For exa.pdfGene frequencies for the ABO alleles vary geographically. For exa.pdf
Gene frequencies for the ABO alleles vary geographically. For exa.pdf
info961251
 
Explain the factors that determine the binding specificity between t.pdf
Explain the factors that determine the binding specificity between t.pdfExplain the factors that determine the binding specificity between t.pdf
Explain the factors that determine the binding specificity between t.pdf
info961251
 

More from info961251 (20)

What is isomerism How many kinds are there Define each kind and.pdf
What is isomerism How many kinds are there Define each kind and.pdfWhat is isomerism How many kinds are there Define each kind and.pdf
What is isomerism How many kinds are there Define each kind and.pdf
 
What is the definition of the words, and state the diffe.pdf
What is the definition of the words, and state the diffe.pdfWhat is the definition of the words, and state the diffe.pdf
What is the definition of the words, and state the diffe.pdf
 
Two sources of radio waves (call them 1 and 2) are separated by a dis.pdf
Two sources of radio waves (call them 1 and 2) are separated by a dis.pdfTwo sources of radio waves (call them 1 and 2) are separated by a dis.pdf
Two sources of radio waves (call them 1 and 2) are separated by a dis.pdf
 
Use the information in the table to select the image that represents .pdf
Use the information in the table to select the image that represents .pdfUse the information in the table to select the image that represents .pdf
Use the information in the table to select the image that represents .pdf
 
Triggers can only be used to update table values. PLSQL blocks have.pdf
Triggers can only be used to update table values.  PLSQL blocks have.pdfTriggers can only be used to update table values.  PLSQL blocks have.pdf
Triggers can only be used to update table values. PLSQL blocks have.pdf
 
TB is a major worldwide disease with new cases arising at an alarmin.pdf
TB is a major worldwide disease with new cases arising at an alarmin.pdfTB is a major worldwide disease with new cases arising at an alarmin.pdf
TB is a major worldwide disease with new cases arising at an alarmin.pdf
 
7. How did printing technology impact literacy and educationSol.pdf
7. How did printing technology impact literacy and educationSol.pdf7. How did printing technology impact literacy and educationSol.pdf
7. How did printing technology impact literacy and educationSol.pdf
 
Question 1Theories of Law Subject__________ is a collaborative.pdf
Question 1Theories of Law Subject__________ is a collaborative.pdfQuestion 1Theories of Law Subject__________ is a collaborative.pdf
Question 1Theories of Law Subject__________ is a collaborative.pdf
 
Q Describe the 2 types of homologs. (1) Orthologs (2) ParalogsS.pdf
Q Describe the 2 types of homologs. (1) Orthologs (2) ParalogsS.pdfQ Describe the 2 types of homologs. (1) Orthologs (2) ParalogsS.pdf
Q Describe the 2 types of homologs. (1) Orthologs (2) ParalogsS.pdf
 
Please fix the java code (using eclipse)package hw4p1;import jav.pdf
Please fix the java code (using eclipse)package hw4p1;import jav.pdfPlease fix the java code (using eclipse)package hw4p1;import jav.pdf
Please fix the java code (using eclipse)package hw4p1;import jav.pdf
 
Overview You are tasked with writing a program called Social Security.pdf
Overview You are tasked with writing a program called Social Security.pdfOverview You are tasked with writing a program called Social Security.pdf
Overview You are tasked with writing a program called Social Security.pdf
 
A geneticist Dr. O. Sophila discovers a new mutation that causes the .pdf
A geneticist Dr. O. Sophila discovers a new mutation that causes the .pdfA geneticist Dr. O. Sophila discovers a new mutation that causes the .pdf
A geneticist Dr. O. Sophila discovers a new mutation that causes the .pdf
 
o Dfe the cefcien of hermal expansion. What is the relation between t.pdf
o Dfe the cefcien of hermal expansion. What is the relation between t.pdfo Dfe the cefcien of hermal expansion. What is the relation between t.pdf
o Dfe the cefcien of hermal expansion. What is the relation between t.pdf
 
Monohybrid crosses with incomplete dominance and co-dominance The red.pdf
Monohybrid crosses with incomplete dominance and co-dominance The red.pdfMonohybrid crosses with incomplete dominance and co-dominance The red.pdf
Monohybrid crosses with incomplete dominance and co-dominance The red.pdf
 
Match the tissues in column A with the characteristics in (Some answe.pdf
Match the tissues in column A with the characteristics in (Some answe.pdfMatch the tissues in column A with the characteristics in (Some answe.pdf
Match the tissues in column A with the characteristics in (Some answe.pdf
 
Jumbo shrimp are those that require 10 to 15 shrimp to make a pound..pdf
Jumbo shrimp are those that require 10 to 15 shrimp to make a pound..pdfJumbo shrimp are those that require 10 to 15 shrimp to make a pound..pdf
Jumbo shrimp are those that require 10 to 15 shrimp to make a pound..pdf
 
In metaphase 1 of meiosis, the homologous chromosomes line up side by.pdf
In metaphase 1 of meiosis, the homologous chromosomes line up side by.pdfIn metaphase 1 of meiosis, the homologous chromosomes line up side by.pdf
In metaphase 1 of meiosis, the homologous chromosomes line up side by.pdf
 
Implement the sequence class from Section 3.2 of the textbook. The d.pdf
Implement the sequence class from Section 3.2 of the textbook. The d.pdfImplement the sequence class from Section 3.2 of the textbook. The d.pdf
Implement the sequence class from Section 3.2 of the textbook. The d.pdf
 
Gene frequencies for the ABO alleles vary geographically. For exa.pdf
Gene frequencies for the ABO alleles vary geographically. For exa.pdfGene frequencies for the ABO alleles vary geographically. For exa.pdf
Gene frequencies for the ABO alleles vary geographically. For exa.pdf
 
Explain the factors that determine the binding specificity between t.pdf
Explain the factors that determine the binding specificity between t.pdfExplain the factors that determine the binding specificity between t.pdf
Explain the factors that determine the binding specificity between t.pdf
 

Recently uploaded

PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
AG2 Design
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 

Recently uploaded (20)

PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 

Write a class called Student that extends the provided Person class..pdf

  • 1. Write a class called Student that extends the provided Person class. Ensure that your student class is a concrete class. The foo method for a person should display (to standard output) the person's age and name in a nice way (e.g, "Nigel's age is 14"). When a person makes a noise it is their name repeated N times where N is the person's age. public abstract class Person implements Noisy Person Class public String name; 3 ublic int age; s public abstract void foo); public interface Noisy 2 String noise) 1 public interface Noisy{ Noisy Interface 1 public interface Comparable 2 i Comparable Interface int compareTo(Type other); 1 public class Date 2 int day, month, year; Date Class public Date(int d, int m, int y){ dayd; month - m; year-y; Solution public class Student extends Person{ Student(String name, int age){ this.name = name; // initialising the student properties this.age = age; } public void foo(){ if(isNoisy()){ //check if person makes noise for(int i=0 ; i< age; i++ ){ System.out.print(" "+name+" "); } }else{ System.out.println(name+"'s age is "+age); } } } // Note: Information about the Noisy class is required.