Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a) Write a program that dipplays either an aicending or desocnding sequence of integers based on user input values with one number froen the sequence

image text in transcribed
image text in transcribed
a) Write a program that dipplays either an aicending or desocnding sequence of integers based on user input values with one number froen the sequence miseing. The program must atisfy the following criteria: - Your program "L4Qlimitioly py" must start with a commenied academic integrity pledge, ID Bax, and program purpose. - Your program should: (Refer to the scrovevbotifor a vimal uninceded) (a) Prompt the user for an integer between 1 and 10 inelusive to act as a step. Frror check the step by f cpeatedly asking the usar to re-criter an integer until it is within the rcyuired range using a loop. (b) Prompt the mer for a counting dirvetion (U) for ap, D for down) cnsuring the input is case insensitive. Erroc check ihis value by rspcatedly asking the user to reenter the value until it is aceeptahle maing a hoop. (c) Display the question "What is the mising nember? (d) Use one or more loops so diyplay the appropriate sequence based on the user inpots. The sequence will reflect the step sales provided counting in the direction indicated. Follow the gaide lines below: Hint. Fach loop iteration should diriplay cne value cnding with a space so ultimately all sequence values are space separated on the same line. (c) The answer for every sequenee is the number 1. Avk the uier whether or not to dasplay the answer and respond aceordingly. It is not nesessary to etror check this input. Fasure the input is case insersitre. (f) Replicate the sample oiffut provided as clonely as possible inchuding the blank lines, the wording used, and the worling placement. (g) Although one or more space characters must separate sequence elements (as shown), the exact number (i.e. whether you use 1, 2, or more space characters) will not impact the correctness of your solution. - The screenshots provided demonstrate how your program should work given the specific input values shown. Other input values would produce different results. b) Save your program as "L4Q1initials.py" replacing initials with your actual initials. c) Submit your file electronically for marking (unless otherwise instructed)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions