Question

USING PYTHON. please print screen it working (input and output)! Create a program for the following:...

USING PYTHON. please print screen it working (input and output)!

Create a program for the following:

Orlando International Airport is creating an app that allows a passenger to check on the availability of flights in 2020. As a first test, a user may check on flights to either Albany or Austin. To get into the app, the user must enter an account number, which must be between 1500 and 9999. The user should then be asked to enter 1 for Albany and 2 for Austin. Then asked to enter a month number, which has to be between 1 and 12, a day number, which has to be 1 to 31 for January, etc. Finally asked to enter the number of passengers, which must be between 1 and 8. The interaction and output should look like:

Enter ur act number: 1234

Enter ur location (press 1 for Albany or 2 for Austin): 1

Enter month of travel: 2

Enter day of travel: 23

Enter # of passengers: 2

You have requested the flight info for flights to Albany on 2/23/20 for 2 people. This info will be emailed to the address in act number 1234.

*If the answered given by the person don't meet the right standards, then the user will need to be redirected to correct them (using the loop).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Note: This program has been written in python3.

Code:

* -/Desktopterno.py. 1 The places user can select 2 places [Albany, Austin (functions), +, #, , 4 | # Letting the user know the range for the values they should be entered 5 print(Account number must be between 1500 to 9999) 6 print(Month should be between 1 to 12 7print(Day nust be between 1 to 31) 8 print(Number of passengers must be between 1 to 8 10 # This infinite Loop breaks only when all of the values are in range 11 while True: 12 13 14 15 16 17 18 19 20 21 # Reading the act number from the user act number int input(Enter your account number: )) # If given account number is not in range if not (1500 act_numberc 9999): print(Invalid account number. Loop is started again from the top continue # Reading Location fron the user Locationintinput (Enter your location(press 1 for Albany or 2 for Austin):)) 23 25 26 # If the location is not 1 or 2 if not (location1 or location2): print(Invalid location.) 28 29 38 Loop is started again from the top continue # Reading month of travel from the user nonth intlinput(Enter month of travel: )) 32 # If the month is not in range if not (1 monthc 12): 35 ▼ 36 37 38 39 print(Invalid month.) Loop is started again from the top continue # Enter day of travel dayint (input(Enter day of travel:)) 41 42 43 # If day of travel is not in range if day 31 or daycl: print(Invalid day 45 46 47 Loop is started again from the top continue 49 58 # If day is 29, then the month should be 2 elif day29: If month is not 2 if not month2: print(Invalid day.) # Loop is started again from the top continue 53 56 # If day is 30, then month should be one of the number in (4,6,9,11) L: 39 C: 5 Python, Unicode (UTF-8) , Unix (LF), ㎡, Saved: 06/12/18, 7:14:29 PM 2,814 / 481 / 88 100%,

Sample Output:

Add a comment
Know the answer?
Add Answer to:
USING PYTHON. please print screen it working (input and output)! Create a program for the following:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need the pseudocode and python for the four attached problems: 1. (Chapter 5 - For...

    I need the pseudocode and python for the four attached problems: 1. (Chapter 5 - For Loop) Logic Technical College has a current tuition of $10,000 per year. Tuition is scheduled to increase by 5% each year. Using a FOR loop, design a program that calculates and displays the tuition each year for the next ten years, like so: The tuition for year 1 will be: 10500.00 The tuition for year 2 will be: 11025.00 ……….. (You, of course will...

  • Please answere using python language codes. Write a program to print out Collatz sequence for a...

    Please answere using python language codes. Write a program to print out Collatz sequence for a user-supplied number. Prompt the user for a positive integer which will become the first number in the sequence. Next number in the sequence is derived as follows: If previous number is odd, the next number is 3 times the previous, plus 1. If previous number is even, the next number is half of the previous According to Collatz proposition, the sequence ultimately reaches 1...

  • You are to write a program (BookExceptionsDemo.java) that will create and, using user input, populate an...

    You are to write a program (BookExceptionsDemo.java) that will create and, using user input, populate an array of instances of the class Book. The class Book is loaded in our Canvas files: Book.java The user will enter a number n (n must be > 0, trap the user until they input a valid value for n), Your program will declare and create an array of size n of instances of the class Book. The user will be asked to enter...

  • java program: Write a program which displays the following list on the screen and asks the...

    java program: Write a program which displays the following list on the screen and asks the user to enter either 1 or 2 and perform one of the operations based on the user’s input. If the user enters any other character other than 1 or 2 then display “wrong choice”. LIST OF OPERATIONS 1. Buzz Number                      2. Consecutive Odd numbers Note: A BUZZ number is a number which either ends with 7 or is divisible by 7. Sample input 27...

  • Must be done in python and using linux mint Write a program to create a text...

    Must be done in python and using linux mint Write a program to create a text file which contains a sequence of test scores. Each score will be between 0 and 100 inclusive. There will be one value per line, with no additional text in the file. Stop adding information to the file when the user enters -1 The program will first ask for a file name and then the scores. Use a sentinel of -1 to indicate the user...

  • USING PYTHON PLEASE Write a program that calculates the factorial value of a number entered by...

    USING PYTHON PLEASE Write a program that calculates the factorial value of a number entered by the user. Remember that x! =x* (x-1)* (x-2)*... *3+ 2* 1. Your program should check the value input by the user to ensure it is valid (i.e., that it is a number > =1). To do this, consider looking at the is digit() function available in Python. If the user enters an incorrect input, your program should continue to ask them to enter a...

  • Python. Please attach python file if possible. All Instructions given: General The program must allow a...

    Python. Please attach python file if possible. All Instructions given: General The program must allow a trader to enter in stock's symbol, its current price, and a lucky number (see the validation rules for these inputs below). The program then outputs a recommendation to either buy, sell, or hold the stock. The recommendation is based on whether the current stock price is above, below, or equal to a particular threshold value specific to that stock (see more on the threshold...

  • Please use Python Exercise 1 Create a program named sentinel_loop using break. This program should implement...

    Please use Python Exercise 1 Create a program named sentinel_loop using break. This program should implement functionality that is the same as the Part 1 tutorial example, except for the following differences: • • This program should count even and odd integers. This program should report counts of even and odd integers. Remember that even integers can be identified using the test condition: value % 2 == 0 Remember to test your code for appropriate behavior when the user signals...

  • please solve using python thank you! Write a program which prompts the user to enter a...

    please solve using python thank you! Write a program which prompts the user to enter a number of rows, and prints a hollow square star pattern with 2 diagonals. Note: you can assume that the integer will always be > 1 and will be an odd number. For example: Input Result 5 Enter number of rows: 5 ***** ** ** * * * ** ** ***** 9 Enter number of rows: 9 ** ** ** * * * * *...

  • Topics: list, file input/output (Python) You will write a program that allows the user to read...

    Topics: list, file input/output (Python) You will write a program that allows the user to read grade data from a text file, view computed statistical values based on the data, and to save the computed statistics to a text file. You will use a list to store the data read in, and for computing the statistics. You must use functions. The data: The user has the option to load a data file. The data consists of integer values representing student...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT