Image

Imageworldsoutro wrote in Imagecpp

I want to kinda spice up this program a bit

Hey,

I coded this program for math and wondering how i can use a time function so it waits a bit before executing. Also how can i add color to text???



#include
#include
#include
using namespace std;

int main()
{

float gender, a, b, c, d, e, q, w, m, n, s, z, opt, aa, ab, ac, ad, an;
string firstName, lastName, human,;

cout << "\n ******************************";
cout << "\n * Math assignment *";
cout << "\n * Inverse Functions *";
cout << "\n * Author: *";
cout << "\n * Due Date: Friday March 10 *";
cout << "\n ******************************";
cout << "\n\n\n";






cout << "Enter first name? ";
cin >>firstName;
cout <<"Enter Last name? ";
cin>>lastName;
cout <<"\n"<
[Error: Irreparable invalid markup ('<firstname [...] ">') in entry. Owner must fix manually. Raw contents below.]

Hey,

I coded this program for math and wondering how i can use a time function so it waits a bit before executing. Also how can i add color to text???



#include <iostream>
#include <iomanip>
#include <string>
using namespace std;

int main()
{

float gender, a, b, c, d, e, q, w, m, n, s, z, opt, aa, ab, ac, ad, an;
string firstName, lastName, human,;

cout << "\n ******************************";
cout << "\n * Math assignment *";
cout << "\n * Inverse Functions *";
cout << "\n * Author: *";
cout << "\n * Due Date: Friday March 10 *";
cout << "\n ******************************";
cout << "\n\n\n";






cout << "Enter first name? ";
cin >>firstName;
cout <<"Enter Last name? ";
cin>>lastName;
cout <<"\n"<<firstName <<" "<< lastName << " went to the store the other day to buy 5 packs of beef jerky. ";
cout <<"\n";
cout<<"The man at the register asked how much you would want to pay for each pack?\n\n";
cout<<"\n";
cout<<firstName <<" "<< lastName << " said i would like the first pack for $";
cin>>a;
s = a * 2;

//s = a * 2;
//b = a *2;
//c = b * 2;
//d = c * 2;
//e = d * 2;



cout<<"Enter amount for second pack? $";
cin>>b;
q = b*2;
cout<<"Enter amount for third pack? $";
cin>>c;
w = c *2;
cout<<"Enter amount for fourth pack? $";
cin>>d;
m = d * 2;
cout<<"Enter amount for fifth pack? $\n\n";
cin>>e;
n = e * 2;
cout<<"He then told me that he's going to double everything i put in!!! \n";
cout<<"\n\n";
cout<<"Y represents number of boxes\n";
cout<<"\n";
cout<<"\nX represents cost of each box\n\n";



cout<< "\n\n Y | X";
cout<< "\n\n 1 | "<<s<<"";
cout<< "\n 2 | "<<q<<"";
cout<< "\n 3 | "<<w<<"";
cout<< "\n 4 | "<<m<<"";
cout<< "\n 5 | "<<n<<"";

cout<< "\n\n equation here is Y = 2x";


cout<< "\n\n Y | X";
cout<<" \n\n "<<s<<" | " "1";
cout<< "\n "<<q <<" | " " 2";
cout<< "\n "<<w <<" | " " 3";
cout<< "\n "<<m <<" | " " 4";
cout<< "\n "<<n <<" | " " 5";


cout<< "\n\nThis is inverse equal to X/2=Y";
cout<<"\n\n";
cout<<"\n\n\nScroll up to see final results\n\n";
cout<< "if you want to continue to next inverse press any number and enter key?\n\n\n\n ";
cin>>z;

if (z == 0);{
cout<< "\n So you are about to leave the store suddenly someone grabs you";
cout<< "\n This tall man then will not let you leave";
cout<<"\n what do you do?";
cout<< "\n\n OPTIONS";
cout<< "\n\n 1. you run away";
cout<< "\n\n 2. You fight this man";
cout<< "\n\n 3. You expect him to give you an inverse function probelm\n\n\n";
cout<<"\nwhat would you do?\n\n";
cin>>opt;

}
//else

//Cout<<"ending"



if (opt == 1){
cout<<"\n\nYou run to your parents house at the age of 30\n";
}
if (opt == 2){
cout<<"\nYou decide to fight this man with the stuff you learnt in high school ";
cout<<"\nYou duck and wave your wallet in the air\n\n";
}
if (opt == 3){
cout<<"You give in to your love for math, and wait your inverse function";
cout<<"\n\n He'll let you go if you give him what he wants\n\n";
cout<<"He wants you to give him the price you paid for each box plus 7 dollars\n\n";


cout<<"Y represents prices of boxes before 7 dollars added on\n\n";
cout<<"X represents boxes after 7 dollars added on\n\n";
aa = s + 7;
ab = q +7;
ac = w + 7;
ad = m + 7;
an = n +7;

cout<< "\n\n Y | X";
cout<<" \n\n "<<s<<" | " <<aa<<"";
cout<< "\n "<<q <<" | " <<ab<<"";
cout<< "\n "<<w <<" | " <<ac<<"";
cout<< "\n "<<m <<" | " <<ad<<"";
cout<< "\n "<<n <<" | " <<an<<"\n\n";

cout<< "This in equation above shows y = X + 7 \n\n\n";

cout<< "\n\n Y | X";
cout<<" \n\n "<<aa<<" | " <<s<<"";
cout<< "\n "<<ab <<" | " <<q<<"";
cout<< "\n "<<ac <<" | " <<w<<"";
cout<< "\n "<<ad <<" | " <<m<<"";
cout<< "\n "<<an <<" | " <<n<<"\n\n";

cout<< "The inverse is X-7 = y \n\n";




}




"\n\n";
system("PAUSE");
return 0;

}


thnaks you,


chris