SlideShare a Scribd company logo
1 of 2
Download to read offline
import java.util.Scanner;
public class PentagoanArea {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter the length from center to vertex: ");
double r = sc.nextDouble();
double sineRadians = Math.toRadians(Math.PI/5);
double tanRadian = Math.toRadians(Math.PI/2);
double s = 2*r*Math.sin(sineRadians);
double area = (5*s*s)/(4*Math.tan(tanRadian));
System.out.println("The are of the pentagoan is: "+String.format("%.2f", area));
//System.out.println("The are of the pentagoan is: "+area);
}
}
Solution
import java.util.Scanner;
public class PentagoanArea {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter the length from center to vertex: ");
double r = sc.nextDouble();
double sineRadians = Math.toRadians(Math.PI/5);
double tanRadian = Math.toRadians(Math.PI/2);
double s = 2*r*Math.sin(sineRadians);
double area = (5*s*s)/(4*Math.tan(tanRadian));
System.out.println("The are of the pentagoan is: "+String.format("%.2f", area));
//System.out.println("The are of the pentagoan is: "+area);
}
}

More Related Content

Similar to import java.util.Scanner;public class PentagoanArea {   public.pdf

Modify your solution for PLP04 to allow the user to choose the shape.pdf
Modify your solution for PLP04 to allow the user to choose the shape.pdfModify your solution for PLP04 to allow the user to choose the shape.pdf
Modify your solution for PLP04 to allow the user to choose the shape.pdf
hullibergerr25980
 
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
himanshukausik409
 
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 Problem1 java codeimport java.util.Scanner; Java code to pr.pdf Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
anupamfootwear
 

Similar to import java.util.Scanner;public class PentagoanArea {   public.pdf (14)

Review Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdfReview Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdf
 
java-programming.pdf
java-programming.pdfjava-programming.pdf
java-programming.pdf
 
Modify your solution for PLP04 to allow the user to choose the shape.pdf
Modify your solution for PLP04 to allow the user to choose the shape.pdfModify your solution for PLP04 to allow the user to choose the shape.pdf
Modify your solution for PLP04 to allow the user to choose the shape.pdf
 
java program assigment -1
java program assigment -1java program assigment -1
java program assigment -1
 
Core java pract_sem iii
Core java pract_sem iiiCore java pract_sem iii
Core java pract_sem iii
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptx
 
3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf3.Lesson Plan - Input.pdf.pdf
3.Lesson Plan - Input.pdf.pdf
 
programming for Calculator in java
programming for Calculator in javaprogramming for Calculator in java
programming for Calculator in java
 
Java file
Java fileJava file
Java file
 
Java file
Java fileJava file
Java file
 
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
 
Java programming lab manual
Java programming lab manualJava programming lab manual
Java programming lab manual
 
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 Problem1 java codeimport java.util.Scanner; Java code to pr.pdf Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 
LAB1.docx
LAB1.docxLAB1.docx
LAB1.docx
 

More from sudhirchourasia86

  package Chapter_20;import ToolKit.PostfixNotation;import javaf.pdf
  package Chapter_20;import ToolKit.PostfixNotation;import javaf.pdf  package Chapter_20;import ToolKit.PostfixNotation;import javaf.pdf
  package Chapter_20;import ToolKit.PostfixNotation;import javaf.pdf
sudhirchourasia86
 
There are ten guidelines with a broad coverage, ranging from develop.pdf
There are ten guidelines with a broad coverage, ranging from develop.pdfThere are ten guidelines with a broad coverage, ranging from develop.pdf
There are ten guidelines with a broad coverage, ranging from develop.pdf
sudhirchourasia86
 
The way Ive been told to look at the classifications is to look at.pdf
The way Ive been told to look at the classifications is to look at.pdfThe way Ive been told to look at the classifications is to look at.pdf
The way Ive been told to look at the classifications is to look at.pdf
sudhirchourasia86
 

More from sudhirchourasia86 (20)

W since less electrons means difficult to melt so.pdf
                     W since less electrons means difficult to melt so.pdf                     W since less electrons means difficult to melt so.pdf
W since less electrons means difficult to melt so.pdf
 
To the left. The ketone is more stable compared .pdf
                     To the left.  The ketone is more stable compared .pdf                     To the left.  The ketone is more stable compared .pdf
To the left. The ketone is more stable compared .pdf
 
The true statement is D. Concentration affects .pdf
                     The true statement is  D. Concentration affects .pdf                     The true statement is  D. Concentration affects .pdf
The true statement is D. Concentration affects .pdf
 
Smaller mass gases have greater rates of effusion.pdf
                     Smaller mass gases have greater rates of effusion.pdf                     Smaller mass gases have greater rates of effusion.pdf
Smaller mass gases have greater rates of effusion.pdf
 
please send the question details I have gone thr.pdf
                     please send the question details  I have gone thr.pdf                     please send the question details  I have gone thr.pdf
please send the question details I have gone thr.pdf
 
O3, SO3, SO2 .pdf
                     O3, SO3, SO2                                     .pdf                     O3, SO3, SO2                                     .pdf
O3, SO3, SO2 .pdf
 
melting point of the compound increases due to th.pdf
                     melting point of the compound increases due to th.pdf                     melting point of the compound increases due to th.pdf
melting point of the compound increases due to th.pdf
 
molality = moles of solute kg of solvent In thi.pdf
                     molality = moles of solute  kg of solvent In thi.pdf                     molality = moles of solute  kg of solvent In thi.pdf
molality = moles of solute kg of solvent In thi.pdf
 
Ionic Equation is MgO(s) + 2 H+(aq) + 2NO3- (aq.pdf
                     Ionic Equation is   MgO(s) + 2 H+(aq) + 2NO3- (aq.pdf                     Ionic Equation is   MgO(s) + 2 H+(aq) + 2NO3- (aq.pdf
Ionic Equation is MgO(s) + 2 H+(aq) + 2NO3- (aq.pdf
 
FeBrs is a typo Lets suppose it is FeBr2. 2Na .pdf
                     FeBrs is a typo Lets suppose it is FeBr2. 2Na .pdf                     FeBrs is a typo Lets suppose it is FeBr2. 2Na .pdf
FeBrs is a typo Lets suppose it is FeBr2. 2Na .pdf
 
Density increases .pdf
                     Density increases                                .pdf                     Density increases                                .pdf
Density increases .pdf
 
d) in real gases there are attraction between m.pdf
                     d)   in real gases there are attraction between m.pdf                     d)   in real gases there are attraction between m.pdf
d) in real gases there are attraction between m.pdf
 
SolutionTraversing Binary Trees The preorder standard procedure.pdf
SolutionTraversing Binary Trees The preorder standard procedure.pdfSolutionTraversing Binary Trees The preorder standard procedure.pdf
SolutionTraversing Binary Trees The preorder standard procedure.pdf
 
Shareholder’s equity= Current assets+Net fixed assets-Current lia.pdf
Shareholder’s equity= Current assets+Net fixed assets-Current lia.pdfShareholder’s equity= Current assets+Net fixed assets-Current lia.pdf
Shareholder’s equity= Current assets+Net fixed assets-Current lia.pdf
 
in Reproductive cloning of mammals the Nucelus ( Genetic material) f.pdf
in Reproductive cloning of mammals the Nucelus ( Genetic material) f.pdfin Reproductive cloning of mammals the Nucelus ( Genetic material) f.pdf
in Reproductive cloning of mammals the Nucelus ( Genetic material) f.pdf
 
   a) OH- (aq) is a Lewis base because it can give electrions to Oth.pdf
   a) OH- (aq) is a Lewis base because it can give electrions to Oth.pdf   a) OH- (aq) is a Lewis base because it can give electrions to Oth.pdf
   a) OH- (aq) is a Lewis base because it can give electrions to Oth.pdf
 
  package Chapter_20;import ToolKit.PostfixNotation;import javaf.pdf
  package Chapter_20;import ToolKit.PostfixNotation;import javaf.pdf  package Chapter_20;import ToolKit.PostfixNotation;import javaf.pdf
  package Chapter_20;import ToolKit.PostfixNotation;import javaf.pdf
 
