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

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

Persuasive Speaking Organizing Patterns in Persuasive Speaking?

Answered: 1 week ago