Examlex

Solved

Explain Why the Following Code Sample Does Not Capture the Intent

question 23

Essay

Explain why the following code sample does not capture the intent of the request "Make sure if the sales code is not 'A' or 'B', the customer gets a 10% discount".What is the correct if statement?
if(salesCode != 'A' || salesCode != 'B')
discount = 0.10;


Definitions:

Expected Norms

The unwritten rules or behaviors that are considered standard, appropriate, or typical within a specific group, community, or culture.

Particular Situation

A specific set of circumstances or state of affairs at a given time.

Behavior

The actions or reactions of an individual or group in response to external or internal stimuli.

Transferring of Information

The process of conveying data, knowledge, or details from one person, place, or system to another.

Related Questions