1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vera_Pavlovna [14]
3 years ago
11

Write a single if-test using Boolean operators and relaional operators to determine if a double variable x is between zero (excl

usive) and one (inclusive). Print a message indicating that x is between zero and one inclusive. Use deMorgan’s law to show the complement of the previous if-test. Simplify the complement statement so there is no "!" in your final if-test statement. 5. In the following questions, assume Boolean values have been assigned to A, B, and C as follows: boolean AA = true; boolean BB = false; boolean CC = true; Indicate what is printed by each statement: System.out.println( ((AA && BB) || (AA && CC)) ); System.out.println( ((AA || !BB) && (!AA || CC) ); 6. Write a program to determine if an input integer is an even number or odd number. 7. How can the effect of the following program fragment best be described? if (x > y) z = x; if (x == y) z = 0; if (x < y) z = y; a. The smaller of x and y is stored in z. b. The larger of x and y is stored in z. c. The larger of x and y is stored in z, unless x and y are equal, in which case z is assigned 0. d. The larger of x and y is stored in z, unless x and y are not equal, in which case z is assigned 0. e. None of the above.
Computers and Technology
1 answer:
Dahasolnce [82]3 years ago
3 0

Answer:

The following are the solution to this question:

Explanation:

In the given question multiple questions have been asked about, that is defined as follows:

#include<iostream>//defining header file

using namespace std;

int  main()//defining main method

{

  double x1;//defining double variable

  cout<<"enter value: ";//print message

  cin>>x1;//input value from the user-end

  if(x1>0 && x1<=1)//use boolean operators

  {

      cout<<"x is between zero and one";//print message

  }

  return 0;

}

Output:

enter value: 1

x is between zero and one

5)

public class Main//defining a class main

{

public static void main(String[] args) //defining main method

{

       boolean AA = true; //defining boolean variable  

       boolean BB = false;//defining boolean variable  

       boolean CC = true; //defining boolean variable

      if ((AA && BB) || (AA && CC)) //defining if block to check value

      {

         System.out.println("True");//print message

      }

      if ((AA || !BB) && (!AA || CC))//defining if block to check value

      {

         System.out.println("True");//print message

      }

   }

}

Output:

True

True

6)

#include <stdio.h>//defining header file

int main()//defining main method

{

   int x;

   printf("Enter a value: ");

   scanf("%d", &x);

   if (x%2==0)// check number

      {

       printf("Even number");//print message

      }

      else

      {

       printf("Odd Number");//print message

      }

   return 0;

}

Output:

Enter a value: 22

Even number

7)

The answer is "Option C".

In the first question, a double variable "x1"  is defined that inputs the value from the user end and use the boolean operators to check the value and print its value.

In question 5, three boolean variables "AA, BB, and CC" are defined that hold boolean value and use if block to check the given value.

In question 6, an integer variable has defined, that input the value and use if block to check even or odd number and print its value.

In question 7, option c is correct.

You might be interested in
Let PALINDROME_DFA= | M is a DFA, and for all s ∈ L(M), s is a palindrome}. Show that PALINDROME_DFA ∈ P by providing an algorit
denis-greek [22]

Answer:

Which sentence best matches the context of the word reticent as it is used in the following example?

We could talk about anything for hours. However, the moment I brought up dating, he was extremely reticent about his personal life.

Explanation:

Which sentence best matches the context of the word reticent as it is used in the following example?

We could talk about anything for hours. However, the moment I brought up dating, he was extremely reticent about his personal life.

8 0
3 years ago
Q: Why can't I log in to Brainly
algol13

Answer:

yes you are probably on a school Chromebook

Explanation:

5 0
3 years ago
Why is it important to write something in the subject line of emails?
marin [14]
So the person can know what you want and it helps keep better track of emails and subject matters
8 0
3 years ago
Read 2 more answers
a. Write a function called fizzbuzz. This function will take 1 number as a parameter. The function will print all numbers from 0
OLga [1]

Answer:

def fizzbuzz (num):

 for item in range(num):

   if item % 2 == 0 and item % 3 == 0:

     print("fizzbuzz")

   elif item % 3 == 0:

     print("buzz")

   elif item % 2 == 0:

     print("fizz")  

   else:

     print (item)

fizzbuzz(20)

Explanation:

Using Python programming Language

Use a for  loop to iterate from 0 up to the number using the range function

Within the for loop use the modulo (%) operator to determine divisibility by 2 and 3 and print the required output

see attached program output screen.

5 0
4 years ago
In cell F29, use an IF function to display the correct Shipping Charge, based on the amount of the Discounted Total. If the Disc
sladkih [1.3K]

Answer:

= IF(B29 >= B28,0,(0.05 * B29))

Explanation:

Given

Free Shipping Minimum = B28

Shipping Charge = F29

Required

Write a formula in F29 to calculate the total shipping charge based on the condition in the question.

To solve this, the following assumption needs to be made.

It'll be assumed that cell B29 contains the value for Discounted Total.

So,

Discounted Total = B29

The condition in the question says

1. If Discounted Total (B29) is greater than or equal to the Free Shipping Minimum (B29), then Shipping Charge (F29) is 0

This can be represented as

If(B29 >= B28)

F29 = 0

2. Else (i.e. if (1) above is false), Shipping Charge (F29) equals 5% of Discounted Total (B29)

This can also be represented as

F29 = 0.05 * B29

Writing the formula in (1) and (2) together in Excel format;

= IF(B29 >= B28, 0, (0.05 * B29))

The above formula will give the desired result based on the condition in the question.

Take for instance;

Free Shipping Minimum = B28 = 28

Discounted Total = B29 = 30

Since 30 >= 28, the value of F29 will be 0 because it satisfies condition 1.

But if

Free Shipping Minimum = B28 = 30

Discounted Total = B29 = 28

Since 28 < 30, the value of F29 will be 5% of 28 = 1.4 because it satisfies condition 2

8 0
3 years ago
Other questions:
  • What is the name of the feature that can be enabled on slower-speed WAN links to prevent a large data transfer from affecting th
    10·1 answer
  • GAMES Which is better Roblox or BattleCamp Basically Free Points But Please Answer
    7·2 answers
  • What career cluster does a fish and game warden fall in?
    14·1 answer
  • If a full disk encryption (FDE) password is forgotten, what can be incorporated to securely store the encryption key to unlock t
    13·1 answer
  • What has information technology made piracy possible?
    14·1 answer
  • What is an online reputation?
    12·2 answers
  • Define additional characteristics such as font weight or style for an html tag
    5·1 answer
  • Larry sent an email to Andy. Andy didn't open Larry's email but still understood what the message was. How did Andy determine th
    14·1 answer
  • In a systems development life cycle (SDLC) model, the purpose of the _____ is to create a physical model that will satisfy all d
    10·1 answer
  • A motor is controlled by a logic circuit. The circuit has inputs (0 or 1) from three sensors
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!