Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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 and

Explanation / 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)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote