Determine the final order of a stack of pancakes

Assignment Help Python Programming
Reference no: EM132128930

The second task in this assignment is to create a Python program called pancakes.py that will determine the final order of a stack of pancakes after a series of flips.(PYTHON 3)

Problem Task

In this problem, your input will consist of an integer n, followed by some number of other integers. You will create an initial stack of n pancakes, with pancake 1 on top and pancake n on the bottom. Then for each k in the remaining set of integers in the input, you will flip the top k pancakes on the top of the stack.

Hint: try using the Stack ADT in your solution.

Your program must read the input from an input file (see sample input provided for format), and print the final order of pancakes from top to bottom. Your program should ask for the name of the input file when it runs.

Reference no: EM132128930

Questions Cloud

Traditional file systems vs database systems : In this part of the assignment, the student has to debate on whether traditional file systems are better than database system.
Explain how easy it was for you to use the software : Search the internet for 5 open source reporting software packages of your choice?
Discuss the ongoing responsibilities of security manager : What other components of security management, as outlined by this model, can be adapted for use in the security management model?
Accept an arithmetic expression of unsigned integers : Accept an arithmetic expression of unsigned integers in postfix notation and builds the arithmetic expression tree that represents that expression.
Determine the final order of a stack of pancakes : create a Python program called pancakes.py that will determine the final order of a stack of pancakes after a series of flips.(PYTHON 3)
How would you use this command to count the total number : How would you use this command to count the total number of lines in the five files?
What is the value of lst at the end : Suppose the system decides to perform a Mark-and-Sweep Garbage Collection at the end. Which memory cells willbe recycled?
What is the purpose of configuring a default gateway : ICTTEN611- Produce an ICT network architecture design - What is the purpose of configuring a default gateway on an IP-connected host? What happens
Which of the following five statements are propositions : Prove the logical equivalence of conditional statement and contrapositive of two propositional variables using truth table.

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd