pat8612
03-24-2005, 09:24 PM
hi im new to programming. im starting with c++ i think this is a good starting language. i see alot on java and i want to learn that next. why is java better?
im working on a c++ problem - I'm in the control structure chapter. i need to ask for 5 numbers from 1-30 and then based on the number print that many *** so if 4 is entered i need to print ****. i understand while and for structures but havent done any switch problems yet. i started to declare variable num1 -num30 and count. to count from 1 to 5 loop 5 times. im thinking about setting up a switch but not sure how to. theres one example in the book that uses
while (( grade = cin.get() ) !=EOF {
but i dont want to ask the user to end i want to count up to five - loop five times. could i use for ( count =1; count <= 5, count++ )
im not sure what the cin.get() is?
would i need to have 30 cases?
any help is appreciated.
im working on a c++ problem - I'm in the control structure chapter. i need to ask for 5 numbers from 1-30 and then based on the number print that many *** so if 4 is entered i need to print ****. i understand while and for structures but havent done any switch problems yet. i started to declare variable num1 -num30 and count. to count from 1 to 5 loop 5 times. im thinking about setting up a switch but not sure how to. theres one example in the book that uses
while (( grade = cin.get() ) !=EOF {
but i dont want to ask the user to end i want to count up to five - loop five times. could i use for ( count =1; count <= 5, count++ )
im not sure what the cin.get() is?
would i need to have 30 cases?
any help is appreciated.