15.1k views
2 votes
Which if branch executes when an account lacks funds and has not been used recently? hasFunds and recentlyUsed are booleans and have their intuitive meanings.

a. if ChasFunds && !recentlyUsed)
b. if (has Funds && recentlyUsed)
c. if (ThasFunds && !recentlyUsed)
d. if (hasFunds && recentlyUsed)

User Guy Gordon
by
5.3k points

1 Answer

7 votes

Options :

a. if (hasFunds && !recentlyUsed)

b. if (!has Funds && recentlyUsed)

c. if (!hasFunds && !recentlyUsed)

d. if (hasFunds && recentlyUsed)

Answer:

C. if (!hasFunds && !recentlyUsed)

Step-by-step explanation:

Since both hasFunds and recentlyUsed have intuitive meaning;

hasFunds means an account which is funded or has money.

recentlyUsed means an account which has been put to use in recent time.

An account which lacks funds and has not been recently used will be express thus :

! Symbol means negation

&& - means AND

!hasFunds means lack or does not have funds

!recentlyUsed means hasn't been used in recent times

The boolean statement used with && will only execute or return true if both statement are true.

True and True = True

!hasFunds returns True = 1

!recentlyUsed returns True = 1

User User Learning
by
4.9k points