128k views
1 vote
What would be the expected output for the algorithm below if the input is 90? Algorithm: If the amount in your bank account is greater than or equal to 100, then say "Yes!" else say "Save more." Input: $90

Options:
a) $100
b) Save more.
c) Yes!
d) $90

User Lucyna
by
7.6k points

1 Answer

5 votes

Final answer:

For an input of $90, the algorithm will output "Save more." because the amount is less than the $100 threshold set by the algorithm.

Step-by-step explanation:

The algorithm presented in the question checks if the amount in your bank account is greater than or equal to $100. If it is, the algorithm outputs "Yes!". If not, it outputs "Save more." Since the input is $90, which is less than $100, the expected output of this algorithm would be "Save more."

User Shravan Yadav
by
7.2k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.