Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!