life

Mar 08, 2005 10:06

Well.. today i sit in C++.. and try to understnad where my teacher is going with this lecture.

Any ways, ill give you a recap of my weekend.. i didnt do ANYTHING.. it felt great, the only thing that we did do, was obtain some opium on sunday night. made me feel GREAT, and it gave me the best mood for monday.

Cody has been given either 30 days or 60 days until he is gone..

im actually looking into moving up to Seattle and attending Washington state.. or ill be moving into longmont and attending CU.

not much else to say.. but ive been working on these programs and they annoy the fuck out of me...

This Program HATES ME!!!
==============================================
==============================================
=
=#include
=#include
=#include
=using namespace std;
=
=void swap(char& v1, char& v2);
=// interchanges the values of v1 and v2
=
=string reverse(const string& s);
=// returns a copy of s with characters in reverse order.
=
=string remove_punct(const string& s, const string& punct);
=
=string make_lower(const string& s);
=
=bool is_pal(const string& s);
=
=int main()
={
= string str;
= cout <<"Enter a candidate for palindrome test\n"
= << "followed by pressing Return.\n";
= getline(cin, str);
=
= if (is_pal(str))
= cout << "\""<< str + "\" is a palindrome.";
= else
= cout << "\"" << str + "\" is not a palindrome.";
= cout <= punct_length)
= no_punct = no_punct + a_char;
=
= }//for
=
= return no_punct;
= }//string
=
= bool is_pal(const string& s)
= {
= string punct(",;:.?!'\" ");
= string str(s);
= str = make_lower(str);
= string lower_str = remove_punct(str, punct);
=
= return (lower_str == reverse(lower_str));
=
=
= }
==============================================
==============================================
Previous post Next post
Up