Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . Examine the following programs and determine the res 2 . ults shown to the user. There is no need to run these programs

1. Examine the following programs and determine the res
2. ults shown to the user. There is no need to run these programs - the goal is to be able to answer questions like this without using the computer. Get your work checked off during lab so we can address any misconceptions you may have.
# version 1
num = int(input('Enter a number: '))
if num <5 :
num = num *2
print(num) user enters 8 user enters 3 user enters 5
# version 2
num = int(input('Enter a number: '))
if num <=5 :
num = num *2
print(num) user enters 8 user enters 3 user enters 5
# version 3
num = int(input('Enter a number: '))
if num <5 :
print(num)
num = num *2
else :
num = num +3
print(num) user enters 8 user enters 3 user enters 5
# version 4
num = int(input('Enter a number: '))
if num <5 :
num = num *2
print(num)
else :
num = num +3
print(num) user enters 8 user enters 3 user enters 5
# version 5
num = int(input('Enter a number: '))
num = num -1
if num <5 :
num = num *2
else :
print(num)
num = num +3
print(num) user enters 8 user enters 3 user enters 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions

Question

Different types of Grading?

Answered: 1 week ago

Question

Explain the functions of financial management.

Answered: 1 week ago

Question

HOW MANY TOTAL WORLD WAR?

Answered: 1 week ago

Question

Discuss the scope of financial management.

Answered: 1 week ago

Question

Describe the job youd like to be doing five years from now.

Answered: 1 week ago

Question

So what disadvantages have you witnessed? (specific)

Answered: 1 week ago