Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a. Write a program that asks the user to enter a password. If the user enters the right password, the program should tell them they

a. Write a program that asks the user to enter a password. If the user enters the right password, the program should tell them they are logged in to the system. Otherwise, the program should ask them to reenter the password. The user should only get five tries to enter the password, after which point
the program should tell them that they are kicked off of the system.

b. Modify the higher/lower program so that when there is only one guess left, it says 1 guess, not 1 guesses.

c. The GCD (greatest common divisor) of two numbers is the largest number that both are divisible by. For instance, gcd(18, 42) is 6 because the largest number that both 18 and 42 are divisible by is 6. Write a program that asks the user for two numbers and computes their gcd. Shown below is a way
to compute the GCD, called Euclid’s Algorithm.
 First compute the remainder of dividing the larger number by the smaller number
 Next, replace the larger number with the smaller number and the smaller number with the
remainder.
 Repeat this process until the smaller number is 0. The GCD is the last value of the larger
number.

Please help me with this problem Using Python as a language.

Step by Step Solution

3.41 Rating (151 Votes )

There are 3 Steps involved in it

Step: 1

Python code for password printEnter correct password to continue passwordinputEnter password count0 ... 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

Introduction to Algorithms

Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest

3rd edition

978-0262033848

More Books

Students also viewed these Algorithms questions

Question

Why do companies use colocation facilities?

Answered: 1 week ago