Anyone Airlines is having a sale on flights leaving from Tampa. Write a program that uses a while loop to store to a file the names of destinations, regular prices, and price reductions (as percents) for selected flights in the promotion. The program should enable the user to enter this data from the keyboard as shown below . Each datum should be stored on its own line in the file. Example Output
Types of Loop
Loops are the elements of programming in which a part of code is repeated a particular number of times. Loop executes the series of statements many times till the conditional statement becomes false.
Loops
Any task which is repeated more than one time is called a loop. Basically, loops can be divided into three types as while, do-while and for loop. There are so many programming languages like C, C++, JAVA, PYTHON, and many more where looping statements can be used for repetitive execution.
While Loop
Loop is a feature in the programming language. It helps us to execute a set of instructions regularly. The block of code executes until some conditions provided within that Loop are true.
Can you please anser the following questions to look exactly like the example pictures attached? The
program6_1.py
Anyone Airlines is having a sale on flights leaving from Tampa. Write a program that uses a while loop to store to a file the names of destinations, regular prices, and price reductions (as percents) for selected flights in the promotion. The program should enable the user to enter this data from the keyboard as shown below . Each datum should be stored on its own line in the file.
Example Output
program6_2.py
This program reads the text file created in the program above and displays its data. Use f-strings to create a table with a row for each item and the columns as shown below. $ signs are not required. Choose your own column widths but include column headings as shown.
Example Output
program6_1.py
Write a program that uses a while loop to store to a file the names of destinations, regular prices, and price reductions (as percents) for selected flights in the promotion. The program should enable the user to enter this data from the keyboard as shown below. Each datum should be stored on its own line in the file.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
How would you create that chart up top with the destination,reg price, reduced and sales price using that same flight_sales text file?