Java Assignment for class

Budget $30 - $250 USD
Bids 20
Average Bid $103

The goal is to create a project that would let a user compute area and perimeter of a polygon. Restrict
the type of polygon inputs to Triangle, Quadrilateral, Pentagon, Hexagon, and Octagon only. Your
program must implement classes IsocelesTriangle, EquilateralTriangle, Rectangle, and Square, which
have the appropriate inheritance relationships. Use abstract classes, interfaces, and exception handling
where appropriate.
For pentagon, hexagon, and octagon assume that the polygon is regular i.e. all the sides are of same
length. For these the input must consist of the type of polygon and length of side (example: pentagon
and 7 where type is pentagon and 7 is length of each side of a pentagon). Use the following formulae’s
to compute the area of a regular polygon where “a” is the length of the side.
Area of regular Octagon:

Area of a regular Hexagon: √

Area of a regular Pentagon:

In case of a triangle or quadrilateral you may or may not have a regular polygon. If a triangle or
quadrilateral is regular then it’s an equilateral triangle or a square respectively. In these cases again your
input will consist of the type of polygon and length of side (example: quadrilateral and 4). If a triangle
or quadrilateral is not regular then the only allowed types must be an rectangle and isosceles triangle. In
each of these cases your inputs will consist of three parts. The first part will be type of polygon and
second and third parts will be the two different possible side. In case of a rectangle let your second input
be length (l) and third input be width (w) and in case of a isosceles triangle let the second input be
base(b) and the third input be height (h). Use the following formulae’s for triangles and quadrilaterals.
Area of an equilateral triangle: √

Area of a square:

Area of an isosceles triangle:

Area of a rectangle:
Sample inputs:
1. pentagon 5
2. octagon 4
3. triangle 3
4. triangle 4 8
5. quadrilateral 8
6. quadrilateral 6 3

Post a Project Like This

This project was awarded to


Excellent. Just excellent. Fantastic experience. Went through a lot of trouble to talk me through everything and ensure that I had everything I needed. Went above and beyond. Gave me exactly what I was looking for. Will be hiring for my next Java project.
About the Freelancer
abhinay18 Profile Picture

I am a Java and JavaFX Expert. Have worked with frameworks like spring, JSF 2.0

Looking to make some money?

  • Set your budget and the time frame
  • Outline your proposal
  • Get paid for your work

