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
myrzilka [38]
3 years ago
10

Put these expressions in a small program that will demonstrate whether they are true or false. Paste the code, and output from t

he program into your submission. Use if statements and output a message indicating that the expression is True or False.
Engineering
1 answer:
love history [14]3 years ago
6 0

complete question:

Put these expressions in a small program that will demonstrate whether they are true or false. Paste the code, and output from the program into your submission. Use if statements and output a message indicating that the expression is True or False.

a = 5,  b = 4,  c = 3,  d = 2 ;

(a <= b + 1 )

(a < b && c > b)

(a >= c || d >= 5)

( !(a > b) )

( b >= a && ! (d < b) )

Answer:

a = 5

b = 4

c = 3  

d = 2

if a <= b + 1 :

       print("True")

else :

      print("False")

if a < b and c > b :

      print("True")

else :

      print("False")

if a >= c or d >= 5:

       print("True")

else :

       print("False")

if not(a > b):

       print("True")

else :

       print("False")

if ( b >= a and not(d < b) ):

       print("True")

else :

      print("False")

Explanation:

I used python to write the code

The equivalent of && in python is and while the equivalent of || is or. The equivalent of !  is not  in python .

I wrote an if statement to print True for each expression if it is actually true and the else statement print False if the expression is actually false.

For example the first expression says if a is less than or equal to b + 1(5). This statement is actually true so the expression will print True. a is 5 and b plus 1 is 5, so a is equal to 5 which is true.

if a < b and c > b :

Both expression must be true for the if statement to print True.  a is not less than b and c is not greater than b so the expression amount to False.

if a >= c or d >= 5:

One expression must be true for the expression to be True. a >= c is true and d >= 5 is false. So the expression amount to True.

not(a > b)

This simply means negate the statement a > b . This gives False.

( b >= a and not(d < b))

b >= a is false

d < b is true

not(d < b) is false

false and false is definitely False

You might be interested in
Free brainlist because im new and i just want to but you have t friend me first
Amiraneli [1.4K]
Okay sure.









I’ll 1)chords
2)pulse
3)aerophone
4) the answer is C
5)rhythm

Pretty sure those are the answers
4 0
3 years ago
Which option can result from a lack of stable social and professional bonds?
PilotLPTM [1.2K]
B.) An unstructured, chaotic life
6 0
3 years ago
Read 2 more answers
Technician A says that 18 gauge AWG wire can carry more current flow that 12 gauge AWG wire. Technician B says that metric wire
denpristay [2]

Answer:

Technician B

Explanation:

Both AWG and metric are sized by cross-sectional area.

Technician A is wrong:  12 gauge wire is larger diameter rated for 20 amps in free air.  18 awg is smaller diameter and typically used for speaker wiring, Class II or low voltage and sub-circuits within appliances.

6 0
4 years ago
A group of statisticians at a local college has asked you to create a set of functions that compute the median and mode of a set
iVinArrow [24]

Answer:

Functions to create a median and mode of a set of numbers

Explanation:

def median(list):

   if len(list) == 0:

       return 0

   list.sort()

   midIndex = len(list) / 2

   if len(list) % 2 == 1:

       return list[midIndex]

   else:

       return (list[midIndex] + list[midIndex - 1]) / 2

def mean(list):

   if len(list) == 0:

       return 0

   list.sort()

   total = 0

   for number in list:

       total += number

   return total / len(list)

def mode(list):

   numberDictionary = {}

   for digit in list:

       number = numberDictionary.get(digit, None)

       if number == None:

           numberDictionary[digit] = 1

       else:

           numberDictionary[digit] = number + 1

   maxValue = max(numberDictionary.values())

   modeList = []

   for key in numberDictionary:

       if numberDictionary[key] == maxValue:

           modeList.append(key)

   return modeList

def main():

   print "Mean of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]: ", mean(range(1, 11))

   print "Mode of [1, 1, 1, 1, 4, 4]:", mode([1, 1, 1, 1, 4, 4])

   print "Median of [1, 2, 3, 4]:", median([1, 2, 3, 4])

main()

3 0
4 years ago
Read 2 more answers
Relationship between civil engineering and geology​
natka813 [3]

Answer:

Geological and civil engineers sometimes work together, but have very different responsibilities. While geological engineers study the earth's inner and outer surface to evaluate potential mining and infrastructure construction sites, civil engineers design the infrastructure to be built.

5 0
3 years ago
Other questions:
  • A horizontal angle was measured by repetition six times with a total station. If the initial display reading was 21o33'18" and t
    6·1 answer
  • Light energy produces the only voltage in a solar cell. (a)-True(T) (b)- false(F)
    9·1 answer
  • Consider a thermal energy reservoir at 1500 K that can supply heat at a rate of 150,000 kJ/h. Determine the exergy of this suppl
    15·1 answer
  • Consider the combustion of ethanol C2H5OH with air. Assume the air is dry and comprised of 21% oxygen and 79% nitrogen on a mola
    15·1 answer
  • Suppose you have two boxes in front of you. One box contains a Thevenin Equivalent (voltage source in series with a resistor) an
    13·1 answer
  • Water is the working fluid in an ideal Rankine cycle. The condenser pressure is 8 kPa, and saturated vapor enters the turbine at
    10·1 answer
  • A Gaussian random voltage X volts is input to a half-wave rectifier and the output voltage is Y = Xu (X) Volts were u (x) is the
    9·1 answer
  • A rectangular channel 3-m-wide carries 12 m^3/s at a depth of 90cm. Is the flow subcritical or supercritical? For the same flowr
    15·1 answer
  • Create a story with nuclear engineer (not so long and not so short)
    13·1 answer
  • What is shown in the above figure
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!