SlideShare a Scribd company logo
1 of 6
Download to read offline
Hi,
I have updated your code. It is working fine now. Highllighted all code changes below.
Shapes.java
import java.util.Scanner;
public class Shapes
{
private int radius;
public Shapes(int radius){
this.radius = radius;
}
public void setradius( int radius )
{
}
public int getradius()
{
return radius;
}
public void report()
{
System.out.printf( "Circle perimeter, area / Sphere volume:");
System.out.println();
System.out.printf( " perimeter : " + 2. * Math.PI * getradius());
System.out.println();
System.out.printf( " area : " + Math.PI * getradius() * 1.);
System.out.println();
System.out.printf( " volume : " + (4 * Math.PI * Math.pow(getradius(),3)/3));
System.out.println();
System.out.printf( "Square perimeter, area:");
System.out.println();
System.out.printf( " perimeter : " + 2 *Math.E * 1.);
System.out.println();
System.out.printf( " area : " + Math.E * 1.* 1);
System.out.println();
}
public static void main( String[] args )
{
//System.out.printf( "Radius (as integer) of bounding sphere? %s! ", getradius() );
Scanner input = new Scanner( System.in );
System.out.println("Enter the radius:");
int radius = input.nextInt();
Shapes s = new Shapes(radius);
s.report();
}
}
Output:
import java.util.Scanner;
public class Shapes
{
private int radius;
public Shapes(int radius){
this.radius = radius;
}
public void setradius( int radius )
{
}
public int getradius()
{
return radius;
}
public void report()
{
System.out.printf( "Circle perimeter, area / Sphere volume:");
System.out.println();
System.out.printf( " perimeter : " + 2. * Math.PI * getradius());
System.out.println();
System.out.printf( " area : " + Math.PI * getradius() * 1.);
System.out.println();
System.out.printf( " volume : " + (4 * Math.PI * Math.pow(getradius(),3)/3));
System.out.println();
System.out.printf( "Square perimeter, area:");
System.out.println();
System.out.printf( " perimeter : " + 2 *Math.E * 1.);
System.out.println();
System.out.printf( " area : " + Math.E * 1.* 1);
System.out.println();
}
public static void main( String[] args )
{
//System.out.printf( "Radius (as integer) of bounding sphere? %s! ", getradius() );
Scanner input = new Scanner( System.in );
System.out.println("Enter the radius:");
int radius = input.nextInt();
Shapes s = new Shapes(radius);
s.report();
}
}
Solution
Hi,
I have updated your code. It is working fine now. Highllighted all code changes below.
Shapes.java
import java.util.Scanner;
public class Shapes
{
private int radius;
public Shapes(int radius){
this.radius = radius;
}
public void setradius( int radius )
{
}
public int getradius()
{
return radius;
}
public void report()
{
System.out.printf( "Circle perimeter, area / Sphere volume:");
System.out.println();
System.out.printf( " perimeter : " + 2. * Math.PI * getradius());
System.out.println();
System.out.printf( " area : " + Math.PI * getradius() * 1.);
System.out.println();
System.out.printf( " volume : " + (4 * Math.PI * Math.pow(getradius(),3)/3));
System.out.println();
System.out.printf( "Square perimeter, area:");
System.out.println();
System.out.printf( " perimeter : " + 2 *Math.E * 1.);
System.out.println();
System.out.printf( " area : " + Math.E * 1.* 1);
System.out.println();
}
public static void main( String[] args )
{
//System.out.printf( "Radius (as integer) of bounding sphere? %s! ", getradius() );
Scanner input = new Scanner( System.in );
System.out.println("Enter the radius:");
int radius = input.nextInt();
Shapes s = new Shapes(radius);
s.report();
}
}
Output:
import java.util.Scanner;
public class Shapes
{
private int radius;
public Shapes(int radius){
this.radius = radius;
}
public void setradius( int radius )
{
}
public int getradius()
{
return radius;
}
public void report()
{
System.out.printf( "Circle perimeter, area / Sphere volume:");
System.out.println();
System.out.printf( " perimeter : " + 2. * Math.PI * getradius());
System.out.println();
System.out.printf( " area : " + Math.PI * getradius() * 1.);
System.out.println();
System.out.printf( " volume : " + (4 * Math.PI * Math.pow(getradius(),3)/3));
System.out.println();
System.out.printf( "Square perimeter, area:");
System.out.println();
System.out.printf( " perimeter : " + 2 *Math.E * 1.);
System.out.println();
System.out.printf( " area : " + Math.E * 1.* 1);
System.out.println();
}
public static void main( String[] args )
{
//System.out.printf( "Radius (as integer) of bounding sphere? %s! ", getradius() );
Scanner input = new Scanner( System.in );
System.out.println("Enter the radius:");
int radius = input.nextInt();
Shapes s = new Shapes(radius);
s.report();
}
}

