Free Essay

Intro to Programming Pizza Pi Iii Pseudo Code

In: Computers and Technology

Submitted By elizamoreau
Words 341
Pages 2
* Declarations * Constants are needed for * The minimum size a user can enter * 12 * The maximum size a user can enter * 36 * The # of slices in a small pizza * 8 * The # of slices in a medium pizza * 12 * The # of slices in a large pizza * 16 * The # of slices in an extra-large pizza * 24 * Variables are needed for * A Boolean for whether or not the program should exit, set to false by default * A Boolean for whether or not the input passed validation, set to false by default * A String for what the user inputs * An Integer for what the pizza’s diameter is, assuming it passes validation * Input * Ask the user for input and then read it * If the user input is the number 0, the exit variable is set to true and the loop is broken * Check if the input is valid, to be valid it must meet these parameters * Input must be above the number 12 * Input must be below the number 36 * Input must be a number * If the input is not between 12 and 36, tell the user and loop back to the initial prompt * If the input is not between a number, tell the user and loop back to the initial prompt * If validation is passed, the validation variable is set to true and the loop is ended * Processing and Output * If the validation variable is true and the exit variable is false determine the number of pizza slices * Diameters of 12” up to and including 20” can only be cut in eight slices. * Diameters larger than 20” up to and including 24” can be cut into a maximum of 12 slices. * Diameters larger than 24” up to and including 30” can be cut into a maximum of 16 slices. * Diameters larger than 30” can be cut into a maximum of 24 slices * When the number of slices are outputted, the program loops back to the start * If validation is false and the exit variable is true, the primary loop ends and the program exits

Similar Documents

Free Essay

Intro to Programming

...a value. 18. Defense programming: A practice of anticipating errors that can happen while a program is r unning, and designing the program to avoid those errors. 19. Error trap: A validation loop is also known as an error trap. 20. Input Validation: The process of validating the data that is entered as input. 21. Output file: A file that is written to. It is called an output file because the program stores out-put in it. 22. Input file: A file that data is read from. It is called an input file because the program gets input from the file. 23. Processing a file: When data is either written to the file or read from the file. 24. Text file: A file that contains text. 25. Sequential access: Sequential access means that data is read from the beginning of a file to the end. And to access data anywhere in that file must be read from the beginning to the point where the desired data. 26. Direct access: Also known as random access means you can go directly to any piece of data in a file without having to read from the beginning of that file. 27. Filename extension: A short sequence of characters that appear at the end of a filename. (.txt, .jpg, .doc). The extension indicates the type of data stored in the file. For example .doc is for MS Words document. 28. Flow chart rectangle symbol: A flowchart rectangle shows a process, action, or task. 29. File append mode: The file append mode in programming means you can if you......

Words: 834 - Pages: 4

Premium Essay

Pseudo-Code Structure

...Pseudo-code is an informal high-level description of the operating principle of a computer program or other algorithm. It uses the structural conventions of a programming language, but is intended for human reading rather than machine reading. Pseudo-code typically omits details that are not essential for human understanding of the algorithm. The programming language is augmented with natural language description details, were convenient, or with compact mathematical notation. The purpose of using pseudo-code is that it is easier for people to understand than conventional programming language code, and that it is an efficient and environment-independent description of the key principles of an algorithm. Pseudo-code resembles, but should not be confused with skeleton programs, including dummy code, which can be complied without errors. Flowcharts and Unified modeling Language charts can be thought of as a graphical alternative to pseudo-code, but are more spacious on paper. A sequence structure is represented in pseudo-code as a line of instruction. A pseudo-code statement representing sequence would typically contain text very similar to what is found within the rectangle of the flowchart. The sequence control structure simply lists the lines of pseudo-code. The concern is not with the sequence category but with selection and two of the iteration control structures. A good example is; if age greater than 17, display a massage indicating you can vote else display a message......

Words: 765 - Pages: 4

Premium Essay

Domino’s Pizza: Health Code Standards Crisis

...Domino’s pizza: Health code standards crisis 1) Short background about the company: Domino's Pizza is an American restaurant chain and international franchise pizza delivery corporation headquartered at the Domino Farms Office Park campus in Ann Arbor Township, Michigan United States, near Ann Arbor, Michigan. Founded in 1960, Domino's is the second-largest pizza chain in the United States (after Pizza Hut) and the largest worldwide, with more than 10,000 corporate and franchised stores in 70 countries. Domino's Pizza was sold to Bain Capital in 1998 and went public in 2004. Domino’s Pizza offers customers a full menu to choose from, including four types of pizza crust (thin, hand-tossed, deep dish and Italian Style), Domino’s Specialty Pizzas and delicious side items Cheesy Bread, Bread sticks, Chicken Wings, Chicken kickers, Crunchy Chocolate Calzone, CinnaStix, Chocolate Souffle and Pepsi products. | 2) The problem faced: Two employees posted YouTube videos of themselves engaging in a number of public health law violations: putting cheese in the nose, blowing mucous on a sandwich and putting a sponge, used to wash dishes, between the buttocks. The woman holding the camera was saying: "In about five minutes, they'll be sent out to delivery, where somebody will be eating these, yes, eating them. And little did they know that cheese was in his nose and that there was some lethal gas that ended up on their salami,” "That's how we roll at Domino's." The videos went......

Words: 1361 - Pages: 6

Premium Essay

Intro to Programming

...Intro to programming final study guide 1. Name the components of a computer: CPU, RAM, Secondary storage devices, Input devices, Output devices 2. What does a disk drive do? A disk drive stores data by magnetically encoding it onto a circular disk. 3. What is the largest value that can be stored in a bit? 255 4. What is ASCII? ASCII is the American Standard Code for Information Interchange which is a set of 128 numeric codes that represent the English letters, various punctuation marks, and other characters 5. What is machine language? Machine language is written in 1s and 0s and known as binary. 6. How does a computer execute instructions? The computer uses the fetch-decode-execute cycle. 7. What is assembly language? Assembly language uses short words that are known as mnemonics instead of binary. 8. What is syntax? Syntax is a set of rules that must be strictly followed when writing a program. 9. What is an interpreter? An interpreter is a program that both translates and executes the instructions in a high level language program 10. What is a logic error? A logic error is a mistake that does not prevent the program from running, but causes it to produce incorrect results. 11. What is an algorithm? An algorithm is a set of well defined logical steps that must be taken to perform a task. 12. What is Pseudocode? Pseudocode is fake code. 13. What are the symbols used in a flowchart? The Ovals which are called terminal symbols that start and stop something,......

Words: 771 - Pages: 4

Free Essay

Intro to Programming

...Individual Project Professor IT106-1401A-05: Introduction to Programming Logic Contents Phase 1 3 Deposit 3 Transfer 3 Phase 2 4 Problem Analysis Chart 4 Inquiry 4 Deposit 4 Transfer 4 Structure Chart 4 IPO 4 Inquiry 4 Deposit 4 Transfer 4 Coupling Diagram 4 Data Dictionary 4 Phase 3 5 Inquiry 5 Flowchart 5 Pseudocode 5 Deposit 5 Flowchart 5 Pseudocode 5 Transfer 5 Flowchart 5 Pseudocode 5 Phase 4 6 Flowchart 6 Pseudocode 6 Phase 5 7 Inquiry 7 Deposit 7 Transfer 7 Phase 1 Part 2: Determine current amount available in checking account (balanceChecking)-$50.00 Determine what the transfer amount will be (transferAmount)-$25.00 Retrieve the transaction number for confirmation (transactionNumber)-54643635345 Phase 2 Problem Analysis Chart Given Data | Required Results | Account number and PIN | Account Balance | Processing Required | Solution Alternatives | 1. Access banking systems to retrieve data 2. Provide to customer | 1. Have an automated system that emails balance info as opposed to displaying it. | Structure Chart Account information | VerifyInfo | Provide info | AccessInfo | Locate Retrieve PIN Display Info IPO Input | Processing | Module Reference | Output | Account numberWhich......

Words: 315 - Pages: 2

Premium Essay

Reasons Why Managers Need to Be Acquainted with Programming, Web Source Code, and Technology.

...In some situations a manager should be familiar with programming. I think it really depends on what’s being managed. If you are a manager of a software company, then you should know how to code and have a programming background. Depending on the size of his or her department, a manager will spend time between coding and doing things that those who code cannot do. A manager who is good at coding, may not necessarily be good at managing projects. The best project managers do not have to understand all of the technical jargon and syntax of a programming language but rather be aware of simple programming concepts such as input/output, decision-making, repetition, and file handling. (Ebrahimi, 2005) A good manager can be in situations where they are not the expert; thus, they rely on experts who know much more (Berkun, 2010). It is important for a manager to understand the context of the problem or situation in order to help make a good decision. In this day and age, it is also important for a manager to be knowledgeable about his or her company’s web presence. The web is a platform that most if not every business should strive to maintain (Ebrahimi, 2005). A manager may wish to be involved with such things as creating web content and marketing. Knowledge of how database and source code relate can help a manager understand the job responsibilities of the business’s web development department. With this information, he or she might be more realistic about deadlines......

Words: 490 - Pages: 2

Premium Essay

Intro to Programming Unit 1 Research Assignment

... Niklaus Wirth. The specific motivation behind this language was to encourage good programming practice using structured programming and data structuring. 2) SQL (Structured Query Language) designed by, Donald D. Chamberlin, and Raymond F. Boyce. The motivation behind this language was designed for managing data held in a relational database management system. ( RDBMS) 3) C, Designed by Dennis Ritchie. the motivation behind this language is structured programming and allows lexical variable scope and recursion. 4) Applesoft BASIC, developed by Marc McDonald, and Ric Weiland. The motivation with this language was it was designed to be backwards-compatible with integer BASIC and used the core of Microsoft’s 6502 BASIC implementation. 5) GRASS, Developed by Thomas A. DeFanti. GRASS is similar to BASIC in sytax, but added numerous instructions for specifying 2D object animation, including scaling, translation, rotation and color changes over time. 1980’s 1) BASICA, Designed by Thomas E. Kurtz. Designed to offer support for the graphics and sound hardware of the IBM PC line. 2) Turbo Pascal, developed by Borland, under Philippe Kahn’s leadership. This is a software development system that includes a compiler and an integrated development environment for the Pascal programming language. 3) C++, designed by Bjarne Stroustrup. This is a general purpose programming language that is free-form and compiled. It is regarded as an intermediate-level......

Words: 677 - Pages: 3

Free Essay

Pseudo Code

...Pseudocode: An Introduction Flowcharts were the first design tool to be widely used, but unfortunately they do not very well reflect some of the concepts of structured programming. Pseudocode, on the other hand, is a newer tool and has features that make it more reflective of the structured concepts. Unfortunately, the narrative presentation is not as easy to understand and follow. RULES FOR PSEUDOCODE 1. Write only one stmt per line Each stmt in your pseudocode should express just one action for the computer. If the task list is properly drawn, then in most cases each task will correspond to one line of pseudocode. EX: TASK LIST: Read name, hourly rate, hours worked, deduction rate Perform calculations gross = hourlyRate * hoursWorked deduction = grossPay * deductionRate net pay = grossPay – deduction Write name, gross, deduction, net pay PSEUDOCODE: READ name, hourlyRate, hoursWorked, deductionRate grossPay = hourlyRate * hoursWorked deduction = grossPay * deductionRate netPay = grossPay – deduction WRITE name, grossPay, deduction, netPay 2. Capitalize initial keyword In the example above, READ and WRITE are in caps. There are just a few keywords we will use: READ, WRITE, IF, ELSE, ENDIF, WHILE, ENDWHILE, REPEAT, UNTIL 3. Indent to show hierarchy We will use a particular indentation pattern in each of the design structures: SEQUENCE:    keep  statements  that  are  “stacked”  in  sequence  all  starting  in  the   same column. SELECTION: indent the......

Words: 1559 - Pages: 7

Free Essay

Unit 5 Research Paper for Intro to Programming

...NT 1310 | October 16 2014 | Phillip Wilson | Mr. Covington | A shell script is just a text file full of commands. It must be executable. A shell script is also a computer program designed to be run by the Unix shell, a command line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text. Writing a shell script is much quicker than writing the equivalent code in other programming languages. The many advantages include easy program or file selection, quick start, and interactive debugging. A shell script can be used to provide sequencing and decision-making linkage around existing programs, and for moderately-sized scripts the absence of a compilation step is an advantage. Interpretive running makes it easy to write debugging code into a script and rerun it to detect and fix bugs. Non-expert users can use scripting to tailor the behavior of programs, and shell scripting provides some limited scope for multiprocessing. Most common usage methods of PowerShell are interactive console (powershell.exe) and script files (with extension of .ps1 that is also usually executed by powershell.exe). Main features of PowerShell are: .Net integration, object pipeline, easy access to many management domains (WMI, ADSI, COM, .NET etc.) and standardization that brings easy discovery and quick learning of new features after you know base......

Words: 311 - Pages: 2

Free Essay

Gd-Pi

...Hundreds(of(real(personal(accounts(of Group'Discussions'&'Personal'Interviews during(MBA(admissions(to(India’s(best(B9schools Written'by Compiled'by Loads'of'MBA'Aspirants The'PaGaLGuY'MadCapz'Group PaGaLGuY.com Antholo gy Hundreds of real personal accounts of Group Discussions and Personal Interviews during MBA admissions to India’s best business schools. In this edition: The IIMs at Ahmedabad, Bangalore, Calcutta, Lucknow, Indore & Kozhikode. Written by Loads of MBA aspirants Compiled by The PaGaLGuY MadCapz Team PaGaLGuY GD-PI Anthology Copyright © 2011, PaGaLGuY.com All text and content in this document is solely owned by PaGaLGuY.com. Reproduction without permission in any form or means is illegal. Special copy prepared exclusively for mustafa rokerya Get your own Free personalized copy (with your name on it) of this book from http://www.pagalguy.com/books/ What this book is about What is a real IIM interview like? What kind of questions do they ask and what judgments do applicants have to make while answering them? Since 2003, those with real Group Discussion and Personal Interview calls from India’s top bschools have been posting entire and detailed transcripts of their admission interviews immediately after they happen, so that others slotted for later interviews can learn what GDPI is going to be like this year. This book is a collection of dozens of handpicked GDPI experiences from the country’s top bschools during the......

Words: 178933 - Pages: 716

Premium Essay

Intro to Programming Usin Java

...Introduction to Programming Using Java Course Specifications Course length: 1.0 day(s) Course Description Course Objective: You will learn the basic concepts of programming using Java as the tool for learning. Target Student: This course is intended for students with no prior academic background in a field other than computer science or programming, who wish to embark on a course of study that will prepare them for employment as professional software developers. Students who interact on a business basis with software development professionals and need to improve communication through better understanding of the concepts and terminology used by professional programmers will also benefit equally. Prerequisites: Students should be familiar with using personal computers with a mouse and keyboard. Basic typing skills are mandatory. Students should be comfortable in the use of the Windows 2000, Windows XP, Windows Vista environment, or Windows 7 environment. To ensure your success in this course, we recommend that you take the following Element K courses or have equivalent experience: Microsoft Windows Vista: Level 1Microsoft Windows XP Professional: Level 1 Course Objectives Upon successful completion of this course, students will be able to: · explore various programming concepts. · create simple programs. · use methods to define the behavior of classes. · implement the object-oriented methodology. · handle errors in a program. Course Content Lesson 1:......

Words: 323 - Pages: 2

Free Essay

Intro to Programming

...actions implemented to meet policy objectives. They lead to three categories of representation. • Simple trends in absolute values such as of catch • Qualitative and quantitative changes in infrastructure/institutional arrangements which affect management outcomes, such as changes in access right systems or degree or participation • Trends in relative values (not between the absolute value and its related reference points.  Describe the usefulness of properly commenting code: Commenting involves placing Human Readable Descriptions inside of computer programs detailing what the code is doing. Proper use of commenting can make code maintenance much easier, as well as helping make finding bugs faster. Commenting is important when writing functions that other people will use. All programs should be commented in such a manner as to easily describe the purpose of code and any algorithms used to accomplish the purpose. A user should be able to utilize a previously written program without having to look at the code, but by simply reading the comments. Assignment Requirements Answer:  Short Answer 5 and 6 on page 71 5. What two things must you normally specify in a variable declaration? You must specify the variable type and identifier 6. What value is stored in uninitialized variables? Languages assign a default value such as 0 to uninitialized variables. Although many languages with uninitialized variables will hold unpredictable values.  Algorithm......

Words: 747 - Pages: 3

Free Essay

Research Assignment 3 Intro to Programming Logic and Design

...method and technological development. The process of taking something apart and revealing the way in which it works is often an effective way to learn how to build a technology or make improvements to it. When reverse engineering software, researchers are able to examine the strength of systems and identify their weaknesses in terms of performance, security, and interoperability. The reverse engineering process allows researchers to understand both how a program works and also what aspects of the program contribute to its not working. • What are the advantages and disadvantages of using reverse engineering to discover the logics of a software program? Reverse engineering in software is reversing a program's machine code back into it's original source code. The advantages to using this technique is that one can repair certain bugs, see how a program operates, and improve the operation              of the program. The disadvantage is that certain other bugs may be introduced              during this process. • Find any one tool available to perform reverse engineering of software programs. What are at least five features of that tool?   REC Studio 4 - Reverse Engineering Compiler Multihost: Rec Studio runs on Windows XP/Vista/7, Ubuntu Linux, Mac OS X. Symbolic information support using Dwarf 2 and partial recognition of Microsoft's PDB format. C++ is partially recognized: mangled names generated by gcc are demangled, as well as inheritance described in dwarf2......

Words: 301 - Pages: 2

Free Essay

Intro to Programming

...Unit 3: Lab 3.1 Course Intro to programming Instructor : Sindar Lab 3.1 Lab 3.1 Step 1 Identify potential problems. Variable Name Problem Yes/No if yes, what’s wrong? Declare Real credits Taken No Declare Int cedits Left Yes We need to be able to use decimal as well. Declare Real studentName No Constant Real creditsNeeded=90 No Step 2 What’s wrong with this calculation Set credits-Left = credits-Taken – credits-Needed It should be: Set credits-Left = credits-Needed – credits-Taken Step 3 Write the exact output you would expect from the following code if the user of the program enters “John Brown”. Display “The student’s name is “, studentName Output will be “The student’s name is, John Brown Step 4 Write the exact output from the following line of code if user of the program enters John Brown and they have taken 20 credits so far. Display “The Network Systems Administration degree is awarded after 90 credits and “, studentName, “ has “, creditsLeft, “ left to take before graduation.” Output “ The Network Systems Administration degree is awarded after 90 credits and John Brown has 70 left to take before graduation. Step 5 1. //Provide documentation on line 2 of what this program does 2. //This program displays student information and degree program information 3. //Declare variables on lines 4, 5, 6, and 7 4. //Declare Real studentName 5. //Declare Real...

Words: 300 - Pages: 2

Premium Essay

Intro to Programming Chapter Three Homework

...1. Structured programs use spaghetti code logic.   | a.  | True |   | b.  | False | | | | 2. In a selection structure, you perform an action or task, and then you perform the next action in order.   | a.  | True |   | b.  | False | | | | 3. Repetition and sequence are alternate names for a loop structure.   | a.  | True |   | b.  | False | | | | 4. In a structured program, any structure can be nested within another structure.   | a.  | True |   | b.  | False | | | | 5. A structured program must contain a sequence, selection, and loop structure.   | a.  | True |   | b.  | False | | | | 6. Because you may stack and nest structures while retaining the overall structure, it might be difficult to determine whether a flowchart as a whole is structured.   | a.  | True |   | b.  | False | | | | 7. As a general rule, an eof question should always come immediately after an input statement because the end-of-file condition will be detected at input.   | a.  | True |   | b.  | False | | | | 8. Structured programming is sometimes called goto-less programming.   | a.  | True |   | b.  | False | | | | 9. No matter how complicated it is, any set of steps can always be reduced to combinations of the two basic structures of sequence and loop.   | a.  | True |   | b.  | False | | | | 10. The case structure is a variation of the sequence structure and the do loop is a variation of the......

Words: 1129 - Pages: 5