As stated to support. This is a C++ assignment, STL library is not allowed, “Using namespace std;”..

As stated to support. This is a C++ assignment, STL library is not allowed, “Using namespace std;” instead of adding “std::” is required. Most of the files are given and its just implementation. CS 202 Assignment #5 Purpose: Learn class inheritance, pointers, dynamic memory allocation, class implementation, virtual functions, and make utility. Points: 100 Assignment: Design and implement a C++ class to plot a spirograph1 drawing. Imagine the movement of a small circle that rolls on the outside of a rigid circle. Imagine that the small circle has an arm, rigidly attached, with a plotting
As stated to support. This is a C++ assignment, STL library is not allowed, “Using namespace std;” instead of adding “std::” is required. Most of the files are given and its just implementation. CS 202 Assignment #5 Purpose: Learn class inheritance, pointers, dynamic memory allocation, class implementation, virtual functions, and make utility. Points: 100 Assignment: Design and implement a C++ class to plot a spirograph1 drawing. Imagine the movement of a small circle that rolls on the outside of a rigid circle. Imagine that the small circle has an arm, rigidly attached, with a plotting pen fixed at some point. That is a epicycloid, commonly called spirographs. _ Spiro Class The spiro class will implement a spirograph class to provide basic Spirograph drawing functions. The spiroType class should inherit the bitmap image functions from the bitmapImage class (which includes creation of the formatted BMP image files). SpiroType : private bitmapImage -radiusFixed: double -radiusMoving: double -offsetAmount: double -drawColor: string -fileName: string +W_MIN, W_MAX, H_MIN, H_MAX: const int +spiroType() +spiroType(int, int, string) +spiroType(const spiroType&) +createSpiroImage(): void +readImageSize(): void +readFileName(): void +setFileName(string): void +setImageSize(int, int): void +initImage(int): void +createImageFile(): void +setParameters(double, double, double, string): void +readParameters(): void +getRadiusFixed() const: double +getRadiusMoving() const: double 1 For more information, refer to: http://en.wikipedia.org/wiki/Spirograph rF rM oA +getOffsetAmount() const: double +getDrawColor() const: string +getHeight() const: int +getWidth() const: int +getFileName() const: string +getPixel(int, int) const: int You may add additional private functions as needed. You are not allowed to add any additional class variables. Function Descriptions The default constructor (no parameters) should call the base class and set the file name to a string. The non-default constructor should accept the width, height, and file name string (in that order) and call the base class constructor. The copy constructor should create a new object from the passed object (i.e., deep copy). The readFileName() function should read a file name from input, and ensure that it has a '.bmp' extension. Re-prompt if there is an error. The setFileName(string) function sets the file name class variable. The readImageSize() function should read the width and height from input and _ ensure width is between W_MIN (100) and W_MAX (10000) _ ensure height is between H_MIN (100) and H_MAX (10000) _ ensure the aspect ratio (width/height) is between 1.0 and 2.0 and set the base class width and height variables accordingly. The setImageSize(int,int) function set the base class width and height variables (in that order) accordingly. The function should read both values and re-prompt as needed. The initImage(int) function should fill the entire image with the provided color (by using the appropriate base class functions). The setParameters(double,double,double,string) function sets the class variables for radiusFixed, radiusMoving, offsetAmount, and drawColor (in that order). The readParameters() should read from the user, set the class variables for radiusFixed, radiusMoving, offsetAmount, and drawColor (in that order). If an invalid value is entered, an error message should be displayed and the user re-prompted. The radius and offset values must be between 0.0 and the minimum of image height or image width. The createImageFile() function creates the image file using the class variable for file name with a 24-bit depth (by using the appropriate base class functions). The getWidth(), getHeight(), getPixel(int,int), getRadiusFixed(), getRadiusMoving(), getOffsetAmount(), and getDrawColor() functions return the appropriate values or performs the appropriate function accessing the base class functions as necessary. The createSpiroImage() function should create the Spirograph (epicycloid) drawing. The formulas for an epicycloid is as follows: x = [(rF+ rM) _cos(t)] + [ oA _cos( (rF + rM) _ t rM )] y = [(rF+ rM) _sin(t)] + [ oA _sin( (rF + rM) _ t rM )] Where, rF is radiusFixed, rM is radiusMoving, oA is and offsetAmount. The value for t represent all 360 degrees of a circle (i.e., starting at 0.0, stop at 360.0) and incrementing by 0.01. Before plotting, the (x,y) point must be cast as an integer and offset to the center of the screen (i.e., x += width/2 and y += height/2). _ Bit Map Image Class There are many programs that can write information to a simple, device and OS independent bitmap image format. The bitmapImage class (bitmapImage.h and bitmapImage.o) provides a simple interface for the creation of an uncompressed, BMP bitmap file. bitmapImage -width: int -height: int -**pixelData: int -freePixelData() +bitmapImage() +bitmapImage(const char*) +bitmapImage(int, int) +~bitmapImage(): virtual +setSize(int, int): void +loadFromBitmapFile(const char*): int +saveToBitmapFile(const char*) const: void +saveToBitmapFile(const char*, int) const: void +getHeight() const: int +getWidth() const: int +getRed(int colour) const: int +getGreen(int colour) const: int +getBlue(int colour) const: int +getColourForRGB(int, int, int) const: int +getPixel(int, int) const: int +setPixel(int x, int y,int colour): void +fillWith(int colour): void +fillRect(int, int, int, int, int): void +setPixelRGB(int, int, int, int, int): void The class header and object files will be provided on the class web site. The header file includes documentation for the class functions. Note, this class may be used for future assignments. Refer to the example executions for output formatting. Make sure your program includes the appropriate documentation. See Program Evaluation Criteria for CS 202 for additional information. Make File: You will need to develop a make file for future assignments. With the provided make file, you can type make Which will create the spiro executable. The makefile will be very similar to the previous assignment makefiles. Prompts and Error Messages The following are the applicable prompt and error messages. If there is an error with the input value, each function should re-prompt until valid values are obtained. Constructor: cout < "error,="" width="" must="" be="" between="" 100="" and="" 10000."=""< endl;="" cout=""< "error,="" height="" must="" be="" between="" 100="" and="" 10000."=""< endl;="" cout=""< "error,="" invalid="" aspect="" ratio.="" must="" be="" between="" 1.0"=""< "="" and="" 2.0."=""< endl;="" read="" image="" size="" function:="" cout=""< "enter="" image="" size="" (width,="" height):="" ";="" cout=""< "error,="" width="" must="" be="" between="" 100="" and="" 10000."=""< endl=""< "please="" re-enter."=""< endl;="" cout=""< "error,="" height="" must="" be="" between="" 100="" and="" 10000."=""< endl=""< "please="" re-enter."=""< endl;="" cout=""< "error,="" invalid="" aspect="" ratio.="" "=""< "must="" be="" between="" 1.0="" and="" 2.0."=""< endl=""< "please="" re-enter."=""< endl;="" read="" file="" function:="" cout=""< "enter="" output="" file="" name:="" ";="" cout=""< "error,="" invalid="" file="" name."=""< endl;="" cout=""< "please="" re-enter."=""< endl;="" cout=""< "error,="" file="" name="" must="" be="" '.bmp'="" extension."=""< endl;="" cout=""< "please="" re-enter."=""< endl;="" the="" error="" invalid="" file="" name="" message="" only="" applies="" of="" the="" user-entered="" file="" name="" string="" is="" too="" short="" to="" be="" valid.="" read="" parameters="" function:="" cout=""< "enter="" radius="" of="" fixed="" circle:="" ";="" cout=""< "invalid="" radius,="" please="" re-enter"=""< endl;="" cout=""< "enter="" radius="" of="" moving="" circle:="" ";="" cout=""< "invalid="" radius,="" please="" re-enter"=""< endl;="" cout=""< "enter="" offset="" amount:="" ";="" cout=""< "invalid="" offset="" amount,="" please="" re-enter"=""< endl;="" cout=""< "enter="" draw="" color="" (red,="" green,="" blue):="" ";="" cout=""< "invalid="" color,="" please="" re-enter"=""< endl;="" each="" value="" is="" checked="" one="" at="" a="" time="" (radiusfixed,="" radiusmoving,="" offsetamount,="" and="" drawcolor="" in="" that="" order).="" if="" the="" value="" is="" valid,="" move="" to="" the="" next="" read="" operation.="" if="" the="" value="" is="" not="" valid,="" the="" provide="" error="" string="" should="" be="" printed="" and="" the="" user="" re-prompted.="" this="" will="" continue="" until="" a="" valid="" value="" is="" obtained.="" submission:="" _="" submit="" a="" compressed="" zip="" file="" of="" the="" program="" source="" files,="" header="" files,="" and="" makefile="" via="" the="" on-line="" submission.="" all="" necessary="" files="" must="" be="" included="" in="" the="" zip="" file.="" the="" zip="" file="" name="" should="" be="" your="" last="" name.="" the="" grader="" will="" download,="" uncompress,="" and="" type="" make="" (so="" you="" must="" have="" a="" valid,="" working="" makefile).="" example="" execution:="" below="" is="" an="" example="" program="" execution="" for="" the="" main.="" ed-vm%="" ./spiro="" cs="" 202="" -="" assignment="" #5.="" spirograph="" program.="" bad="" constructor="" (should="" be="" error)="" error,="" width="" must="" be="" between="" 100="" and="" 10000.="" error,="" height="" must="" be="" between="" 100="" and="" 10000.="" enter="" output="" file="" name:="" spiro1.bmp="" enter="" image="" size="" (width,="" height):="" 800="" 600="" enter="" radius="" of="" fixed="" circle:="" 106="" enter="" radius="" of="" moving="" circle:="" 8="" enter="" offset="" amount:="" 58="" enter="" draw="" color="" (red,="" green,="" blue):="" green="" ************************************************="" image="" summary="" information:="" ---------------------------------------------------------------="" image:spiro1.bmp="" radius="" fixed="106" radius="" moving="8" offset="" amount="58" draw="" color="green" ---------------------------------------------------------------="" image:spiro2.bmp="" radius="" fixed="57" radius="" moving="108" offset="" amount="43" draw="" color="red" ---------------------------------------------------------------="" image:spiro3.bmp="" radius="" fixed="106" radius="" moving="8" offset="" amount="58" draw="" color="green" ---------------------------------------------------------------="" image:spiro4.bmp="" radius="" fixed="57" radius="" moving="108" offset="" amount="43" draw="" color="red" ---------------------------------------------------------------="" image:spiro5.bmp="" radius="" fixed="200" radius="" moving="8" offset="" amount="17" draw="" color="green" ---------------------------------------------------------------="" image:spiro6.bmp="" radius="" fixed="51" radius="" moving="13" offset="" amount="15" draw="" color="blue" ed-vm%="" testing="" a="" script="" file="" to="" execute="" the="" program="" on="" a="" series="" of="" predefined="" inputs="" is="" provided.="" please="" follow="" the="" i/o="" examples.="" the="" test="" utility="" should="" be="" downloaded="" into="" the="" working="" directory.="" the="" script="" file="" will="" require="" execute="" privilege="" (i.e.,="" chmod="" +x="" a5tst).="" the="" test="" script,="" named="" a5tst,="" here="" can="" be="" executed="" as="" follows:="" [email protected]%="" ./a5tst="" spiro="" the="" test="" script="" compares="" the="" program="" output="" to="" predefined="" expected="" output="" (based="" on="" the="" example="" i/o).="" note,="" the="" [email protected]%="" is="" the="" prompt="" on="" my="" machine.="" example="" output:="" below="" is="" an="" example="" of="" the="" one="" of="" the="" output="" file="" from="" spiro="" program="" (spiro1.bmp)="" using="" the="" ubuntu="" default="" image="" View less

Custom Paper Help
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.