Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 1 Due by 03/04/2021 2:00 PM 1) Third prime number practice: A prime number (or a prime) is a natural number greater than 1

Assignment 1 Due by 03/04/2021 2:00 PM 1)

Third prime number practice: A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. Write a program that takes a positive integer bigger than or equal to 2 from the user and displays all prime numbers until that number (the number that user has given should be checked as well and be displayed if it is a prime number.) It is not necessary that the code would check the correctness of users input (meaning to check if the number that the user has given is a positive integer bigger than or equal to 2). Hint: you must use nested loops.

2) Improved password check: Write a program that would ask the user for a password and checks if the given password is TTU Rocks! or not. If the password is correct the program would display Access granted! Welcome to TTU!. And if the password is incorrect the program would display Wrong password! Try Again! and take another password and checks to see if it is correct or not. The program should let the user to try entering the password 3 times total (first time included) and if all three tries are incorrect passwords, the program should stop taking passwords from the user and display Too many tries! Your access is denied!. To write this program you must use repetition structures.

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_2

Step: 3

blur-text-image_3

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

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions