SlideShare a Scribd company logo
//These are my codes. They are exactly similar to the above ones. Unless you missed some small
sytax. They run perfectly fine. Which environment are you using to compile and run these
programs?
ColorPencil.java
public class ColorPencil {
private String color;
private double length;
private double thickness;
public ColorPencil(String cpColor,double cpLength,double cpThickness)
{
color = cpColor;
length = cpLength;
thickness = cpThickness;
}
public ColorPencil()
{
color = "Black";
length = 6.0;
thickness = 1.5;
}
public void setColor(String cpColor)
{
color = cpColor;
}
public void setLength(double cpLength)
{
length = cpLength;
}
public void setThickness(double cpThickness)
{
thickness = cpThickness;
}
public String getColor()
{
return color;
}
public double getLength()
{
return length;
}
public double getThickness()
{
return thickness;
}
public String newColor(String cpColor)
{
color = cpColor;
return color;
}
public double newLength(double cpLength)
{
length = cpLength;
return length;
}
public double newThickness(double cpThickness)
{
thickness = cpThickness;
return thickness;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
ColorPencilTest.java
public class ColorPencilTest {
public static void main(String[] args) {
// TODO Auto-generated method stub
ColorPencil change = new ColorPencil();
String origColor = change.getColor();
double origLength = change.getLength();
double origThickness = change.getThickness();
System.out.println("Original color of the pencil is "+origColor+" Original length of the
pencil is "+origLength+" Original thickness of the pencil is "+origThickness);
String color1 = "Pink";
change.setColor(color1);
System.out.println("Color of the pencil is now "+color1);
double length1 = 5.5;
change.setLength(length1);
System.out.println("Length of the pencil is now "+length1);
double thickness1 = 0.7;
change.setThickness(thickness1);
System.out.println("Thickness of the pencil is now "+thickness1);
}
}
Solution
//These are my codes. They are exactly similar to the above ones. Unless you missed some small
sytax. They run perfectly fine. Which environment are you using to compile and run these
programs?
ColorPencil.java
public class ColorPencil {
private String color;
private double length;
private double thickness;
public ColorPencil(String cpColor,double cpLength,double cpThickness)
{
color = cpColor;
length = cpLength;
thickness = cpThickness;
}
public ColorPencil()
{
color = "Black";
length = 6.0;
thickness = 1.5;
}
public void setColor(String cpColor)
{
color = cpColor;
}
public void setLength(double cpLength)
{
length = cpLength;
}
public void setThickness(double cpThickness)
{
thickness = cpThickness;
}
public String getColor()
{
return color;
}
public double getLength()
{
return length;
}
public double getThickness()
{
return thickness;
}
public String newColor(String cpColor)
{
color = cpColor;
return color;
}
public double newLength(double cpLength)
{
length = cpLength;
return length;
}
public double newThickness(double cpThickness)
{
thickness = cpThickness;
return thickness;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
ColorPencilTest.java
public class ColorPencilTest {
public static void main(String[] args) {
// TODO Auto-generated method stub
ColorPencil change = new ColorPencil();
String origColor = change.getColor();
double origLength = change.getLength();
double origThickness = change.getThickness();
System.out.println("Original color of the pencil is "+origColor+" Original length of the
pencil is "+origLength+" Original thickness of the pencil is "+origThickness);
String color1 = "Pink";
change.setColor(color1);
System.out.println("Color of the pencil is now "+color1);
double length1 = 5.5;
change.setLength(length1);
System.out.println("Length of the pencil is now "+length1);
double thickness1 = 0.7;
change.setThickness(thickness1);
System.out.println("Thickness of the pencil is now "+thickness1);
}
}

More Related Content

Similar to These are my codes. They are exactly similar to the above ones. Un.pdf

Let's make a contract: the art of designing a Java API
Let's make a contract: the art of designing a Java APILet's make a contract: the art of designing a Java API
Let's make a contract: the art of designing a Java API
Mario Fusco
 
Solid C++ by Example
Solid C++ by ExampleSolid C++ by Example
Solid C++ by Example
Olve Maudal
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongMario Fusco
 
Namespace in C++ Programming Language
Namespace in C++ Programming LanguageNamespace in C++ Programming Language
Namespace in C++ Programming Language
Himanshu Choudhary
 
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
Francesco Casalegno
 
The Ring programming language version 1.10 book - Part 49 of 212
The Ring programming language version 1.10 book - Part 49 of 212The Ring programming language version 1.10 book - Part 49 of 212
The Ring programming language version 1.10 book - Part 49 of 212
Mahmoud Samir Fayed
 

Similar to These are my codes. They are exactly similar to the above ones. Un.pdf (8)

Let's make a contract: the art of designing a Java API
Let's make a contract: the art of designing a Java APILet's make a contract: the art of designing a Java API
Let's make a contract: the art of designing a Java API
 
Solid C++ by Example
Solid C++ by ExampleSolid C++ by Example
Solid C++ by Example
 
Chap2
Chap2Chap2
Chap2
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
 
Csharp generics
Csharp genericsCsharp generics
Csharp generics
 
Namespace in C++ Programming Language
Namespace in C++ Programming LanguageNamespace in C++ Programming Language
Namespace in C++ Programming Language
 
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
 
The Ring programming language version 1.10 book - Part 49 of 212
The Ring programming language version 1.10 book - Part 49 of 212The Ring programming language version 1.10 book - Part 49 of 212
The Ring programming language version 1.10 book - Part 49 of 212
 

More from anjanaarts2014

A robust whistleblowing regime is now an integral part of governance.pdf
A robust whistleblowing regime is now an integral part of governance.pdfA robust whistleblowing regime is now an integral part of governance.pdf
A robust whistleblowing regime is now an integral part of governance.pdf
anjanaarts2014
 
1. In higher parts of the reef, where the wave energy is high, the c.pdf
1. In higher parts of the reef, where the wave energy is high, the c.pdf1. In higher parts of the reef, where the wave energy is high, the c.pdf
1. In higher parts of the reef, where the wave energy is high, the c.pdf
anjanaarts2014
 
a)dydx + 2yx = xI.F. = x^2solution iy .pdf
a)dydx + 2yx = xI.F. = x^2solution iy .pdfa)dydx + 2yx = xI.F. = x^2solution iy .pdf
a)dydx + 2yx = xI.F. = x^2solution iy .pdf
anjanaarts2014
 
23.C. 1 in 424. B. Homozygous25. B. 5026.All females will be .pdf
23.C. 1 in 424. B. Homozygous25. B. 5026.All females will be .pdf23.C. 1 in 424. B. Homozygous25. B. 5026.All females will be .pdf
23.C. 1 in 424. B. Homozygous25. B. 5026.All females will be .pdf
anjanaarts2014
 
A is correct. The ntp server 10.0.0.5 command is entered in Global C.pdf
A is correct. The ntp server 10.0.0.5 command is entered in Global C.pdfA is correct. The ntp server 10.0.0.5 command is entered in Global C.pdf
A is correct. The ntp server 10.0.0.5 command is entered in Global C.pdf
anjanaarts2014
 
A. Gene expression.B. Transcription factor.C. Gene expression..pdf
A. Gene expression.B. Transcription factor.C. Gene expression..pdfA. Gene expression.B. Transcription factor.C. Gene expression..pdf
A. Gene expression.B. Transcription factor.C. Gene expression..pdf
anjanaarts2014
 
All are capable to grow in lactose medium . In presence of lactose t.pdf
All are capable to grow in lactose medium . In presence of lactose t.pdfAll are capable to grow in lactose medium . In presence of lactose t.pdf
All are capable to grow in lactose medium . In presence of lactose t.pdf
anjanaarts2014
 
1)The viruse which is the most dangerous threat.In DTI survey,72 of.pdf
1)The viruse which is the most dangerous threat.In DTI survey,72 of.pdf1)The viruse which is the most dangerous threat.In DTI survey,72 of.pdf
1)The viruse which is the most dangerous threat.In DTI survey,72 of.pdf
anjanaarts2014
 
