DIDNEY WORL
Würden Sie gerne auf diese Nachricht reagieren? Erstellen Sie einen Account in wenigen Klicks oder loggen Sie sich ein, um fortzufahren.
DIDNEY WORL

WELCOM
 
StartseiteStartseite  PortalPortal  Neueste BilderNeueste Bilder  AnmeldenAnmelden  Login  
THE GRAPHIC BELOW IS AN ADVERTISEMENT

 

 The question to the universe

Nach unten 
2 verfasser
AutorNachricht
Skullking
WHMT Member
WHMT Member
Skullking


Männlich Number of posts : 1198
Age : 32
Location : Lollipop Playland killing the loin
User Title : Wise-man PuRpLeDuDe
Mood : The question to the universe Icon_rolleyes
Attendance : Present
Registration date : 23.02.07

The question to the universe Empty
BeitragThema: The question to the universe   The question to the universe EmptySo Aug 15, 2010 5:19 pm

Ok through my failed programing where I missed out a couple of lines Embarassed

I have somehow ended up with the question to the universe
The question to the universe Answer10

Yup, how many e's are there in "The quick brown fox jumped over the fence."?

or is it
How many 101's are there in "The quick brown fox jumped over the fence."?

or is it
How many 69's are there in "The quick brown fox jumped over the fence."?

doesn't matter they all give the same answer!
lol.
Nach oben Nach unten
http://skullking.subjectonline.com/
WarHampster
Site Admin
Site Admin
WarHampster


Männlich Number of posts : 4841
Age : 30
Location : My Stately Pleasure-Dome
User Title : The People's Admin
Mood : The question to the universe Icon_biggrin
Attendance : Present
Registration date : 20.11.06

The question to the universe Empty
BeitragThema: Re: The question to the universe   The question to the universe EmptySo Aug 15, 2010 5:25 pm

Lol, post the source.
Nach oben Nach unten
https://warhampster.editboard.com
Skullking
WHMT Member
WHMT Member
Skullking


Männlich Number of posts : 1198
Age : 32
Location : Lollipop Playland killing the loin
User Title : Wise-man PuRpLeDuDe
Mood : The question to the universe Icon_rolleyes
Attendance : Present
Registration date : 23.02.07

The question to the universe Empty
BeitragThema: Re: The question to the universe   The question to the universe EmptySo Aug 15, 2010 5:29 pm

I fixed the counting, knew exactly what was wrong, But I can't change the uppercase and lowercase printing?
Code:
cout << "The number of occurrences of "
        << tolower( letter )
        << " is "
        << lowerCase
        << endl
        << "The number of occurrences of "
        << toupper( letter )
        << " is "
        << upperCase
        << endl
        << "The total number of occurrences is "
        << total;

letter is the char variable that the user has choosen the search for.
lowerCase, upperCase, total are all int variables that counted the "occurrences."

Edit: I am an idoit
I got it all fixed now heres the new code:

Code:
   
   int total = 0;
   int lowerCaseCount = 0;
   int upperCaseCount = 0;
   char lowerCase = tolower( letter );
   char upperCase = toupper( letter );

          cout << "The number of occurrences of "
        << lowerCase
        << " is "
        << lowerCaseCount
        << endl
        << "The number of occurrences of "
        << upperCase
        << " is "
        << upperCaseCount
        << endl
        << "The total number of occurrences is "
        << total;

with the new variables to catch to upper/lower it prints fine now lolol.

I also had to change bits and pieces when renaming >.<
Nach oben Nach unten
http://skullking.subjectonline.com/
WarHampster
Site Admin
Site Admin
WarHampster


Männlich Number of posts : 4841
Age : 30
Location : My Stately Pleasure-Dome
User Title : The People's Admin
Mood : The question to the universe Icon_biggrin
Attendance : Present
Registration date : 20.11.06

The question to the universe Empty
BeitragThema: Re: The question to the universe   The question to the universe EmptySo Aug 15, 2010 6:45 pm

Good old cin and cout!
Nach oben Nach unten
https://warhampster.editboard.com
Skullking
WHMT Member
WHMT Member
Skullking


Männlich Number of posts : 1198
Age : 32
Location : Lollipop Playland killing the loin
User Title : Wise-man PuRpLeDuDe
Mood : The question to the universe Icon_rolleyes
Attendance : Present
Registration date : 23.02.07

The question to the universe Empty
BeitragThema: Re: The question to the universe   The question to the universe EmptySo Aug 15, 2010 9:23 pm

oh and my formatting isn't bad like what you see, its just for some reason when I copy the code from the schools compiler it goes all screwy lol.
Nach oben Nach unten
http://skullking.subjectonline.com/
Gesponserte Inhalte





The question to the universe Empty
BeitragThema: Re: The question to the universe   The question to the universe Empty

Nach oben Nach unten
 
The question to the universe
Nach oben 
Seite 1 von 1
 Ähnliche Themen
-
» Life, the Universe, and Everything
» Time, Universe and everything.
» Ask any question here!
» Question for Warhamster

Befugnisse in diesem ForumSie können in diesem Forum nicht antworten
DIDNEY WORL :: Misc :: Miscellaneous-
Gehe zu: