Проект Пентагона на С ++

Су .. яя пишу проект пятиугольника для моего класса C ++, и, честно говоря, яЯ не очень хорошо сейчас из-за работы и других классов. Итак ... нам нужно сделать программу пятиугольника, которая будет иметь класс Пентагон и класс меню. Мне удалось работать в Меню Класс, но яЯ не уверен, как работать с классом Пентагона. В любом случае, в настоящее время мне нужно создать правильное уравнение с квадратными корнями.

Уравнение для нахождения Пентагона:

A = s ^ 2 sqrt (из 25 + 10 sqrt (5)) / (более) 4

Так как мне это сделать? Это то, что у меня есть в моем классе меню:

//  ==================
   #include "StdAfx.h"
   #include 
   #include 
   #include 
//  ==================

//  ================
//  Class Inclusions
//  ================
   #include "MenuClass.h"
   #include "Math.h"
//  ================

//  ====================
    using namespace std;
//  ====================

//  ============
//  Constructors
//  ============

//      ===================
//      Default Constructor
//      ====================
        Menu::Menu( void ) {

            userMenuSelection = Quit;

        } // Constructor Menu
//      =====================

        Menu::~Menu( void ) {

            cout < "====================================" < endl;

        } // Destructor ~Menu
//      =====================

//      ==============================
//      Accessor Member-Function Get()
//      ==========================
        MenuChoices Menu::Get( ) {

            return userMenuSelection;

        } // Accessor Method Get
//      ========================

//      =============================
//      Mutator Member-Function Set()
//      ========================================
        void Menu::Set( MenuChoices newValue ) {

            userMenuSelection = newValue;

        } // Mutator Method Set
//      =======================

//      ==========================
//      Member-Function Display( )
//      ==========================
        void Menu::Display( ) {

            cout < "======================================" < endl;
            cout < "             MENU SELECTION           " < endl;
            cout < "======================================" < endl;
            cout < "1: Calculate the Perimeter of Pentagon" < endl;
            cout < "2: Calculate the Area of Pentagon" < endl;
            cout < "3: Quit" < endl;
            cout < "======================================" < endl;
            cout < endl;

        } // Member-Function Display
//      ============================

//      =========================
//      Member-Function QueryUser
//      =========================
        void Menu::QueryUser( ) {

            int selection;

            cout < "Enter Menu Selection: ";
            cin >> selection;

            switch (selection){
                case 1: userMenuSelection = Perimeter;
                    break;

                case 2: userMenuSelection = Area;
                    break;

                case 3: userMenuSelection = Quit;

                default: userMenuSelection = Quit;
            } // switch
//          ===========

            cout < endl;

        } // Method QueryUser()
//      =======================

//      =================
//      Method Continue()
//      ========================
        bool Menu::Continue( ) {

            return userMenuSelection != Quit;

        } // Method Continue
//      ====================

//      ==============================
//      Member-Function ProcessCommand
//      ==============================
        void Menu::ProcessCommand( ) {

            int numberA; // Length of Sides
            int numberB; // Area


            if (userMenuSelection == Quit ){

               cout < "Thank you for using this type of program. Have a nice day!" < endl;
            }

            else if (userMenuSelection != Quit) {

            cout < "Please enter an integer value for the length of the sides: ";
            cin >> numberA;

//              ==============================
                switch ( userMenuSelection ) {

                    case Perimeter:

                        cout < "Perimeter = " < (5 * numberA) < endl;

                        break;

                    case Area:

                        // Equation of Area:
                        // s^2*sqrt(25+10(sqrt(5)))/4

                        // 10*sqrt(5) = 22.36067977

                        double area;
                        area = sqrt(numberA(1+1));

                        return area;

                        ///cout < "Area = " < ((numberA*numberA) * (5 + 22.36067977)) / 4  <  endl;

                        //int param;
                        //int result;
                        //param = 1;

                        //cout < result = sqrt (param) < endl;


                        break;

                    default: cout < "Warning: error state encountered." < endl;

                }
                cout < endl;
              }    
            }

// ========================

Ответы на вопрос(1)

Ваш ответ на вопрос