Question: Activity #3: To do in lab - as a team The purpose of this program is to give you practice with performing Boolean logic with

 Activity #3: To do in lab - as a team The

Activity #3: To do in lab - as a team The purpose of this program is to give you practice with performing Boolean logic with Python. Your team is responsible for submitting a file Lab4_Act3.py demonstrating the following exercises. However, each team member is responsible for knowing this material, and it may be a good idea for all team members to practice keying in the code given. You are required to include code for Part A, Part B and Part C below in your file for submission. Please include empty lines between different sections of your code, and use comments to describe what you are doing. Part A: Inputting Boolean values from the keyboard Write a simple code to ask the user to enter a Boolean value from the keyboard. The user should be able to enter a value indicating Boolean True and Boolean false from the keyboard and have the code create a Boolean variable representing the user's input for use in Boolean expressions that appear later in the code. You will need a simple code to make some decisions based on the values of these Boolean variables to verify that your scheme works. The user should enter "True", or "T", or 't' for Boolean True. To indicate Boolean False, the user should enter "False, or F, or 'f'. (Note: Numeric input is not permissible.) (Another Note: User is not required to enter the open/close quotation marks from the keyboard.) If this proves to be a bit of a challenge, review this week's lecture slides covering Boolean conversions. You may have to use your new-found knowledge of if-elif-else blocks to make this work as described. Part B: Evaluating Booleans Write a program that asks the user to enter True/False values from the keyboard for each of the variables a, b, and c and evaluates the following Boolean expressions. (Use your routine from above to retrieve the input.) The program should output the value, True or False, of the expression for the entered values. 1. a and b and c 2. a or borc Part C: Writing Boolean expressions Extend the program above to include Boolean expressions that meet the criteria in each item below. For these programs, simply hard-code the values of the variables in the code rather than asking the user for input from the keyboard. 1. Given values for two Boolean variables a and b, the expression evaluates to True if just one of a or bis True, but not if both are True or both or False i. (Note: this is also called an "exclusive or between a and b.) 2. Given values for three Boolean variables a, b, and c, the expression evaluates to True if an odd number (i.e. exactly 1 or 3) of the variables a, b, and cis True, and is False otherwise. a. Note: Use only Boolean expressions. Do not use if-elif-else blocks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!