2023 ask An equilateral triangle is a triangle whose sides are equal If | Assignment Collections

Computer Science 2023 An Equilateral Triangle Is A Triangle Whose Sides Are Equal

2023 ask An equilateral triangle is a triangle whose sides are equal If | Assignment Collections

ask:

An equilateral triangle is a triangle whose sides are equal. If two equliateral triangles are “glued” together along a common side, this will form a diamond. You are to write a class called Diamond, using filenames diamond.h and diamond.cpp, that will allow the creation and handling of diamonds based on the above description, whose sides are integers in the range 1-39.

Details:

1.     The single constructor for the Diamond class should have 3 parameters: an integer size (required), which is the length of a side; a border character (optional, with a default of ‘#’); and a fill character (optional, with a default of ‘*’). If the size provided is less than 1, set the size to 1. If the size provided is greater than 39, set the size to 39. The class will need to provide internal storage for any member data that must be kept track of. 
 

2.     There should be member functions GetSizePerimeter, and Area, which will return the size of a side, the perimeter of the diamond, and the area of the diamond, respectively. The first 2 should return integer results. The Area function should return its result as a double. 
 

3.     There should be member functions Grow and Shrink, which will increase or decrease (respectively) the size of the Diamond’s sides by 1, unless this would cause the size to go out of bounds (out of the 1-39 range); in the latter case, Grow and Shrink should make no change to the size. 
 

4.     There should be member functions SetBorder and SetFill, which each allow a new border or fill character (respectively) to be passed in as a parameter. There is a chart of ASCII characters in an appendix of the textbook. The characters that should be allowed for the border or fill characters are any characters from the ‘!’ (ascii 33) up through the ‘~’ (ascii 126). If an attempt is made to set the border or fill characters to anything outisde the allowable range, the function should set the border or fill back to its original default (the ones listed for the constructor — the border default is ‘#’ and the fill default is ‘*’). 
 

5.     There should be a member function called Draw that will display a picture of the Diamond on the screen. You may assume that the cursor is already at the beginning of a line when the function begins, and you should make sure that you leave the cursor on the line following the picture afterwards (i.e. print a newline after the last line of the diamond). Use the border character to draw the border of the diamond, and use the fill character to draw the internal characters. Separate the characters on a line in the picture by a single space to make the Diamond look more proportional (so that the halves look more like equilateral triangles). You may not use formatting functions likesetw to draw the diamond. This must be handled with loops. (You will only print out the newline, spaces, the border character, and maybe the fill character on any given line). 
 

6.     Provide a member function called Summary that displays all information about a diamond: its size, perimeter, area, and a picture of what it looks like. When displaying the area (decimal data), always show exactly 2 decimal places. Your output should be in the exact same format as mine (seen in the linked sample run below)

 

1.     General Requirements

o    No global variables, other than constants!

o    All member data of your class must be private

o    You will need to use the <iostream> library for output.  You may use the <iomanip> library for formatting your decimal output to two places, if you wish to use the parameterized stream manipulators, but you may not use setw() or other output formatting functions for drawing the actual diamond. You may use the <cmath> library

o    When you write source code, it should be readable and well-documented.

o    Your diamond.h file should contain the class declaration only.  The diamond.cpp file should contain the member function definitions.

 

 

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational