Ask Question
10 February, 21:10

Code a Boolean expression that tests if a decimal variable named currentSales is greater than or equal to 1000 or a Boolean variable named newCustomer is equal to true. Code this statement so both conditions will always be tested, and code it in the shortest way possible]

+4
Answers (1)
  1. 11 February, 00:04
    0
    Given

    Decimal variable: currentSales

    Decimal test value: 1000

    Boolean variable: newCustomer

    Boolean default value: true

    The following code segment is written in Java

    if (currentSales = = 1000 || newCustomer)

    {

    //Some statements

    }

    The Program above tests two conditions using one of statement

    The first condition is to check if currentSales is 1000

    = = Sign is s a relational operator used for comparison (it's different from=)

    || represents OR

    The second condition is newCustomer, which is a Boolean variable

    If one or both of the conditions is true, the statements within the {} will be executed

    Meaning that, both conditions doesn't have to be true;

    At least 1 condition must be true for the statement within the curly braces to be executed
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Code a Boolean expression that tests if a decimal variable named currentSales is greater than or equal to 1000 or a Boolean variable named ...” in 📘 Engineering if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers