QUESTION 5 20 points S This code works, but is not as efficient & clearly writte
ID: 3698901 • Letter: Q
Question
QUESTION 5 20 points S This code works, but is not as efficient & clearly written as it could be. Which "programming style guideline" does this segment of code violate? if tempunits 'F' emp - else temp temp; end O Use indentation to show the structure O Don't use an else clause when there is just one condition and one action Don't write a condition that is more complicated than necessary Don't put unnecessary conditions on else or elseif clauses Click Save and Submit to save and submit. Click Save All Answers to save all answers. Save All Answers Save andExplanation / Answer
option b;
Else block is not necessary, when there is only one condition is being checked and only one action is being performed.
In this case if condition checks for something, if the condition follows, it performs an action, otherwise it does nothing.
The same is in the else condition, it does nothing (which is unnecessarry)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.