subject

Stringset. java
can you me fix my java code?
earlier we wrote a class stringset. that program's original specification is included for convenience:
write a class stringset. a stringset object is given a series of up to 10 string objects. it stores these strings (or a reference to them, to be precise) and can perform limited calculations on the entire series.
the stringset class has the following specification:
// a single instance variable of type string[]
// an int instance variable that indicates the number of string objects that the stringset currently contains
// a single no-argument constructor
// a mutator that adds a string newstr to the stringset object
void add(string newstr)
// an accessor that returns the number of string objects that have been added to this stringset object
int size()
// an accessor that returns the total number of characters in all of the strings that have been added to this stringset object
int numchars()
// an accessor that returns the number of strings in the stringset object that have exactly len characters
int countstrings(int len)
write a class stringsettester that has a main method. it should ask the user for the number of strings to add to a stringset object,
query the user for each string (use scanner's nextline method), and afterward use stringset's add, size and numchars methods to print information
about the collection of strings entered. also print the number of strings that are exactly 5 and 7 characters long.
reimplement stringset with the exception that it should now extend arraylist instead of encapsulating a string[]. you can easily abolish the 10 string limit for this new stringset. you can also remove the int instance variable, as your class will no longer need it. your existing stringsettester should work with the new stringset without being changed.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:50
Define a class named movie. include private fields for the title,year, and name of the director. include three public functions withprototypes void movie: : settitle(cstring); , voidmovie: : setyear(int); , void movie: : setdirector(string); . includeanother function that displays all the information about a movie.write a main() function that declares a movie object namedmyfavoritemovie. set and display the object's fields.this is what i have but know its wrong since it will notcompile: #include#includeusing namespace std; //class declarationclass movie{private: string movietitle ; string movieyear; string directorname; public: void settitle(string title); void setyear(string year); void setdirector(string director); void displayinfo(); }; //class implementationvoid movie: : settitle(string title){ movietitle = title; cout< < "what is the title of themovie? "< > temp; myfavoritemovie.settitle(temp); cout< < "enter movie year"< > temp; myfavoritemovie.setyear(temp); cout< < "enter director'sname"< > temp; myfavoritemovie.setdirector(temp); //display all the data myfavoritemovie.displayinfo(); system("pause"); return 0; this code is not entirely mine someone on cramster edited my firstcode but then i try manipulating the new code and i still get acompile error message : \documents\visual studio 2008\projects\movie\movie\movie.cpp(46) : error c2679: binary '< < ' : no operator found which takes aright-hand operand of type 'std: : string' (or there is no acceptableconversion)c: \program files (x86)\microsoft visual studio9.0\vc\include\ostream(653): could be'std: : basic_ostream< _elem,_traits> & std: : operator< < > (std: : basic_ostream< _elem,_traits> & ,const char *)w
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Michael has written an e-mail to his employees that describes a new product special that will be introduced to the customers next week. by taking time to make sure the e-mail is well written, logical, and organized, michael has made sure his message has the characteristics of a) effective communicationb) ineffective communicationc) barriers to communicationd) workplace communication
Answers: 2
question
Computers and Technology, 23.06.2019 16:00
An english teacher would like to divide 8 boys and 10 girls into groups, each with the same combination of boys and girls and nobody left out. what is the greatest number of groups that can be formed?
Answers: 2
question
Computers and Technology, 23.06.2019 18:20
What is wi-fi infrastructure? a metropolitan area network that uses radio signals to transmit and receive data a communications technology aimed at providing high-speed wireless data over metropolitan area networks a means by which portable devices can connect wirelessly to a local area network, using access points that send and receive data via radio waves includes the inner workings of a wi-fi service or utility, including the signal transmitters, towers, or poles and additional equipment required to send out a wi-fi signal
Answers: 2
You know the right answer?
Stringset. java
can you me fix my java code?
earlier we wrote a class stringset. that...
Questions
question
English, 11.12.2020 06:20
question
Mathematics, 11.12.2020 06:20
question
Biology, 11.12.2020 06:20
question
Mathematics, 11.12.2020 06:20
question
Mathematics, 11.12.2020 06:20
question
Mathematics, 11.12.2020 06:20
question
English, 11.12.2020 06:20
Questions on the website: 13722359