HClO3 + NaOH NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdf
                     HClO3 + NaOH  NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdf                     HClO3 + NaOH  NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdf
HClO3 + NaOH NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdf
anjanaarts2014
 
The -OCl ion. .pdf
                     The -OCl ion.                                    .pdf                     The -OCl ion.                                    .pdf
The -OCl ion. .pdf
anjanaarts2014
 
I have already answered it. Check. .pdf
                     I have already answered it. Check.               .pdf                     I have already answered it. Check.               .pdf
I have already answered it. Check. .pdf
anjanaarts2014
 
Iodide is a strong nucleophile but a weak base, s.pdf
                     Iodide is a strong nucleophile but a weak base, s.pdf                     Iodide is a strong nucleophile but a weak base, s.pdf
Iodide is a strong nucleophile but a weak base, s.pdf
anjanaarts2014
 
NaCl Its the coulombic interaction between Na.pdf
                     NaCl  Its the coulombic interaction between Na.pdf                     NaCl  Its the coulombic interaction between Na.pdf
NaCl Its the coulombic interaction between Na.pdf
anjanaarts2014
 
Here Jupiter is the fifth planet from the Sun a.pdf
                     Here  Jupiter is the fifth planet from the Sun a.pdf                     Here  Jupiter is the fifth planet from the Sun a.pdf
