C++代写:Assignment代写C/C++课程设计

Introductionc++实现一个动态数组,不能使用stl的vector, 动态数组需要实现自己的内存扩展,constructor和destructor, 然后还有题目要求的tail,head, sort等等函数。最后在main里面完成自己实现的函数的单元测试RequirementP a g e | 1CMPSC 122 – Intermediate ProgrammingAssignment #4Spring 2016Due Date: Monday, March 28, 2016Total Points: 100Implement a generic (template) class called MyArray. A generic class is a general version of a class; itis a homogenous data structure that handles multiple data types. MyArray will be similar to C++arrays but will not be constrained to a fixed size. The array size will grow dynamically when the userinserts an element to a full array. The class should not use vectors. Instead, you should usedynamic memory allocation (a dynamic array).The class should use three member variables:- myarray: the dynamic array- size: the current size of the array- used: the number of elements currently used in the arrayThe class should have the following functionalities:? A default constructor that initializes the size of the array to 5.? A default destructor that frees the dynamic memory that was allocated.? int length( ) a method that returns an integer value indicating the number of elementscurrently used in the array.? void insertHead(Item i) a method that inserts a new item making it the first element in thearray. If the array is full, then a new dynamic array of double the size should replace theexisting array.? void insertTail(Item i) a method that inserts a new item making it the last element in thearray. If the array is full, then a new dynamic array of double the size should replace theexisting array.? void deleteHead( ) deletes the first element in the array.? void deleteTail( ) deletes the last element in the array.? void sortAscending( ) sorts the elements of the array in ascending order. Use bubbleSort todo that.? void sortDescending( ) sorts the elements of the array in descending order. UseinsertionSort to do that.? C++ allows the overloading of the [ ] operator. This feature makes it possible to accessan element in a MyArray object in an array-like behavior. Overload this operator andmake sure to have boundary checks using assertions. If the user tries to access anelement outside the range of the array or at a location that is not used yet then an errormessage should be displayed on the screen.For example, the following code:P a g e | 2MyArray a1;cout a1.insertTail(35);a1.insertTail(45);a1.insertHead(55);a1.deleteTail();for(int i =0; i cout Will result in:Number of elements in a1= 05535If we try any of the two instructions the result should be an assertion error:cout cout Write a main( ) method that provides a menu driven interface that allows the user to test whethereach member function of myArray is working properly. The menu should provide the followingfunctionalities:o Create a new array: allows the user to create an array of one of the following types: bool, char,double, float, int, stringo Get Length: the current number of elements used in the arrayo Insert a new element at the head of the arrayo Insert a new element at the tail of the arrayo Delete the first elemento Delete the last elemento Sort the elements in ascending ordero Sort the elements in descending ordero Print all the elements in the arrayo Quit the programWhat to hand inPlease submit your C++ source file electronically through Angel.本团队核心人员组成主要包括BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected] 微信:codehelp

你可能感兴趣的:(C++代写:Assignment代写C/C++课程设计)