讲解:CIS 3100、C++、C++、Object-Orien

2020-03-02  本文已影响0人  duanquju

Object-Oriented Programming I Fall 2018CIS 3100Programming Assignment 6For this assignment, you are to implement the String class, the specification of which is shownbelow. Using this String class you are then to implement an application to sort a sequence ofwords input by the user. This application should begin by asking the user how many words, notto exceed 100, are to be input. Once the user has input a valid value, your program should thenprompt the user to enter each of the words that are to be sorted, with one prompt per word beingused. After the last word has been input, the program should sort the word in ascending order,and then out the words, one per lineFor this assignment, you may use any of the Cstring functions available in C++.In addition to the application that you are implementing, I will also supply you with a main()function that will be used to test your code.Due Date: December 18, 2018String Class SpeciCIS 3100作业代做、代写C++编程设计作业、C++实验作业代做、代写Object-Oriented作业 调试Matfication:class String {private: char strval[101]; //holds string valuepublic: //constructors String(); //initializes default value of null //string String(char s[]); //initializes string to value of //cstring s //access functions void ToCstring(char s[]); //convert value to cstring s bool EqualTo(String s); //true if value equal to s //else false bool LessThan(String s); //true if value less than s, //else false bool GreaterThan(String s); //true if value greater than //s, else false int Length(); //returns length of string String Concat(String s); //returns concatenation of s //to string value //modifier functions //No modifier function specified //input/output functions void Read(); //reads in string value from //istream, no prompt given void Write(); //outputs string value to //ostream, no newline inserted //destructor //No destructor defined.};转自:http://ass.3daixie.com/2018122213015383.html

上一篇下一篇

猜你喜欢

热点阅读