Create a conditional expression that evaluates to string \"negative\" if userVal
ID: 3569378 • Letter: C
Question
Create a conditional expression that evaluates to string "negative" if userVal is less than 0, and "positive" otherwise. Example output when userVal = -9 for the below sample program:
Sample program:
--------------------------------------------------------------------------------------------------------------------------------------------------
Using a conditional expression, write a statement that increments numUsers if updateDirection is 1, otherwise decrements numUsers. Ex: if numUsers is 8 and updateDirection is 1, numUsers becomes 9; if updateDirection is 0, numUsers becomes 7. Hint: Start with "numUsers = ...".
Sample program:
Explanation / Answer
for first one
for second one
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.