147k views
5 votes
Write an if statement that prints the message “Application accepted” if the variable workExperience is greater than or equal to 2 or the variable hasCollegeDegree is true.

User Naytzyrhc
by
5.9k points

2 Answers

4 votes
if workExperience >= 2 or CollegeDegree is true:
print “Application accepted”
else:
print “Application denied”

User Pong Petrung
by
6.9k points
4 votes

Answer:

if workExperience>=2 or hasCollegeDegree==True:

print("Application accepted")

Step-by-step explanation:

  • In the first line of code, we wrote an if statement that allows us to print a message if and only if the int variable workExperience is greater than 2 or the bool variable workExperience is True
  • In the second line of code, we print the message Application accepted if the if-statement evaluated to True

Note: This code was written in python but you can extend the same concept to any programing language using if, comparison operation, boolean operators and print function.

User Andris Jefimovs
by
6.6k points