Simple-Calculator (C++)
This is a silly question but one I thought I'd ask.
I've grown a habit to have my text to appear to be typed out to the user; so that not just a lot of information is thrown at them.
I was wondering if there was a better way in doing it than what I did here :
I've grown a habit to have my text to appear to be typed out to the user; so that not just a lot of information is thrown at them.
I was wondering if there was a better way in doing it than what I did here :
Code:
#include <iostream>
#include <Windows.h>
#include <string>
using namespace std;
class Information
{
public:
void informationalText()
{
cout << "B";
Sleep(85);
cout << "a";
Sleep(85);
cout << "s";
Sleep(85);
cout << "i";
Sleep(85);
cout << "c";
Sleep(85);
cout << " ";
Sleep(85);
cout << "C";
Sleep(85);
cout << "a";
Sleep(85);
cout << "l";
Sleep(85);
cout << "c";
Sleep(85);
cout << "u";
Sleep(85);
cout << "l";
Sleep(85);
cout << "a";
Sleep(85);
cout << "t";
Sleep(85);
cout << "o";
Sleep(85);
cout << "r";
Sleep(85);
cout << " ";
Sleep(85);
cout << "B";
Sleep(85);
cout << "y";
Sleep(85);
cout << ":";
Sleep(85);
cout << " ";
Sleep(85);
cout << "S";
Sleep(85);
cout << "p";
Sleep(85);
cout << "l";
Sleep(85);
cout << "i";
Sleep(85);
cout << "t";
Sleep(85);
cout << "z";
Sleep(85);
cout << "o";
Sleep(85);
cout << "B";
Sleep(85);
cout << "e";
Sleep(85);
cout << "a";
Sleep(85);
cout << "r\n\n";
}
void saying1()
{
cout << "Please Enter three values I will calculate them into a sum! \n\n";
}
void saying2()
{
cout << "P";
Sleep(85);
cout << "l";
Sleep(85);
cout << "e";
Sleep(85);
cout << "a";
Sleep(85);
cout << "s";
Sleep(85);
cout << "e";
Sleep(85);
cout << " ";
Sleep(85);
cout << "e";
Sleep(85);
cout << "n";
Sleep(85);
cout << "t";
Sleep(85);
cout << "e";
Sleep(85);
cout << "r";
Sleep(85);
cout << " ";
Sleep(85);
cout << "a";
Sleep(85);
cout << " ";
Sleep(85);
cout << "v";
Sleep(85);
cout << "a";
Sleep(85);
cout << "l";
Sleep(85);
cout << "u";
Sleep(85);
cout << "e";
Sleep(85);
cout << " ";
Sleep(85);
cout << " ";
Sleep(85);
}
void saying3()
{
cout << "E";
Sleep(85);
cout << "n";
Sleep(85);
cout << "t";
Sleep(85);
cout << "e";
Sleep(85);
cout << "r";
Sleep(85);
cout << " ";
Sleep(85);
cout << "t";
Sleep(85);
cout << "h";
Sleep(85);
cout << "e";
Sleep(85);
cout << " ";
Sleep(85);
cout << "l";
Sleep(85);
cout << "a";
Sleep(85);
cout << "s";
Sleep(85);
cout << "t";
Sleep(85);
cout << " ";
Sleep(85);
cout << "v";
Sleep(85);
cout << "a";
Sleep(85);
cout << "l";
Sleep(85);
cout << "u";
Sleep(85);
cout << "e";
Sleep(85);
cout << " ";
Sleep(85);
cout << " ";
}
void finalSaying()
{
cout << "The calculation of thoose numbers entered is ";
}
};
int main()
{
int x;
int y;
int z;
int sum;
Information io;
io.informationalText();
Sleep(1500);
io.saying1();
Sleep(1500);
io.saying2();
cin >> x;
Sleep(350);
io.saying2();
cin >> y;
Sleep(350);
io.saying3();
cin >> z;
cout << " \n\n";
sum = x + y + z;
io.finalSaying(); cout << sum;
Sleep(5000);
return 0;
}

