Question: I would like you to write your own print function for this lab and I would like you to overload the function so that it

I would like you to write your own print function for this lab and I would like you to overload the function so that it prints strings, doubles, integers, and characters. However for the strings I would like you to have it print with delays just like chatgpt. The code to do this is provided bellow
```
int main(){
// Seed the random number generator
srand(static_cast(time(0)));
std::string inputString = "Hello, this is an example of an input string. Watch... ok done";
for (char c : inputString){
std::cout c std::flush;
double random_delay =(static_cast(rand())/ RAND_MAX)*0.1;
std::this_thread::sleep_for(std::chrono::duration(random_delay));
}
return 0;
}
```
What this means is that you will have 4 functions with the same name but with different parameters. It should look something like this:
```
void myPrint(int input){...}
void myPrint(string input){...}
void myPrint(double input){...}
void myPrint(char input){...}
```
I would like you to write your own print function

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!