Answer to Question #182758 in C++ for Fuad Endris

Question #182758

#1. Write a simple c++ program in to calculate the area of a regular hexagon.

#2. Write a program to compute the following mathematical equation to find the value of Y;

Y= 4x3 + 8x2 + 9x-19 over(÷) |7-x3| + square root of 3x2 +19


1
Expert's answer
2021-04-18T11:23:00-0400
#include <iostream>
double hexagon_area(double side) 
{
    return (pow(side, 2) * 3 * sqrt(3)) / 2;
}
double user_function(double x) 
{
    return (4 * pow(x, 3) + 8 * pow(x, 2) + 9 * x - 19) / (abs(7 - pow(x, 3)) + sqrt(3 * pow(x, 2) + 19));
}
int main()
{
    //calculate the area of a regular hexagon example
    std::cout << hexagon_area(5)<<std::endl;
    //calculate the user_function example
    std::cout << user_function(10) << std::endl;
    return 0;
}

 

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Fuad Endris
18.04.21, 22:36

Thank you ☆☆☆☆☆☆☆☆

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS