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 program that will ask the user to input the names

Write a program that will ask the user to input the names of cities they would like to visit.

  Create a program that calculates the estimated hours

Create a program that calculates the estimated hours and minutes for a trip. This should include an estimated date/time of departure and an estimated.

  The dictionary order based on the ascii order

Needless to say, the dictionary order based on the ASCII order is not what a real-world indexing software wants. So, we want to implement the dictionary order of strings in the standard wa

  Find the number of vowels in the string

Using list and one definition for find the Number of vowels in the String.

  Construction of the data dictionary

A first systematic step to a data science process, as we have learned from the lectures and practical sessions, is to construct a data dictionary for the dataset.

  Problem on the interactive execution

Interactive Execution. Start the Python interactive interpreter. You can invoke it by typing in its full pathname or just its name (python or python.exe).

  Find a python script

Find a python script

  Create a python program that allows user enter class name

Create a Python program that allows user enter class name, faculty name, name of each student, and letter grade each student earned.

  Make a python program that print a result of entered formula

Make a python program that print a result of entered formula which is consisted of 3 operators and 4 operands (example formula: 4*2-100/2).

  Write python script that reads child mortality data

ICT702 Task - Theme: Child Mortality.In this first part of Task, you should write a Python script that reads and analyses the child mortality data file

  Recursive sorts are easier to write in functional style

Recursive sorts are easier to write in functional style than others. Two recursive sorts are  Quicksort and Mergesort. Write functional versions of (a) Quicksort; (b) Mergesort in an  imperative language of your choice (e.g., C, Ada, C++, Python), us..

  What is complexity in asymptotic notation of your solution

Write a program in Python to draw the following figure: What is the complexity in asymptotic notation of your solution? Return the "centered" average of an array of ints, which we'll say is the mean average of the values.

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