1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
adoni [48]
3 years ago
12

Write a program, which will display the menu with 5 items. It will ask the use to give their choice. It will trap all possible e

rrors and then print the result when correct input is provided before exiting the program.
Computers and Technology
1 answer:
Monica [59]3 years ago
8 0

Answer:

The program in Python is as follows:

print("Welcome to sorting program")

print("1. Title")

print("2. Rank")

print("3. Date")

print("4. Start")

print("5. Likes")

while(True):

   choice = input("Enter a choice between 1 and 5 only: ")

   if choice.isdigit() == True:

       if(int(choice)>=1 and int(choice)<=5):

           print("You entered valid choice", choice)

           break;

       else:

           print("You have not entered a number between 1 and 5. Try again")

   else:

       print("You entered an invalid choice")

Explanation:

This prints the header

print("Welcome to sorting program")

The next 5 lines print the instructions

print("1. Title")

print("2. Rank")

print("3. Date")

print("4. Start")

print("5. Likes")

The loop is repeated until it is forcefully exited

while(True):

This prompts the user to enter a choice

   choice = input("Enter a choice between 1 and 5 only: ")

This checks if the choice is a digit

   if choice.isdigit() == True:

If yes, this checks if the choice is between 1 and 5 (inclusive)

       if(int(choice)>=1 and int(choice)<=5):

If yes, this prints valid choice and the choice entered

           print("You entered valid choice", choice)

The loop is exited

           break;

If the choice is out of range

       else:

This prints the error and tells the user to try again

           print("You have not entered a number between 1 and 5. Try again")

If choice is not a digit

   else:

This prints invalid choice

       print("You entered an invalid choice")

You might be interested in
Assume that you are able to do an exhaustive search for the key to an encrypted message at the rate of 100 Million trials per se
Len [333]

Answer:

Following are the solution to this question:

Explanation:

In point 1:

Trials frequency = \frac{100 \  million }{second}

calculating the main length of cryptography = 112 bit

\to 100\  Million = 1 \times 10^8

calculating the second year value:

\to 365 \times 24 \times 60 \times 60 =3153600\\\\

                                  =3.15 \times 10^7 \ seconds

Currently, in average , at least half the possible sleeves is being used to verify the encryption process:  2^{111} \ keys

\to \frac{2^{111} \time3s 10^6}{3.15 \times 10^7}\approx 8.22 \times 10^{20} \ years

the total time value will be 8.22 \times 10^{20} \ years

In point 2:

In cryptography, the common name is Triple DES (3DES), which would be the symmetric-key encrypted communication algorithm (TDEAor Triple DEA), which adds 3 times per block size only with the cryptographic method Data Encryption Standard ( DES).  

Algorithm:-

The key package involves four DES keys, K1, K2, and K3, each 56-bit (except parity bits), Triple DES includes. Its encoding algorithm is::  

ciphertext = EK3(DK2(EK1(plaintext)))

I.e. K1, DES encrypt, K2 decrypt, then K3 encrypt DES.  

The reverse is the decryption:  

plaintext = DK1(EK2(DK3(ciphertext)))

I.e. decrypt by K3, crypt by K2, decrypt by K1.  

Every three-bit authentication encrypts a 64-bit block.

Its middle procedure in each situation it's the reverse of the first operation. It improves the strength of the key second option algorithm which offers DES native support with key option 3.

4 0
3 years ago
Which type of software is offered in trial form or for a limited period of time?
kkurt [141]

The type of software which is offered in trial form or for a limited period of time is called shareware.

Software which are offered for free in trial form or for a limited time period are called shareware. They operate on the principle that once the user understands what the software can offer they will pay to use it later.

Most shareware software has built in countdowns which start as soon as you start the trial and at the end of which access is automatically revoked. They require the user to form a simple account. These versions generally provide a very basic selection of functions and are used to rake in more paying users.

Types of shareware include:

  1. Adware: It stands for advertising-supported software where the advertisements generate revenues.
  2. Demoware: This is a trial version of the original software including all features.
  3. Crippleware: This software is free but provides limited features till it is purchased.
  4. Trialware

This provides the user with full feature access for a time limit and then requires purchase.

You can learn more about shareware software at

brainly.com/question/4593389

#SPJ4

3 0
2 years ago
Which interest bearing account is best for people who won’t need access to their money for several months or longer?
lutik1710 [3]

The correct answer to this question is a certificate of deposit.

A certificate of deposit is an interest bearing account that pays a higher rate of interest than a savings account or interest bearing checking account because you are committing to leave it in the bank for a specified period of time. The CD could be for serveral months, or extend out to multiple years. Normally the interest rate will increase as the length of time increases.

3 0
3 years ago
Dust buildup inside a desktop PC case can be managed effectively by ____.
antoniya [11.8K]
Frequent cleaning with an air duster can would do the job
6 0
3 years ago
Read 2 more answers
What is the utility of a lever?
Kamila [148]
Muy cosas.
 fazer una montanha russa andar,ativar una armadilha, ativar una puerta etc.
3 0
4 years ago
Read 2 more answers
Other questions:
  • Write the HTML to create a hyperlink to the named fragment designated by “top”.
    10·1 answer
  • Some projectors use a connection technology called _______________ that enables long-range connectivity for uncompressed HD vide
    7·1 answer
  • Which describes how media and networks interact
    12·1 answer
  • Why you think Operating System is pivotal in teaching and learning.
    13·1 answer
  • How many bits are used to direct traffic to specific services running on a networked computer?
    6·1 answer
  • What function will delete an element from the end of a deque. On Edge
    13·1 answer
  • Create a function called sphereVolume that determines the volume of a sphere with a given radius and prints the result to the sc
    9·1 answer
  • A processor's speed is measured in megahertz (MHz), or millions of instructions per second; and gigahertz (GHz), or billions of
    9·2 answers
  • How to fix this? Zoom it in to see it better
    8·1 answer
  • Cisco cyber security would classify this email?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!