Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

CIS 25 SPRING 2020 : 1) Write a class declaration and definition for a class named Circle with three private variables

CIS 25 SPRING 2020 : 1) Write a class declaration and definition for a class named Circle with three private variables

CIS 25 SPRING 2020 FINAL Due 11:59 PM May 22 (this is a hard deadline)

SHORTER EXERCISES (30 pts each)

Upload your answers to these questions to canvas. Give your files sensible names (i.e. I should be able to see from the filename which response goes with which question). Follow the style guide. Upload separate .h and .cpp files for questions asking you to implement classes.

1) Write a class declaration and definition for a class named Circle with three private variables:

* A double named xPosition * A double named yPosition * A double named radius

This class should have three constructors: a default constructor that sets the radius to 1 and both xPosition and yPosition to 0, a one-parameter constructor that sets radius to the parameter and xPosition and yPosition to 0, and a three-parameter constructor that allows client code to set all three parameters.

The class should also have accessors for all three instance variables and mutators allowing client code to set xPosition, yPosition, and radius. If at any point client code attempts to set the radius to a value below 0, the radius should be set to 0 instead.

Put the class declaration in a header file and the class definition in a source code file. It should not be possible to include the header file more than once in any program.

2.) Write a recursive method that takes the following parameters:

* a sorted array of ints * an int representing the size of the array * an int representing a value to be searched for

Your function should return a bool. If the element is in the array, return true. Otherwise, return false. Your function should never produce memory access errors, regardless of the size of the array.

3) A priority queue is a data structure wherein every item added to the structure has an associated priority. When items are removed from a priority queue, the highest-priority elements are removed first. Implement a class called PriorityQueue that stores strings. Each string in the queue should have an associated priority (represented as an int). You may find it useful to define a struct containing the string and its priority. You may use a vector to store elements in your PriorityQueue.

3) Create a class named Pet with private instance variables representing the pet’s name as a string and its cutenessLevel as an int. Create appropriate accessors, mutators, and constructors for Pet objects. Client code should never be able to set the cuteness level of Pet objects below 3.

Write a derived class named Dog. It should not be possible to set a Dog’s cuteness level below 10, regardless of how the Dog object is accessed (i.e. even if you refer to it using a reference or pointer to a Pet) your class should correctly refuse to set the object’s cuteness below 10.

LONGER PROGRAMMING EXERCISE: (60 pts) Create a class named MyVector. MyVector should include a pointer named arrayPtr that points to a dynamic array, a capacity variable that holds the dynamic array’s current capacity, and a currentSize variable that gives the number of elements currently stored in the array. These variables should all be private. Include a public function named changeElement. This function should take two parameters: the value of an element, and the index at which the element should be placed. If the index is greater than the current size, the element should be added to the end of the array. Include another public function called pushBack, which adds an element to the end of the array. When adding elements to the end of the array, resize the array if necessary. Include an accessor named at that takes one int parameter and returns the element at that index. If the index is higher than the highest used index, at should cause the program to exit immediately.

Include a default constructor (that takes no parameters) that creates an array of capacity 16. Include a constructor that takes a positive nonzero int parameter and creates an array of capacity equal to that parameter.

Include a destructor that frees all allocated memory when objects of the MyVector class go out of scope.

YOUR MyVector IMPLEMENTATION SHOULD BE ABLE TO STORE ANY ONE TYPE OF ELEMENT (use templates for this). Create a short main function that tests the functionality of MyVector. Your class should at no point leak memory or attempt to read from/write to unallocated memory.

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: Blackboard Experts only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Blackboard Experts are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Blackboard Experts is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Blackboard Experts, we have put in place a team of experts who answer to all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.