1. Homepage
  2. Programming
  3. Homework 1: String Class in C++

Homework 1: String Class in C++

Engage in a Conversation
String Class in C++C++

String Class in C++

Write your own String class to mimic some functionality from the str class in Java. As much as possible, functionality of your methods should match the functionality provided by the String class in Java, so visit the Java API for more details on what those methods should do. CourseNana.COM

You may use the C++ std::string type as your instance variable, and use any methods provided by to help in your impleme student may also want to investigate move constructors and move assignment operators available in C++. For more information, see the C++ API or http://bit.ly/move_constructor. CourseNana.COM

Notes of interest: • Overloaded operators, e.g., operator==, are covered in a number of places on the web, include https:// isocpp.org/wiki/faq/operator-overloading. Find one that works well for you. • A reasonable API reference for the C++ libraries can be found at http://www.cplusplus.com/. • Appropriate use of the C++ std::string methods will result in brief implementations for many of the methods. • For handling invalid indices to substring, you should throw an out-of-range exception defined in . For example, you should include code similar to that below: CourseNana.COM

This will require a try-catch block in your tester — see std::exception at the C++ API for help. • Make sure to handle the case of a nullptr being passed as the C-string literal to your corresponding constructor — throw an invalid-argument exception. • In your submission, include a README.txt file describing your tests (don’t forget boundary/edge cases), their results, and how they demonstrate the correctness of your implementation. • Follow style guidelines — include a class block comment with name, date, and that describes the class; include comments before each method; use inline comments as appropriate; make judicious use of whitespace, good naming convention, consistent indentation, etc. CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
String Class in C++代写,C++代写,String Class in C++代编,C++代编,String Class in C++代考,C++代考,String Class in C++help,C++help,String Class in C++作业代写,C++作业代写,String Class in C++编程代写,C++编程代写,String Class in C++programming help,C++programming help,String Class in C++assignment help,C++assignment help,String Class in C++solution,C++solution,