More Related Content

Similar to Hi,I have updated your code. It is working fine now. Highllighted .pdf

AnswerNote Provided code shows several bugs, hence I implemented.pdf
AnswerNote Provided code shows several bugs, hence I implemented.pdfAnswerNote Provided code shows several bugs, hence I implemented.pdf
AnswerNote Provided code shows several bugs, hence I implemented.pdfanurag1231
ย 
5 Rmi Print
5  Rmi Print5  Rmi Print
5 Rmi Printvaradasuren
ย 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloadingkinan keshkeh
ย 
Object Oriented Solved Practice Programs C++ Exams
Object Oriented Solved Practice Programs C++ ExamsObject Oriented Solved Practice Programs C++ Exams
Object Oriented Solved Practice Programs C++ ExamsMuhammadTalha436
ย 
import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docxKatecate1
ย 
Java PRACTICAL file
Java PRACTICAL fileJava PRACTICAL file
Java PRACTICAL fileRACHIT_GUPTA
ย 
Circle.javaimport java.text.DecimalFormat;public class Circle {.pdf
Circle.javaimport java.text.DecimalFormat;public class Circle {.pdfCircle.javaimport java.text.DecimalFormat;public class Circle {.pdf
Circle.javaimport java.text.DecimalFormat;public class Circle {.pdfANJALIENTERPRISES1
ย 
Ann
AnnAnn
Annmicro536
ย 
How to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITHow to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITEgor Bogatov
ย 
Be cps-18 cps13or23-module1
Be cps-18 cps13or23-module1Be cps-18 cps13or23-module1
Be cps-18 cps13or23-module1kavya R
ย 
Engineering C-programing module1 ppt (18CPS13/23)
Engineering C-programing module1 ppt (18CPS13/23)Engineering C-programing module1 ppt (18CPS13/23)
Engineering C-programing module1 ppt (18CPS13/23)kavya R
ย 
Programimport java.util.Scanner; public class AreaOfRectangle {.pdf
Programimport java.util.Scanner; public class AreaOfRectangle {.pdfProgramimport java.util.Scanner; public class AreaOfRectangle {.pdf
Programimport java.util.Scanner; public class AreaOfRectangle {.pdfhimanshukausik409
ย 
Chapter 7 functions (c)
Chapter 7 functions (c)Chapter 7 functions (c)
Chapter 7 functions (c)hhliu
ย 

Similar to Hi,I have updated your code. It is working fine now. Highllighted .pdf (16)

Estructura secuencial -garcia
Estructura secuencial -garciaEstructura secuencial -garcia
Estructura secuencial -garcia
ย 
AnswerNote Provided code shows several bugs, hence I implemented.pdf
AnswerNote Provided code shows several bugs, hence I implemented.pdfAnswerNote Provided code shows several bugs, hence I implemented.pdf
AnswerNote Provided code shows several bugs, hence I implemented.pdf
ย 
Ch3
Ch3Ch3
Ch3
ย 
5 Rmi Print
5  Rmi Print5  Rmi Print
5 Rmi Print
ย 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
ย 
Object Oriented Solved Practice Programs C++ Exams
Object Oriented Solved Practice Programs C++ ExamsObject Oriented Solved Practice Programs C++ Exams
Object Oriented Solved Practice Programs C++ Exams
ย 
import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docx
ย 
Parameters
ParametersParameters
Parameters
ย 
Java PRACTICAL file
Java PRACTICAL fileJava PRACTICAL file
Java PRACTICAL file
ย 
Circle.javaimport java.text.DecimalFormat;public class Circle {.pdf
Circle.javaimport java.text.DecimalFormat;public class Circle {.pdfCircle.javaimport java.text.DecimalFormat;public class Circle {.pdf
Circle.javaimport java.text.DecimalFormat;public class Circle {.pdf
ย 
Ann
AnnAnn
Ann
ย 
How to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITHow to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJIT
ย 
Be cps-18 cps13or23-module1
Be cps-18 cps13or23-module1Be cps-18 cps13or23-module1
Be cps-18 cps13or23-module1
ย 
Engineering C-programing module1 ppt (18CPS13/23)
Engineering C-programing module1 ppt (18CPS13/23)Engineering C-programing module1 ppt (18CPS13/23)
Engineering C-programing module1 ppt (18CPS13/23)
ย 
Programimport java.util.Scanner; public class AreaOfRectangle {.pdf
Programimport java.util.Scanner; public class AreaOfRectangle {.pdfProgramimport java.util.Scanner; public class AreaOfRectangle {.pdf
Programimport java.util.Scanner; public class AreaOfRectangle {.pdf
ย 
Chapter 7 functions (c)
Chapter 7 functions (c)Chapter 7 functions (c)
Chapter 7 functions (c)
ย 

More from aniyathikitchen

1) (i)Finance (H)(ii) Corporation (J)(iii) Treasurer (G)(iv) L.pdf
1) (i)Finance (H)(ii) Corporation (J)(iii) Treasurer (G)(iv) L.pdf1) (i)Finance (H)(ii) Corporation (J)(iii) Treasurer (G)(iv) L.pdf
1) (i)Finance (H)(ii) Corporation (J)(iii) Treasurer (G)(iv) L.pdfaniyathikitchen
ย 
let no, na,nw be the refractive indices of oil, air and waterrespec.pdf
 let no, na,nw be the refractive indices of oil, air and waterrespec.pdf let no, na,nw be the refractive indices of oil, air and waterrespec.pdf
let no, na,nw be the refractive indices of oil, air and waterrespec.pdfaniyathikitchen
ย 
sol Quantum numbers describe an electrons shell.pdf
                     sol Quantum numbers describe an electrons shell.pdf                     sol Quantum numbers describe an electrons shell.pdf
sol Quantum numbers describe an electrons shell.pdfaniyathikitchen
ย 
There should be a table in your book with these L.pdf
                     There should be a table in your book with these L.pdf                     There should be a table in your book with these L.pdf
There should be a table in your book with these L.pdfaniyathikitchen
ย 
single displacement occurs when an element takes .pdf
                     single displacement occurs when an element takes .pdf                     single displacement occurs when an element takes .pdf
single displacement occurs when an element takes .pdfaniyathikitchen
ย 
pH Electrode Maintenance The entire glass membra.pdf
                     pH Electrode Maintenance  The entire glass membra.pdf                     pH Electrode Maintenance  The entire glass membra.pdf
pH Electrode Maintenance The entire glass membra.pdfaniyathikitchen
ย 
O-O+ +e- is the correct answer as first ionizati.pdf
                     O-O+ +e- is the correct answer as first ionizati.pdf                     O-O+ +e- is the correct answer as first ionizati.pdf
O-O+ +e- is the correct answer as first ionizati.pdfaniyathikitchen
ย 
O and H always make covalent bond. You can tell .pdf
                     O and H always make covalent bond.  You can tell .pdf                     O and H always make covalent bond.  You can tell .pdf
O and H always make covalent bond. You can tell .pdfaniyathikitchen
ย 
NiCO3 (s) + H2SO4 (aq) NiSO4 (s) + CO2 (g) + H2.pdf
                     NiCO3 (s) + H2SO4 (aq)  NiSO4 (s) + CO2 (g) + H2.pdf                     NiCO3 (s) + H2SO4 (aq)  NiSO4 (s) + CO2 (g) + H2.pdf
NiCO3 (s) + H2SO4 (aq) NiSO4 (s) + CO2 (g) + H2.pdfaniyathikitchen
ย 
When I was getting ready at home, I was excited and anxious, but as .pdf
When I was getting ready at home, I was excited and anxious, but as .pdfWhen I was getting ready at home, I was excited and anxious, but as .pdf
When I was getting ready at home, I was excited and anxious, but as .pdfaniyathikitchen
ย 
Viruses are those biological entities which are intermediate between.pdf
Viruses are those biological entities which are intermediate between.pdfViruses are those biological entities which are intermediate between.pdf
Viruses are those biological entities which are intermediate between.pdfaniyathikitchen
ย 
The most probable answer if this question seems to be option B. The .pdf
The most probable answer if this question seems to be option B. The .pdfThe most probable answer if this question seems to be option B. The .pdf
The most probable answer if this question seems to be option B. The .pdfaniyathikitchen
ย 
Exactly how you have drawn it, this compounds I.pdf
                     Exactly how you have drawn it, this compounds I.pdf                     Exactly how you have drawn it, this compounds I.pdf
Exactly how you have drawn it, this compounds I.pdfaniyathikitchen
ย 
The contamination could be due to the presence of yeast in the cultu.pdf
The contamination could be due to the presence of yeast in the cultu.pdfThe contamination could be due to the presence of yeast in the cultu.pdf
The contamination could be due to the presence of yeast in the cultu.pdfaniyathikitchen
ย 
Systems Development Life Cycle(SDLC) is the step by step process whi.pdf
Systems Development Life Cycle(SDLC) is the step by step process whi.pdfSystems Development Life Cycle(SDLC) is the step by step process whi.pdf
Systems Development Life Cycle(SDLC) is the step by step process whi.pdfaniyathikitchen
ย 
d. spontaneous at all temperatures .pdf
                     d. spontaneous at all temperatures               .pdf                     d. spontaneous at all temperatures               .pdf
d. spontaneous at all temperatures .pdfaniyathikitchen
ย 
MineSweeper.java public class MS { public static void main(Strin.pdf
MineSweeper.java public class MS { public static void main(Strin.pdfMineSweeper.java public class MS { public static void main(Strin.pdf
MineSweeper.java public class MS { public static void main(Strin.pdfaniyathikitchen
ย 
It is truebecause The SMTP server cannot find the destination emai.pdf
It is truebecause The SMTP server cannot find the destination emai.pdfIt is truebecause The SMTP server cannot find the destination emai.pdf
It is truebecause The SMTP server cannot find the destination emai.pdfaniyathikitchen
ย 
Homo neanderthalensis are evolved and lived ina) Europe andor sou.pdf
Homo neanderthalensis are evolved and lived ina) Europe andor sou.pdfHomo neanderthalensis are evolved and lived ina) Europe andor sou.pdf
Homo neanderthalensis are evolved and lived ina) Europe andor sou.pdfaniyathikitchen
ย 
B. note aldehydes hydrolysis gives diol products.pdf
                     B. note aldehydes hydrolysis gives diol products.pdf                     B. note aldehydes hydrolysis gives diol products.pdf
B. note aldehydes hydrolysis gives diol products.pdfaniyathikitchen
ย 

More from aniyathikitchen (20)

1) (i)Finance (H)(ii) Corporation (J)(iii) Treasurer (G)(iv) L.pdf
1) (i)Finance (H)(ii) Corporation (J)(iii) Treasurer (G)(iv) L.pdf1) (i)Finance (H)(ii) Corporation (J)(iii) Treasurer (G)(iv) L.pdf
1) (i)Finance (H)(ii) Corporation (J)(iii) Treasurer (G)(iv) L.pdf
ย 
let no, na,nw be the refractive indices of oil, air and waterrespec.pdf
 let no, na,nw be the refractive indices of oil, air and waterrespec.pdf let no, na,nw be the refractive indices of oil, air and waterrespec.pdf
let no, na,nw be the refractive indices of oil, air and waterrespec.pdf
ย 
sol Quantum numbers describe an electrons shell.pdf
                     sol Quantum numbers describe an electrons shell.pdf                     sol Quantum numbers describe an electrons shell.pdf
sol Quantum numbers describe an electrons shell.pdf
ย 
There should be a table in your book with these L.pdf
                     There should be a table in your book with these L.pdf                     There should be a table in your book with these L.pdf
There should be a table in your book with these L.pdf
ย 
single displacement occurs when an element takes .pdf
                     single displacement occurs when an element takes .pdf                     single displacement occurs when an element takes .pdf
single displacement occurs when an element takes .pdf
ย 
pH Electrode Maintenance The entire glass membra.pdf
                     pH Electrode Maintenance  The entire glass membra.pdf                     pH Electrode Maintenance  The entire glass membra.pdf
pH Electrode Maintenance The entire glass membra.pdf
ย 
O-O+ +e- is the correct answer as first ionizati.pdf
                     O-O+ +e- is the correct answer as first ionizati.pdf                     O-O+ +e- is the correct answer as first ionizati.pdf
O-O+ +e- is the correct answer as first ionizati.pdf
ย 
O and H always make covalent bond. You can tell .pdf
                     O and H always make covalent bond.  You can tell .pdf                     O and H always make covalent bond.  You can tell .pdf
O and H always make covalent bond. You can tell .pdf
ย 
NiCO3 (s) + H2SO4 (aq) NiSO4 (s) + CO2 (g) + H2.pdf
                     NiCO3 (s) + H2SO4 (aq)  NiSO4 (s) + CO2 (g) + H2.pdf                     NiCO3 (s) + H2SO4 (aq)  NiSO4 (s) + CO2 (g) + H2.pdf
NiCO3 (s) + H2SO4 (aq) NiSO4 (s) + CO2 (g) + H2.pdf
ย 
When I was getting ready at home, I was excited and anxious, but as .pdf
When I was getting ready at home, I was excited and anxious, but as .pdfWhen I was getting ready at home, I was excited and anxious, but as .pdf
When I was getting ready at home, I was excited and anxious, but as .pdf
ย 
Viruses are those biological entities which are intermediate between.pdf
Viruses are those biological entities which are intermediate between.pdfViruses are those biological entities which are intermediate between.pdf
Viruses are those biological entities which are intermediate between.pdf
ย 
The most probable answer if this question seems to be option B. The .pdf
The most probable answer if this question seems to be option B. The .pdfThe most probable answer if this question seems to be option B. The .pdf
The most probable answer if this question seems to be option B. The .pdf
ย 
Exactly how you have drawn it, this compounds I.pdf
                     Exactly how you have drawn it, this compounds I.pdf                     Exactly how you have drawn it, this compounds I.pdf
Exactly how you have drawn it, this compounds I.pdf
ย 
The contamination could be due to the presence of yeast in the cultu.pdf
The contamination could be due to the presence of yeast in the cultu.pdfThe contamination could be due to the presence of yeast in the cultu.pdf
The contamination could be due to the presence of yeast in the cultu.pdf
ย 
Systems Development Life Cycle(SDLC) is the step by step process whi.pdf
Systems Development Life Cycle(SDLC) is the step by step process whi.pdfSystems Development Life Cycle(SDLC) is the step by step process whi.pdf
Systems Development Life Cycle(SDLC) is the step by step process whi.pdf
ย 
d. spontaneous at all temperatures .pdf
                     d. spontaneous at all temperatures               .pdf                     d. spontaneous at all temperatures               .pdf
d. spontaneous at all temperatures .pdf
ย 
MineSweeper.java public class MS { public static void main(Strin.pdf
MineSweeper.java public class MS { public static void main(Strin.pdfMineSweeper.java public class MS { public static void main(Strin.pdf
MineSweeper.java public class MS { public static void main(Strin.pdf
ย 
It is truebecause The SMTP server cannot find the destination emai.pdf
It is truebecause The SMTP server cannot find the destination emai.pdfIt is truebecause The SMTP server cannot find the destination emai.pdf
It is truebecause The SMTP server cannot find the destination emai.pdf
ย 
Homo neanderthalensis are evolved and lived ina) Europe andor sou.pdf
Homo neanderthalensis are evolved and lived ina) Europe andor sou.pdfHomo neanderthalensis are evolved and lived ina) Europe andor sou.pdf
Homo neanderthalensis are evolved and lived ina) Europe andor sou.pdf
ย 
B. note aldehydes hydrolysis gives diol products.pdf
                     B. note aldehydes hydrolysis gives diol products.pdf                     B. note aldehydes hydrolysis gives diol products.pdf
B. note aldehydes hydrolysis gives diol products.pdf
ย 

Recently uploaded

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
ย 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
ย 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
ย 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
ย 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...Dr. Mazin Mohamed alkathiri
ย 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
ย 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
ย 
โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
ย 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
ย 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)Dr. Mazin Mohamed alkathiri
ย 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
ย 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
ย 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
ย 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
ย 
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธcall girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
ย 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
ย 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
ย 

Recently uploaded (20)

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
ย 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
ย 
Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
ย 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
ย 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)โ€”โ€”โ€”โ€”IMP.OF KSHARA ...
ย 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
ย 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
ย 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
ย 
โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
โ€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
ย 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
ย 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
ย 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
ย 
Model Call Girl in Bikash Puri Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
Model Call Girl in Bikash Puri  Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”Model Call Girl in Bikash Puri  Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
Model Call Girl in Bikash Puri Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
ย 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
ย 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
ย 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
ย 
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธcall girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Kamla Market (DELHI) ๐Ÿ” >เผ’9953330565๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
ย 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
ย 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
ย 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
ย 

Hi,I have updated your code. It is working fine now. Highllighted .pdf

  • 1. Hi, I have updated your code. It is working fine now. Highllighted all code changes below. Shapes.java import java.util.Scanner; public class Shapes { private int radius; public Shapes(int radius){ this.radius = radius; } public void setradius( int radius ) { } public int getradius() { return radius; } public void report() { System.out.printf( "Circle perimeter, area / Sphere volume:"); System.out.println(); System.out.printf( " perimeter : " + 2. * Math.PI * getradius()); System.out.println(); System.out.printf( " area : " + Math.PI * getradius() * 1.); System.out.println(); System.out.printf( " volume : " + (4 * Math.PI * Math.pow(getradius(),3)/3)); System.out.println(); System.out.printf( "Square perimeter, area:"); System.out.println(); System.out.printf( " perimeter : " + 2 *Math.E * 1.); System.out.println(); System.out.printf( " area : " + Math.E * 1.* 1);
  • 2. System.out.println(); } public static void main( String[] args ) { //System.out.printf( "Radius (as integer) of bounding sphere? %s! ", getradius() ); Scanner input = new Scanner( System.in ); System.out.println("Enter the radius:"); int radius = input.nextInt(); Shapes s = new Shapes(radius); s.report(); } } Output: import java.util.Scanner; public class Shapes { private int radius; public Shapes(int radius){ this.radius = radius; } public void setradius( int radius ) { } public int getradius() { return radius; } public void report() { System.out.printf( "Circle perimeter, area / Sphere volume:"); System.out.println();
  • 3. System.out.printf( " perimeter : " + 2. * Math.PI * getradius()); System.out.println(); System.out.printf( " area : " + Math.PI * getradius() * 1.); System.out.println(); System.out.printf( " volume : " + (4 * Math.PI * Math.pow(getradius(),3)/3)); System.out.println(); System.out.printf( "Square perimeter, area:"); System.out.println(); System.out.printf( " perimeter : " + 2 *Math.E * 1.); System.out.println(); System.out.printf( " area : " + Math.E * 1.* 1); System.out.println(); } public static void main( String[] args ) { //System.out.printf( "Radius (as integer) of bounding sphere? %s! ", getradius() ); Scanner input = new Scanner( System.in ); System.out.println("Enter the radius:"); int radius = input.nextInt(); Shapes s = new Shapes(radius); s.report(); } } Solution Hi, I have updated your code. It is working fine now. Highllighted all code changes below. Shapes.java import java.util.Scanner; public class Shapes { private int radius;
  • 4. public Shapes(int radius){ this.radius = radius; } public void setradius( int radius ) { } public int getradius() { return radius; } public void report() { System.out.printf( "Circle perimeter, area / Sphere volume:"); System.out.println(); System.out.printf( " perimeter : " + 2. * Math.PI * getradius()); System.out.println(); System.out.printf( " area : " + Math.PI * getradius() * 1.); System.out.println(); System.out.printf( " volume : " + (4 * Math.PI * Math.pow(getradius(),3)/3)); System.out.println(); System.out.printf( "Square perimeter, area:"); System.out.println(); System.out.printf( " perimeter : " + 2 *Math.E * 1.); System.out.println(); System.out.printf( " area : " + Math.E * 1.* 1); System.out.println(); } public static void main( String[] args ) { //System.out.printf( "Radius (as integer) of bounding sphere? %s! ", getradius() ); Scanner input = new Scanner( System.in ); System.out.println("Enter the radius:"); int radius = input.nextInt();
  • 5. Shapes s = new Shapes(radius); s.report(); } } Output: import java.util.Scanner; public class Shapes { private int radius; public Shapes(int radius){ this.radius = radius; } public void setradius( int radius ) { } public int getradius() { return radius; } public void report() { System.out.printf( "Circle perimeter, area / Sphere volume:"); System.out.println(); System.out.printf( " perimeter : " + 2. * Math.PI * getradius()); System.out.println(); System.out.printf( " area : " + Math.PI * getradius() * 1.); System.out.println(); System.out.printf( " volume : " + (4 * Math.PI * Math.pow(getradius(),3)/3)); System.out.println(); System.out.printf( "Square perimeter, area:"); System.out.println(); System.out.printf( " perimeter : " + 2 *Math.E * 1.);
  • 6. System.out.println(); System.out.printf( " area : " + Math.E * 1.* 1); System.out.println(); } public static void main( String[] args ) { //System.out.printf( "Radius (as integer) of bounding sphere? %s! ", getradius() ); Scanner input = new Scanner( System.in ); System.out.println("Enter the radius:"); int radius = input.nextInt(); Shapes s = new Shapes(radius); s.report(); } }