Here Jupiter is the fifth planet from the Sun a.pdf
anjanaarts2014
 
moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdf
                     moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdf                     moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdf
moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdf
anjanaarts2014
 
Lithium is group 1 metal, while nitrogen is group.pdf
                     Lithium is group 1 metal, while nitrogen is group.pdf                     Lithium is group 1 metal, while nitrogen is group.pdf
Lithium is group 1 metal, while nitrogen is group.pdf
anjanaarts2014
 
there is some special character in ur question li.pdf
                     there is some special character in ur question li.pdf                     there is some special character in ur question li.pdf
there is some special character in ur question li.pdf
anjanaarts2014
 
a.Times Interest Earned Ratio = EBIT interest ExpenseFor 2014.pdf
a.Times Interest Earned Ratio = EBIT  interest ExpenseFor 2014.pdfa.Times Interest Earned Ratio = EBIT  interest ExpenseFor 2014.pdf
a.Times Interest Earned Ratio = EBIT interest ExpenseFor 2014.pdf
anjanaarts2014
 
45 yrs.Solution45 yrs..pdf
45 yrs.Solution45 yrs..pdf45 yrs.Solution45 yrs..pdf
45 yrs.Solution45 yrs..pdf
anjanaarts2014
 
the bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdf
the bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdfthe bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdf
the bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdf
anjanaarts2014
 

More from anjanaarts2014 (20)

A robust whistleblowing regime is now an integral part of governance.pdf
A robust whistleblowing regime is now an integral part of governance.pdfA robust whistleblowing regime is now an integral part of governance.pdf
A robust whistleblowing regime is now an integral part of governance.pdf
 
1. In higher parts of the reef, where the wave energy is high, the c.pdf
1. In higher parts of the reef, where the wave energy is high, the c.pdf1. In higher parts of the reef, where the wave energy is high, the c.pdf
1. In higher parts of the reef, where the wave energy is high, the c.pdf
 
a)dydx + 2yx = xI.F. = x^2solution iy .pdf
a)dydx + 2yx = xI.F. = x^2solution iy .pdfa)dydx + 2yx = xI.F. = x^2solution iy .pdf
a)dydx + 2yx = xI.F. = x^2solution iy .pdf
 
