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
Dmitry [639]
3 years ago
8

Which of the following could NOT be represented by a boolean variable?

Computers and Technology
1 answer:
Len [333]3 years ago
8 0

Answer:

Whether a traffic light is green, yellow or red

Explanation:

Boolean variables are variables that can either take one out of two options at any given instance.

Analyzing the given options

1. Elevator:

Possible Directions = Up or Down; That's two possible values

But it can only move in one direction at a given instance.

<em>This can be represented using Boolean</em>

2. Traffic Light:

Possible Lights = Green, Yellow or Red

That's three options.

<em>This can be represented using Boolean</em>

<em />

The last two options can be represented using Boolean because they have just two possible values

<em>Hence, option (B) answers the question</em>

You might be interested in
A ________ is an input device that responds to finger touch.
AURORKA [14]

1 - 3 21 - 3 21 - 3 21 - 3 21 - 3 21 - 3 21 - 3 21 - 3 21 - 3 21 - 3 21 - 3 21 - 3 21 - 3 21 - 3 2

6 0
3 years ago
Read 2 more answers
What happens when variables in programming are not properly initialized? answers?
Romashka-Z-Leto [24]
Errors in compilation happen, or it runs but then doesn't recognize the input. Also you can't transform into other types of variables.
6 0
3 years ago
Write the Number class that can be used to test if the number is odd, even, and perfect. A perfect number is any number that is
egoroff_w [7]

Answer:

Explanation:

The following code is written in Python. It creates a class that takes in one ArrayList parameter and loops through it and calls two functions that check if the numbers are Perfect, Odd, or Even. Then it goes counting each and printing the final results to the screen.

class NumberAnalyzer:

   def __init__(self, myArray):

       perfect = 0

       odd = 0

       even = 0

       for element in myArray:

           if self.isPerfect(element) == True:

               perfect += 1

           else:

               if self.isEven(element) == True:

                   even += 1

               else:

                   odd += 1

       print("# of Perfect elements: " + str(perfect))

       print("# of Even elements: " + str(even))

       print("# of Odd elements: " + str(odd))

   def isPerfect(self, number):

       sum = 1

       i = 2

       while i * i <= number:

           if number % i == 0:

               sum = sum + i + number / i

           i += 1

       if number == sum:

           return True

       else:

           return False

   def isEven(self, number):

       if (number % 2) == 0:

           return True

       else:

           return False

6 0
2 years ago
Why is it difficult to detect a Trojan horse?
marishachu [46]

Answer:

Explanation:

Because the virus disguises it self as something you are trying to download, then it attackes your device

8 0
3 years ago
Read 2 more answers
Date Time Manipulation Exploration If you start from Jan 1st, 1757, and repeatedly add 8 days, until you hit 1800, how many time
zimovet [89]

Answer:

from datetime import datetime, date, timedelta

def count_weekdays(start_date, add_days, stop_year, weekday):

   my_date = start_date

   m = 0  

   while my_date.year != stop_year:  

       my_date = my_date + timedelta(days = add_days)

       if my_date.isoweekday() == weekday:

           m += 1

   return m

date_val = date(1757,1,1)

try:

   date_val = datetime.fromisoformat(input("Enter date in the format yyyy-mm-dd: "))

except ValueError:

   print("Wrong isoformat string")

print(count_weekdays(date_val, 8, 1800, 1))

Explanation:

The datetime package of the python programming language has several time modules like the date, datetime, pytz, timedelta, etc, used to manipulate date and time in documents. The function count_weekdays has four parameters and returns the number of a specified weekday in a period of time.

4 0
3 years ago
Other questions:
  • "Which of the following will help protect against a brute force attack?
    11·1 answer
  • If you use the ___ template, as opposed to a formatted theme, you must make all design decisions?
    15·1 answer
  • When selecting current page from the print range, on the print dialong box it will print
    5·1 answer
  • Two powerboats are about to cross paths. what should the boat on the starboard (right) do?
    11·1 answer
  • Consider the following C code fragment:
    10·1 answer
  • Hannah wants to write a book about how scientists and society interact, and she has generated ideas for chapters. Which chapter
    13·1 answer
  • Which can be used to create a poll on a web page? <br>CSS<br>HTML <br>JavaScript <br>Text editor​
    12·1 answer
  • Write a program that lets the user perform arithmetic operations on fractions. Fractions are of the form a/b, in which a and b a
    11·1 answer
  • Explain how communication facilitate cordination​
    14·1 answer
  • Assume that Publication is the root class of an inheritance tree. You want to form a linked list of different publications in th
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!