100% Guaranteed Results


CSE102 – Solved
$ 20.99
Category:

Description

5/5 – (1 vote)

Grading: This homework will be graded on the scale of 100.

Homework Description: Write a complete program that performs geometric calculations. All the requirements requested from you must be fulfilled. In this homework you have to create a calculator that calculates the area, perimeter, and volume values of various shapes. You must have 2 enumerated types. You have to call these enumerated types shapes and calculators.
Shapes must have;
Triangle,
Quadrilateral,
Circle,
Pyramid,
Cylinder Calculators must have;
Area
Perimeter
Volume

You must use these enumerated types in all subsequent operations and selections. Except for the Main function, the following 3 functions have to be.

Function prototypes are : int select_shape () int select_calc () int calculate (int (), int ())

Expected Menu Output

You have to use the switch-case structure in the calculate function. You must assume and define the PI value as 3.14. For each shape, you should write a calculation function that takes the enum type of the value to be calculated (area, volume, or perimeter) as a parameter.
Function prototypes are: int calc_triangle(int); int calc_quadrilateral(int); int calc_circle(int); int calc_pyramid(int); int calc_cylinder(int);
In all calculation functions, you have to create the sections where the area, volume or perimeter values are calculated by using the switch-case structure. You have to use Heron’s formula when calculating the area of a triangle, and Brahmagupta’s formula when calculating the area of a quadrilateral.
Formulas:
TRΔ°ANGLE

𝑯𝒆𝒓𝒐𝒏′𝒔 π‘­π’π’“π’Žπ’–π’π’‚ = βˆšπ’” βˆ— (𝒔 βˆ’ 𝒂) βˆ— (𝒔 βˆ’ 𝒃) βˆ— (𝒔 βˆ’ 𝒄)
𝒂 + 𝒃 + 𝒄
𝒔 =
𝟐

QUADRILATERAL
π‘©π’“π’‚π’‰π’Žπ’‚π’ˆπ’–π’‘π’•π’‚β€²π’” π‘­π’π’“π’Žπ’–π’π’‚
CIRCLE
π‘ͺπ’Šπ’“π’„π’–π’Žπ’‡π’†π’“π’†π’π’„π’† 𝒓
𝑨𝒓𝒆𝒂 π’“πŸ

PYRAMID
π‘½π’π’π’–π’Žπ’† = 𝟏 𝟐 βˆ— 𝒉 βˆ— 𝒂
πŸ‘
𝑩𝒂𝒔𝒆 𝑺𝒖𝒓𝒇𝒂𝒄𝒆 𝑨𝒓𝒆𝒂 = 𝑩 = π’‚πŸ
𝑳𝒂𝒕𝒆𝒓𝒂𝒍 𝑺𝒖𝒓𝒇𝒂𝒄𝒆 𝑨𝒓𝒆𝒂 = 𝑳 = 𝟐 βˆ— 𝒂 βˆ— 𝒍

CYLINDER
π‘½π’π’π’–π’Žπ’† = 𝝅 βˆ— π’“πŸ βˆ— 𝒉
𝑩𝒂𝒔𝒆 𝑺𝒖𝒓𝒇𝒂𝒄𝒆 𝑨𝒓𝒆𝒂 = 𝝅 βˆ— π’“πŸ
𝑳𝒂𝒕𝒆𝒓𝒂𝒍 𝑺𝒖𝒓𝒇𝒂𝒄𝒆 𝑨𝒓𝒆𝒂 = 𝟐 βˆ— 𝝅 βˆ— 𝒓 βˆ— 𝒉
𝑺𝒖𝒓𝒇𝒂𝒄𝒆 𝑨𝒓𝒆𝒂 = 𝟐 βˆ— 𝝅 βˆ— 𝒓 βˆ— (𝒓 + 𝒉)

Not all states are shown in the expected outputs, but you have to check all states and incorrect entries for each calculation. You must also perform the calculations that are not shown exactly. The important formulas are all given, you have to look for the necessary formulas for the calculation. You cannot use Arrays. You cannot use Recursion. You can use fflush(stdin) if you are getting a character error while getting input from the user. You can only use “math.h”, “stdlib.h” and “stdio.h” libraries.
General Rules:
1. Obey the style guidelines.
2. Do not change the provided function prototypes (you will not get any credits).
4. Your program should work as expected. Do not expect partial credit if your code works only in some cases but not in all cases as expected.
5. Hand in your work using the appropriate class Teams assignment site.
7. Pack this directory into a zip file named 20180000001_X_Z.zip
8. When unpacked as above in Ubuntu (version provided in class) it should allow executing the following commands in a shell:
β–ͺ β€œ$make clean” removes everything except makefile, source code (.c) and other resource files (if any) – all compiling results and intermediate files should be removed (except results.txt).
β–ͺ β€œ$make compile” should compile the code.
β–ͺ β€œ$make run” should run the code along with any parameters needed.

Reviews

There are no reviews yet.

Be the first to review “CSE102 – Solved”

Your email address will not be published. Required fields are marked *

Related products