23.C. 1 in 424. B. Homozygous25. B. 5026.All females will be .pdf
23.C. 1 in 424. B. Homozygous25. B. 5026.All females will be .pdf23.C. 1 in 424. B. Homozygous25. B. 5026.All females will be .pdf
23.C. 1 in 424. B. Homozygous25. B. 5026.All females will be .pdf
 
A is correct. The ntp server 10.0.0.5 command is entered in Global C.pdf
A is correct. The ntp server 10.0.0.5 command is entered in Global C.pdfA is correct. The ntp server 10.0.0.5 command is entered in Global C.pdf
A is correct. The ntp server 10.0.0.5 command is entered in Global C.pdf
 
A. Gene expression.B. Transcription factor.C. Gene expression..pdf
A. Gene expression.B. Transcription factor.C. Gene expression..pdfA. Gene expression.B. Transcription factor.C. Gene expression..pdf
A. Gene expression.B. Transcription factor.C. Gene expression..pdf
 
All are capable to grow in lactose medium . In presence of lactose t.pdf
All are capable to grow in lactose medium . In presence of lactose t.pdfAll are capable to grow in lactose medium . In presence of lactose t.pdf
All are capable to grow in lactose medium . In presence of lactose t.pdf
 
1)The viruse which is the most dangerous threat.In DTI survey,72 of.pdf
1)The viruse which is the most dangerous threat.In DTI survey,72 of.pdf1)The viruse which is the most dangerous threat.In DTI survey,72 of.pdf
1)The viruse which is the most dangerous threat.In DTI survey,72 of.pdf
 
HClO3 + NaOH NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdf
                     HClO3 + NaOH  NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdf                     HClO3 + NaOH  NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdf
HClO3 + NaOH NaClO3 +H2O n(HClO3) = 0.10.04 = 4.pdf
 
The -OCl ion. .pdf
                     The -OCl ion.                                    .pdf                     The -OCl ion.                                    .pdf
The -OCl ion. .pdf
 
I have already answered it. Check. .pdf
                     I have already answered it. Check.               .pdf                     I have already answered it. Check.               .pdf
I have already answered it. Check. .pdf
 
Iodide is a strong nucleophile but a weak base, s.pdf
                     Iodide is a strong nucleophile but a weak base, s.pdf                     Iodide is a strong nucleophile but a weak base, s.pdf
Iodide is a strong nucleophile but a weak base, s.pdf
 
NaCl Its the coulombic interaction between Na.pdf
                     NaCl  Its the coulombic interaction between Na.pdf                     NaCl  Its the coulombic interaction between Na.pdf
NaCl Its the coulombic interaction between Na.pdf
 
Here Jupiter is the fifth planet from the Sun a.pdf
                     Here  Jupiter is the fifth planet from the Sun a.pdf                     Here  Jupiter is the fifth planet from the Sun a.pdf
Here Jupiter is the fifth planet from the Sun a.pdf
 
moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdf
                     moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdf                     moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdf
moles of H+ = 42.0 x 0.120 millimoles = 5.04 mill.pdf
 
Lithium is group 1 metal, while nitrogen is group.pdf
                     Lithium is group 1 metal, while nitrogen is group.pdf                     Lithium is group 1 metal, while nitrogen is group.pdf
Lithium is group 1 metal, while nitrogen is group.pdf
 
there is some special character in ur question li.pdf
                     there is some special character in ur question li.pdf                     there is some special character in ur question li.pdf
there is some special character in ur question li.pdf
 
a.Times Interest Earned Ratio = EBIT interest ExpenseFor 2014.pdf
a.Times Interest Earned Ratio = EBIT  interest ExpenseFor 2014.pdfa.Times Interest Earned Ratio = EBIT  interest ExpenseFor 2014.pdf
a.Times Interest Earned Ratio = EBIT interest ExpenseFor 2014.pdf
 
