logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

Create a void inputDataAnnulusShapes () function that accepts an array of annulus shapes by reference.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Submit to me a zipped file that includes all the files from MS Visual Studio's folder so i can edit some things myself. If file doesnt have example exe and example_main.cpp please contact me and no complex code, beginner only.

 

Write a program named EXAM2 that MUST contains at least the following functions (overload and non-overload), and allows the user to select an option and loops until the user choose option one of the following tasks:

Functions (required):

char menuOption();

void InputEquilateralTriangleShapes();

double getArea(double side);

double getPerimeter(double size);

void DisplayEquilateralTriangleShapes();

 

void inputDataCircleShapes();

void DisplayCircleShapes();

double getArea(double radius, double pi);

double getCircumference(double radius, double pi);

 

void inputDataAnnulusShapes();

void DisplayAnnulusShapes();

double getArea(double radius1, double radius2, double pi);

double getPerimeter(double radius1, double radius2, double pi);

 

void inputDataHeartShapes();

void DisplayHeartShapes();

 

void inputDataRegularPolygon();

void DisplayRegularPolygonShapes();

double getArea(double side, int numberOfSides, double pi);

double getPerimeter(double side, int numberOFSides);

 

void OutputAllShapestoFile();

 

Notes: 

blue functions are overloaded with specific arguments. PLEASE DO NOT CHANGE their return type, names and passing-in arguments!

Other functions are for you to make modifications as needed to the arguments that are passing-in (by value or by reference).

 

Tasks (required):

1) Display a brief description and menu that:

Create a menuOption() function that returns a valid option (‘1’,’2’,’3’,’4’,’5’,’A’,’B’

‘C’,’D’,’E’,’O’ or ‘X’.

The menu MUST include your full name and date.

The option can be entered in lowercase or uppercase.

 

2) If user selects option ‘1’: Input equilateral triangle data from a file and store into an array

Create a void InputEquilateralTriangleShapes() function that accepts an array of equilateral triangle shapes by reference.

Prompt and validate the user for an input data file.

Read the data and store the values into an array of static or dynamic (vector).

Display a message if the data has been successfully read in.

 

3) If user selects option ‘2’: Input circle data from a file and store into an array

Create a void inputDataCircleShapes () function that accepts an array of circle shapes by reference.

Prompt and validate the user for an input data file.

Read the data and store the values into an array of static or dynamic (vector).

Display a message if the data has been successfully read in.

 

4) If user selects option ‘3’: Input annulus data from a file and store into an array

Create a void inputDataAnnulusShapes () function that accepts an array of annulus shapes by reference.

Prompt and validate the user for an input data file.

Read the data and store the values into an array of static or dynamic (vector).

Display a message if the data has been successfully read in.

 

5) (10 Points Extra Credit) If user selects option ‘4’: Input heart data from a file and store into an array

Create a void inputDataHeartShapes () function that accepts an array of heart shapes by reference.

Prompt and validate the user for an input data file.

Read the data and store the values into an array of static or dynamic (vector).

Display a message if the data has been successfully read in.

 

6) If user selects option ‘5’: Input regular polygon data from a file and store into an array

Create a void inputDataRegularPolygonShapes () function that accepts an array of regular polygon shapes by reference.

Prompt and validate the user for an input data file.

Read the data and store the values into an array of static or dynamic (vector).

Display a message if the data has been successfully read in. 

7) If user selects option ‘A’: Display information of equilateral triangle shapes

Create a void DisplayEquilateralTriangleShapes () function that accepts an array of equilateral triangle shapes by value.

Validate that stored data are in the array.

i. If there is no data or the array is empty, display an error message and return immediately.

ii. If there are data in the array, display each element (shape) with its properties, calculated area and perimeter, average area and perimeter, and the largest and smallest detected- shape’s index from the array.

 

8) If user selects option ‘B’: Display information of circle shapes

Create a void DisplayCircleShapes () function that accepts an array of circle shapes by value.

Validate that stored data are in the array.

i. If there is no data or the array is empty, display an error message and return immediately.

ii. If there are data in the array, display each element (shape) with its properties, calculated area and perimeter, average area and perimeter, and the largest and smallest detected- shape’s index from the array.

 

9) If user selects option ‘C’: Display information of annulus shapes

Create a void DisplayAnnulusShapes () function that accepts an array of annulus shapes by value.

Validate that stored data are in the array.

i. If there is no data or the array is empty, display an error message and return immediately.

ii. If there are data in the array, display each element (shape) with its properties, calculated area and perimeter, average area and perimeter, and the largest and smallest detected- shape’s index from the array.

 

10) (10 Points Extra Credit) If user selects option ‘D’: Display information of heart shapes

Create a void DisplayHeartShapes () function that accepts an array of heart shapes by value.

Validate that stored data are in the array.

i. If there is no data or the array is empty, display an error message and return immediately.

ii. If there are data in the array, display each element (shape) with its properties, calculated area and perimeter, average area and perimeter, and the largest and smallest detected- shape’s index from the array.

 

11) If user selects option ‘E’: Display information of regular polygon shapes

Create a void DisplayRegularPolygonShapes () function that accepts an array of regular polygon shapes by value.

Validate that stored data are in the array.

i. If there is no data or the array is empty, display an error message and return immediately.

ii. If there are data in the array, display each element (shape) with its properties, calculated area and perimeter, average area and perimeter, and the largest and smallest detected- shape index from the array.

 

12) If user selects option ‘O’: Output all information of shapes to a text file

Create a void OutputAllShapestoFile () function that accepts all arrays of shapes by value.

Prompt the user for a file name.

i. Validate if the file exists and give the user an option to overwrite or not.

1. If the user chooses Y-yes to overwrite, then data will be written out to the file.

2. Else if the user chooses N-no to not overwrite, then loop and prompt for another file name.

Validate that stored data are in the array.

i. If there is no data or the array is empty, write an error message.

ii. If there are data in the array, write each element (shape) with its properties, calculated area and perimeter, average area and perimeter, and the largest and smallest detected- shape index from the array.

 

13) If user selects option ‘X’: exit, quit or terminate the program.

 

 

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

969 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

609 Answers

Hire Me
expert
Husnain SaeedComputer science

653 Answers

Hire Me
expert
Atharva PatilComputer science

548 Answers

Hire Me