Pseudocode "Break" Omission
See original GitHub issueChallenge Adding a default option in Switch statements
In this challenge’s pseudocode it does omits the “break;” statement where it is needed. This may be obvious and it’s not a “bug” per se but I’m sure it could confuse some users who are new to programming.
Side note:
LOVE THIS SITE!!! THANK YOU FOR ALL YOUR HARD WORK!!!
switch (num) {
case value1:
statement1;
break;
case value2:
statement2;
break;
...
default:
defaultStatement;
}
edit: challenge is still passable, is break unecessary? sorry for the confusion.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Pseudocode - TechnologyUK
Pseudocode is a compact and informal high-level description of a computer programming algorithm that uses the structural conventions of ...
Read more >In a switch statement, what will happen if a break statement is ...
If a break statement was not placed at the end of a particular case portion? It will move on to the next case...
Read more >Break and Continue statement in Java - GeeksforGeeks
Break : The break statement in java is used to terminate from the loop ... If omitted, execution will continue on into the...
Read more >Pseudocode: A LATEX Style File for Displaying Algorithms
This paper describes a LATEX environment named pseudocode that can be used for describing algorithms in pseudocode form. This is the style used....
Read more >while(true) and loop-breaking - anti-pattern?
It's more difficult to figure out how you'd exit the loop, and could invite bugs as the breaking condition might be bypassed or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @krisb1220
freeCodeCamp ❤️ you too! And thanks for reporting the issue.
Both the
case
statements in the pseudo code havebreak
statements. I am not sure what are you referring to.Can you please clarify more?
I think we could add a
break
statement to the default case to make it clearer.The fact that it’s possible to omit
break
statements in some cases (for the lastcase
, fordefault
or when usingreturn
in case blocks) is a detail that campers can learn in the future.I’d say we can open this for first time contributors! 🙂