Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (anonymous):

Problem statement: Using loop, write a program that will ask the user to enter a character for left or right. Then, the user will enter a number. The program should generate a ladder of X wherein the level depends on the number entered and the character should dictate whether it faces right or left. Sample: Character is r Number is 3 Output: X XX XXX Problem statement: Using loop, write a program that will ask the user to enter a character for left or right. Then, the user will enter a number. The program should generate a ladder of X wherein the level depends on the number entered and the character should dictate whether it faces right or left. Sample: Character is r Number is 3 Output: X XX XXX @Computer Science

OpenStudy (anonymous):

what language?

OpenStudy (anonymous):

C++

OpenStudy (anonymous):

Please reply T_T I have no idea

OpenStudy (anonymous):

One moment I am just writing it on some other site

OpenStudy (anonymous):

Thanks :D

OpenStudy (anonymous):

so if character = l and number = 3. would it look like: X XX XXX

OpenStudy (anonymous):

Yes :)

OpenStudy (anonymous):

Alright I'm porting my code into C++, managed to get that 'l' working

OpenStudy (anonymous):

Thanks :D

OpenStudy (anonymous):

I'm not an expert on C++, so I don't know if a C++ standard toupper function/method exists, and I used the one from C's standard library :-P anyway it works well.

OpenStudy (anonymous):

Oops I had a bug in there. Fixed it: http://ideone.com/W8FBZ

OpenStudy (anonymous):

Thanks dude! It worked XD

OpenStudy (anonymous):

It goes crazy when you enter a character for a number though :P

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!