Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please I need help to fix my program Write code in C++ that has the following characteristics: create a class it should have 2 public
please I need help to fix my program
Write code in C++ that has the following characteristics:
- create a class
- it should have 2 public functions - both named add
- overload the functions
- one will take 2 arguments
- a string
- an integer value
- one will take 2 arguments
- a string
- a float value
- each function should use the to_string() function to convert the numerical value to a string
- add the string that was passed in and the newly converted string
- return the newly created string
- In main
- define an instance of the class you have created
- define a string with the value "CSP ", an integer with a value of 17 and a float with a value of 31.5
- call the class methodadd()- passing the string value and the integer value
- print the new string that was returned from the class method
- call the class methodadd()again - passing the string value and the float value
- print the new string value that was returned from the class method.
The output should be:
The integer conversion and addition produces CSP 17
The float conversion and addition produces CSP 31.500000
#include using namespace std; class Overloadi { public: int add(string n, i" v:shapes="Picture_x0020_99">
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started