Initial concentration of NH3 = molesvolume = 0.2501.00 = 0.250 M.pdf
Initial concentration of NH3 = molesvolume = 0.2501.00 = 0.250 M.pdfInitial concentration of NH3 = molesvolume = 0.2501.00 = 0.250 M.pdf
Initial concentration of NH3 = molesvolume = 0.2501.00 = 0.250 M.pdf
 
There are ten guidelines with a broad coverage, ranging from develop.pdf
There are ten guidelines with a broad coverage, ranging from develop.pdfThere are ten guidelines with a broad coverage, ranging from develop.pdf
There are ten guidelines with a broad coverage, ranging from develop.pdf
 
The way Ive been told to look at the classifications is to look at.pdf
The way Ive been told to look at the classifications is to look at.pdfThe way Ive been told to look at the classifications is to look at.pdf
The way Ive been told to look at the classifications is to look at.pdf
 

Recently uploaded

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Recently uploaded (20)

Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 

import java.util.Scanner;public class PentagoanArea {   public.pdf

  • 1. import java.util.Scanner; public class PentagoanArea { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Enter the length from center to vertex: "); double r = sc.nextDouble(); double sineRadians = Math.toRadians(Math.PI/5); double tanRadian = Math.toRadians(Math.PI/2); double s = 2*r*Math.sin(sineRadians); double area = (5*s*s)/(4*Math.tan(tanRadian)); System.out.println("The are of the pentagoan is: "+String.format("%.2f", area)); //System.out.println("The are of the pentagoan is: "+area); } } Solution import java.util.Scanner; public class PentagoanArea { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Enter the length from center to vertex: "); double r = sc.nextDouble(); double sineRadians = Math.toRadians(Math.PI/5);
  • 2. double tanRadian = Math.toRadians(Math.PI/2); double s = 2*r*Math.sin(sineRadians); double area = (5*s*s)/(4*Math.tan(tanRadian)); System.out.println("The are of the pentagoan is: "+String.format("%.2f", area)); //System.out.println("The are of the pentagoan is: "+area); } }