45 yrs.Solution45 yrs..pdf
45 yrs.Solution45 yrs..pdf45 yrs.Solution45 yrs..pdf
45 yrs.Solution45 yrs..pdf
 
the bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdf
the bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdfthe bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdf
the bacteria isolated from the dead mouse is smooth (S) S. pneumonia.pdf
 

Recently uploaded

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
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
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
 
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
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
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
 
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
 
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 Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
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
 
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
 

Recently uploaded (20)

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
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
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
 
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
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
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...
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
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
 
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
 

These are my codes. They are exactly similar to the above ones. Un.pdf

  • 1. //These are my codes. They are exactly similar to the above ones. Unless you missed some small sytax. They run perfectly fine. Which environment are you using to compile and run these programs? ColorPencil.java public class ColorPencil { private String color; private double length; private double thickness; public ColorPencil(String cpColor,double cpLength,double cpThickness) { color = cpColor; length = cpLength; thickness = cpThickness; } public ColorPencil() { color = "Black"; length = 6.0; thickness = 1.5; } public void setColor(String cpColor) { color = cpColor; } public void setLength(double cpLength) { length = cpLength; } public void setThickness(double cpThickness) {
  • 2. thickness = cpThickness; } public String getColor() { return color; } public double getLength() { return length; } public double getThickness() { return thickness; } public String newColor(String cpColor) { color = cpColor; return color; } public double newLength(double cpLength) { length = cpLength; return length; } public double newThickness(double cpThickness) { thickness = cpThickness; return thickness; }
  • 3. public static void main(String[] args) { // TODO Auto-generated method stub } } ColorPencilTest.java public class ColorPencilTest { public static void main(String[] args) { // TODO Auto-generated method stub ColorPencil change = new ColorPencil(); String origColor = change.getColor(); double origLength = change.getLength(); double origThickness = change.getThickness(); System.out.println("Original color of the pencil is "+origColor+" Original length of the pencil is "+origLength+" Original thickness of the pencil is "+origThickness); String color1 = "Pink"; change.setColor(color1); System.out.println("Color of the pencil is now "+color1); double length1 = 5.5; change.setLength(length1); System.out.println("Length of the pencil is now "+length1); double thickness1 = 0.7; change.setThickness(thickness1); System.out.println("Thickness of the pencil is now "+thickness1); } }
  • 4. Solution //These are my codes. They are exactly similar to the above ones. Unless you missed some small sytax. They run perfectly fine. Which environment are you using to compile and run these programs? ColorPencil.java public class ColorPencil { private String color; private double length; private double thickness; public ColorPencil(String cpColor,double cpLength,double cpThickness) { color = cpColor; length = cpLength; thickness = cpThickness; } public ColorPencil() { color = "Black"; length = 6.0; thickness = 1.5; } public void setColor(String cpColor) { color = cpColor; } public void setLength(double cpLength) { length = cpLength;
  • 5. } public void setThickness(double cpThickness) { thickness = cpThickness; } public String getColor() { return color; } public double getLength() { return length; } public double getThickness() { return thickness; } public String newColor(String cpColor) { color = cpColor; return color; } public double newLength(double cpLength) { length = cpLength; return length; } public double newThickness(double cpThickness) {
  • 6. thickness = cpThickness; return thickness; } public static void main(String[] args) { // TODO Auto-generated method stub } } ColorPencilTest.java public class ColorPencilTest { public static void main(String[] args) { // TODO Auto-generated method stub ColorPencil change = new ColorPencil(); String origColor = change.getColor(); double origLength = change.getLength(); double origThickness = change.getThickness(); System.out.println("Original color of the pencil is "+origColor+" Original length of the pencil is "+origLength+" Original thickness of the pencil is "+origThickness); String color1 = "Pink"; change.setColor(color1); System.out.println("Color of the pencil is now "+color1); double length1 = 5.5; change.setLength(length1); System.out.println("Length of the pencil is now "+length1); double thickness1 = 0.7;