In this exercise, you will be writing a C++ program that defines a custom string class. You will write the program into separate files. You are provided with a starter code containing a class named CustomString consisting of an attribute of type string, named data, several methods, and operators. The class declaration has already been given fully in the specification file, custom_string.hpp. Your job in this exercise, is to complete the class implementation. The main file, main.cpp has also been given fully. The purpose of the main file is to perform automatic testing on the tasks you have accomplished. When you run the program with the original codebase, you should notice that all tests FAIL (as shown in Figure 1). Your job is to turn the tests to "PASS" (like in Figure 2) by accomplishing the tasks in this exercise. Testing Task 1: Mutator methods FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL 1(a). Testing pushFront (). It should add the string in front. 1(b). Testing pushBack(). It should add string at the back 1(c)-i. Testing pop(). It should return the extracted string. 1(c)-ii. Testing pop(). The extracted string should be erased from the attribute accordingly. 1(d)-i. Testing popFront (). It should return the extracted string. 1(d)-ii. Testing popFront (). The extracted string should be erased from the attribute accordingly. 1(e)-i. Testing popBack (). It should return the extracted string. 1(e)-ii. Testing popBack(). The extracted string should be erased from the attribute accordingly. Testing Task 2: Overloaded operators FAIL 2(a). Testing operator!. It should return a CustomString with reversed data. FAIL 2(b). Testing operator*. It should return a CustomString with repeated string. Testing Task 3: Conversion methods FAIL 3(a). Testing toDouble(). It should return the corresponding value of type double FAIL 3(b). Testing toupper(). It should return a CustomString with upper case string Testing Summary: Number of Test: 12 Number of Pass: 0 Number of Fail: 12 Pass Rate : 0%

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
In this exercise, you will be writing a C++ program that defines a custom string class. You will write the
program into separate files.
You are provided with a starter code containing a class named CustomString consisting of an attribute
of type string, named data, several methods, and operators. The class declaration has already been
given fully in the specification file, custom_string.hpp. Your job in this exercise, is to complete
the class implementation.
The main file, main.cpp has also been given fully. The purpose of the main file is to perform automatic
testing on the tasks you have accomplished. When you run the program with the original codebase, you
should notice that all tests FAIL (as shown in Figure 1). Your job is to turn the tests to "PASS" (like in
Figure 2) by accomplishing the tasks in this exercise.
Testing Task 1: Mutator methods
FAIL
FAIL
FAIL
FAIL
FAIL
FAIL
FAIL
FAIL
1(a). Testing pushFront (). It should add the string in front.
1(b). Testing pushBack(). It should add string at the back
1(c)-i. Testing pop(). It should return the extracted string.
1(c)-ii. Testing pop(). The extracted string should be erased from the attribute accordingly.
1(d)-i. Testing popFront (). It should return the extracted string.
1(d)-ii. Testing popFront (). The extracted string should be erased from the attribute accordingly.
1(e)-i. Testing popBack(). It should return the extracted string.
1(e)-ii. Testing popBack(). The extracted string should be erased from the attribute accordingly.
Testing Task 2: Overloaded operators
FAIL
2(a). Testing operator!. It should return a CustomString with reversed data.
FAIL 2(b). Testing operator*. It should return a CustomString with repeated string.
Testing Task 3: Conversion methods
FAIL 3(a). Testing toDouble(). It should return the corresponding value of type double
FAIL 3(b). Testing toUpper (). It should return a CustomString with upper case string
Testing Summary:
Number of Test: 12
Number of Pass: 0
Number of Fail: 12
Pass Rate : 0%
Figure 1: Run with the original starter code
Transcribed Image Text:In this exercise, you will be writing a C++ program that defines a custom string class. You will write the program into separate files. You are provided with a starter code containing a class named CustomString consisting of an attribute of type string, named data, several methods, and operators. The class declaration has already been given fully in the specification file, custom_string.hpp. Your job in this exercise, is to complete the class implementation. The main file, main.cpp has also been given fully. The purpose of the main file is to perform automatic testing on the tasks you have accomplished. When you run the program with the original codebase, you should notice that all tests FAIL (as shown in Figure 1). Your job is to turn the tests to "PASS" (like in Figure 2) by accomplishing the tasks in this exercise. Testing Task 1: Mutator methods FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL 1(a). Testing pushFront (). It should add the string in front. 1(b). Testing pushBack(). It should add string at the back 1(c)-i. Testing pop(). It should return the extracted string. 1(c)-ii. Testing pop(). The extracted string should be erased from the attribute accordingly. 1(d)-i. Testing popFront (). It should return the extracted string. 1(d)-ii. Testing popFront (). The extracted string should be erased from the attribute accordingly. 1(e)-i. Testing popBack(). It should return the extracted string. 1(e)-ii. Testing popBack(). The extracted string should be erased from the attribute accordingly. Testing Task 2: Overloaded operators FAIL 2(a). Testing operator!. It should return a CustomString with reversed data. FAIL 2(b). Testing operator*. It should return a CustomString with repeated string. Testing Task 3: Conversion methods FAIL 3(a). Testing toDouble(). It should return the corresponding value of type double FAIL 3(b). Testing toUpper (). It should return a CustomString with upper case string Testing Summary: Number of Test: 12 Number of Pass: 0 Number of Fail: 12 Pass Rate : 0% Figure 1: Run with the original starter code
Testing Task 1: Mutator methods
PASS
1(a). Testing pushFront (). It should add the string in front.
PASS 1(b). Testing pushBack(). It should add string at the back
Testing pop(). It should return the extracted string.
1(c)-i.
1(c)-ii. Testing pop(). The extracted string should be erased from the attribute accordingly.
1(d)-i. Testing popFront (). It should return the extracted string.
1(d)-ii. Testing popFront (). The extracted string should be erased from the attribute accordingly.
1(e)-i. Testing popBack(). It should return the extracted string.
1(e)-ii. Testing popBack(). The extracted string should be erased from the attribute accordingly.
PASS
PASS
PASS
PASS
PASS
PASS
Testing Task 2: Overloaded operators
PASS 2(a). Testing operator!. It should return a CustomString with reversed data.
2(b). Testing operator*. It should return a CustomString with repeated string.
PASS
Testing Task 3: Conversion methods
PASS
3(a). Testing toDouble(). It should return the corresponding value of type double
PASS 3(b). Testing toupper(). It should return a CustomString with upper case string
Testing Summary:
Number of Test: 12
Number of Pass: 12
Number of Fail: 0
Pass Rate
: 100%
Figure 2: Expected Final Result
Transcribed Image Text:Testing Task 1: Mutator methods PASS 1(a). Testing pushFront (). It should add the string in front. PASS 1(b). Testing pushBack(). It should add string at the back Testing pop(). It should return the extracted string. 1(c)-i. 1(c)-ii. Testing pop(). The extracted string should be erased from the attribute accordingly. 1(d)-i. Testing popFront (). It should return the extracted string. 1(d)-ii. Testing popFront (). The extracted string should be erased from the attribute accordingly. 1(e)-i. Testing popBack(). It should return the extracted string. 1(e)-ii. Testing popBack(). The extracted string should be erased from the attribute accordingly. PASS PASS PASS PASS PASS PASS Testing Task 2: Overloaded operators PASS 2(a). Testing operator!. It should return a CustomString with reversed data. 2(b). Testing operator*. It should return a CustomString with repeated string. PASS Testing Task 3: Conversion methods PASS 3(a). Testing toDouble(). It should return the corresponding value of type double PASS 3(b). Testing toupper(). It should return a CustomString with upper case string Testing Summary: Number of Test: 12 Number of Pass: 12 Number of Fail: 0 Pass Rate : 100% Figure 2: Expected Final Result
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education