Bids on this Project

  • gkan1234 Profile Picture


    Bangalore,  India

    Working in Software Development field for the past 7 years. My skills include Java, MySQL, Linux/Windows OS.

    PHP, Java, Python, and .NET

  • drejmar Profile Picture


    Horjul,  Slovenia

    I had the opportunity to study and work abroad and be in constant contact with people of various world views. These experiences helped me become a role model by encouraging people to do their best and to build a positive attitude towards work. Following my graduation I worked as a Java instructor by teaching students object-oriented programming. In the past I worked at where I implemented a simple to use document system. This empowered employees to more effectively prepare to work with youth. With the help of my colleagues at Sinergise, I made some interesting visualizations on the platform. Individually I added functionalities such as the English version, search capability, import and export of layers and records.

    PHP, Java, Website Design, and Linux

  • hbxfnzwpf Profile Picture


    Beijing,  China

    I am a MMORPG game developer, mainly focus on server side, and I am also very familiar with client side developing. I have 14 years programming experience, and worked for 6 years. I am an expert of C++ and Java, and proficient in developing under Windows/Linux/Unix/Embeded environment. I promise to give you the best solution.

    C Programming, Java, Python, and Software Architecture

  • ranganathp Profile Picture


    Bangalore,  India

    I am a professional developer of Windows, Linux, Mac, Android, Windows Phone, iPhone, iPad and Web applications. I am a qualified expert in several programming languages including but not limited to PHP, JAVA, C, C++, PYTHON and OBJECTIVE C; I have been developing applications for the last 16 years, most of which are high quality, extremely high performance, low maintenance, network and security based, Geo location aware and most importantly intuitive and user friendly. I have implemented 800+ projects on and outside, including productivity and business related applications for various Desktop, Web and Mobile application platforms. Lot of experience in writing applications which make use of social platform accounts(FB, Twitter and others), location services, and data synchronisation techniques(Dropbox, iCloud, Skydrive and others) in order to provide a high level of satisfaction and great experience to the users of the applications. I have vast experience in using following technologies in my applications: - Various Networking Technologies - Various SQL databases like Oracle, SQL Server, DB2, MySql and Postgres - Various NOSQL databases like mongodb, amazon dynamodb and hadoop - iCloud/Dropbox/Skydrive support - Geo Location services - Security for both data and accounts - Login integration with oAuth, OpenID and other Single signon technologies - Semantic text processing and extraction of qualified information - Application optimizations by solving Memory leaks and Performance issues - UI/UX design based on standards Throw in any challenge in anything in technology and design and get 100% value for money through best quality bullet-proof work done.

    PHP, Java, Python, and .NET

  • ahmedabdallah1 Profile Picture


    Alexandria,  Egypt

    I'm Ahmed Abdallah, a fourth year student at computer and systems engineering at Alexandria University. I'm a perfect at java, c++ and android development. I'm very good at data structures and algorithm and good at php, HTML and javascript

    PHP, C Programming, Java, and Javascript

  • shikhaagarawal Profile Picture


    Phoenix,  United States

    Java/J2EE developer with 8 years of IT experience.

    Java, JSP, Javascript, and XML

  • urmate Profile Picture


    Lahore,  Pakistan

    I am a well reputed individual freelancer on all major freelancing platforms with 6 years of online presence and more than 3400+ 5-Star reviews on various freelance web sites. I have extensive development experience in various computing fields including PHP, Java, C#,, JSP,, Ajax, Jquery, MySQL, Oracle, Mssql, Html5, CSS3, Android, CodeIgniter, JavaScript, J2EE and many more. I’m equally competent for all sort of desktop, web and mobile application development. **** Working Hours: 12:00 AM - 12:00 PM EST **** Area of Expertise 1. PHP, MVC, Design Patterns, OOP. 2. MySql, Database Design, Analysis, Diagrams, DDL, DML. 3. Java, Swing, JFC, JMS, JMF, JPA 4. Visual Basic all versions., visual studio 5. C#.Net all versions, visual studio 6. JSP, Servlets, J2EE, Struts, Hibernate, Spring 7. Oracle 9i, 10g, 11 g, Pl/sql 8. MSSQL Server 2005, 2008, 2012. 9. Asp, MVC, (, 10. Word Press, Code Igniter. 11. NoSQL, MongoDB. 12. JQuery, Ajax, Java Script, VbScript. 13. Xml, Xslt, Xpath, XQuery, Python. 14. Node.js, Angular.js, Ember.js, Backbone.js. 15. JQuery UI, Html, Html5, CSS3, Bootstrap 16. Social Media APIs. Facebook, Twitter, LinkedIn Instagram, Google+, Oauth 02 17. Google APIs search, books, analytics 18. UML, Analysis and Design, Software Architecture, UML Diagrams.

    ASP, C Programming, Java, and JSP

  • rsonbol Profile Picture


    Damascus,  Syrian Arab Republic

    I have experience in two kinds of skills: artificial intelligence and web development.. * I have more than 8 years experience in Data Mining, Natural Language Processing, Machine Learning, Business intelligence and many other fields in artificial intelligence. I have worked on many projects some of them are research projects. Moreover, I have published many papers in these fields and I am an assistant teacher for ML, NLP, and algorithm courses at the university.. * I have more than 10 years experience in web developments and have worked on more than 50 websites in php, MySQL, python, and java including e-commerce websites, educational websites, personal websites,dashboards, advanced web management solutions. Key Skills :) ------------------ #Data_Mining #Natural_Language_Processing #Machine_Learning #Business_Intelligence #Artificial_intelligence #web_development #PHP_Websites #E_commerce_websites

    PHP, Java, XML, and Python

  • larryellison Profile Picture


    532,  India

    I am a very dedicated person.Whether its about developing softwares,article writing or anything.I learn things quickly and my work is my first priority and everything for me.

    Java, Javascript, .NET, and Data Entry

  • suraj99p Profile Picture


    delhi,  India

    I am a professional software developer and is associated with computers for past 15years.

    Perl, C Programming, Java, and XML