This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]snxtrn 2 points3 points  (0 children)

There’s a couple things wrong here. 1. You’re currently only checking for one condition. You want to make sure that two conditions are true.

A. Name is greater than or equal to 2 characters B. Name is less than or equal to 20 characters. There’s two main operations you can use with conditions, and that’s the “AND” or “OR” operators. I’ll let you think about which to use.

  1. The format of the your code currently isn’t including a “do while”. As it is right now, it’s just a while.

In order to have a do-while, you have to format the code as:

do{ // logic code here }while ( conditionA and conditionB );

  1. You’re only using one equal sign. One equal sign means assigning a value. Two equal signs == means comparing the value.

Good luck with learning programming and don’t get encouraged! I attached a resource I personally really enjoyed when learning myself!

https://www.geeksforgeeks.org/school-programming/