Time to finish first stack program

Slides:



Advertisements
Similar presentations
Mini-Pascal Compiling Mini-Pascal (MPC) language
Advertisements

CS 206 Introduction to Computer Science II 10 / 28 / 2009 Instructor: Michael Eckmann.
Chapter 5: Data Input and Output Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Computer Programming Skills
MS Access. Access is a DBMS/RDMS DBMS = Database Management System RDMS = Relational Database Management System.
Sha Tin Methodist College F.4 Computer Studies Pascal Programming.
Pascal Programming Written by Leung King Yung. Simple Program 1 begin end.
End of unit assessment Challenge 1 & 2. Course summary So far in this course you have learnt about and used: Syntax Output to screen (PRINT) Variables.
Coding Time This is a starter activity and should take about 10 minutes [ slide 1 ] 1.Log in to your computer 2.Open IDLE 3.Start a script session (Select.
Computer Science 1 How do you store a bunch of similar stuff?
Higher Computing Science 2016 Prelim Revision. Topics to revise Computational Constructs parameter passing (value and reference, formal and actual) sub-programs/routines,
Update Critical Elements - Employee 2. “Open your current Performance Plan by selecting ‘Update’ from the ‘Action’ drop down menu and select the ‘Go’ button.
Computer Science 2 Arrays of Records. First Record Program Input an unknown number of Team Names, School names, and Total scores. (While loop) –Output:
BCA II Data Structure Using C
Fundamentals of Java: AP Computer Science Essentials, 4th Edition
Written by Al.So. Software solutions
Prof. Carolina Ruiz Department of Computer Science
Program options Write a program for one of the following
Computer Science Dynamics.
Computer Science 2 Outline/Learning Objectives for the day:
Computer Science Procedures
How do you store a bunch of similar stuff?
Computer Science II First With files.
Computer Science II First With files.
CSCI The UNIX System Shell History and Directory Stacks
Computer Science 2 Arrays of Records.
Computer Science 1 Get out your notebook
Continue on the Array of Records program
Computer Science 2 Arrays of Records.
Computer Science
Computer Science Dynamics.
Repeat Day2 Dry Run Second Repeat Program
Computer Science Sorting.
Computer Science 1 1/19/2011 On the record (paper) write the following
Computer Science 2: Trees
Computer Science 2 Arrays of Records.
Looping III (do … while statement)
Double click Microsoft Visual Studio 2010 on the Computer Desktop
How do you store a bunch of similar stuff?
Computer Science 2 5/17/2016 Finish the Queue Program
Deleting from a binary tree
Computer Science 2 Tally Arrays 2/4/2016.
CS 2 Records 2/22/2018.
CSCI N207 Data Analysis Using Spreadsheet
How can you make a guessing game?
Computer Science II Second With files.
Continue with Life, Magic and Catch -up
Computer Science 2 More Trees.
Computer Science 1 while
Computer Science 1 For..do loop Dry Run Take notes on the For loop
Deleting from a binary tree
Computer Science
How do you store a bunch of similar stuff?
Welcome Back CS 2 2/4/2013 On the record (paper) write the following
More Trees 5/9/2-017 Be able to dry run a program that uses trees
Computer Science I: Get out your notes.
Continue on the Valentines program
Computer Science 2 Queue.
Computer Science 2 Queue Day 2.
GCSE Computing:: While Loops
Program options Write a program for one of the following
Computer Science 1 Review and finish Number base conversion
10/27/2016 Dry Run 2 Case Programs Fix it Second Case Program
CS 2 2/25/2015 File Exists?.
Computer Science 1 while
Computer Science 1 Get out your notebook
Computer Science 1 Get out your notebook
Computer Science
A bit of Review Review, Dry Run, Program.
Computer Science II First With files.
Prof. Carolina Ruiz Department of Computer Science
Presentation transcript:

Time to finish first stack program Computer Science 2 4/18/2014 Dry Run Time to finish first stack program Second Stack Program

procedure c(var top:ptrtype); var temp:ptrtype; begin temp:=top; program DryRunPointers; type ptrtype = ^rectype; rectype = record score:integer; next:ptrtype; end; var top:ptrtype; count:integer; procedure a(var top:ptrtype;count:integer); temp:ptrtype; begin new(temp); temp^.score:=count; temp^.next:=top; top:=temp; procedure b(top:ptrtype); temp:=top; if top<> nil then repeat writeln(temp^.score); temp:=temp^.next; until (temp=nil) or (temp=top); procedure c(var top:ptrtype); var temp:ptrtype; begin temp:=top; top:=top^.next; dispose(temp); end; procedure d(var top:ptrtype); while temp^.next<> nil do temp:=temp^.next; temp^.next:=top; begin {Of the main body}; top:=nil; for count:= 1 to 4 do a(top,2*count); b(top); c(top); d(top); end.

Online Time to Finish First Stack Program

A VALuable Procedure val(String, RealOrIntegerVariable, IntegerErrorCode); Converts a String into a real or an integer value program test; var error:integer; x:real; number:string; begin writeln('Please enter a number (-1 to quit)'); readln(number); while (number <> '-1') do val(number, x, error); if error = 0 then writeln(x) else writeln('Error !!!'); end; end.

Second Stack Program Hire ‘em, Fire ‘em Write a program to model a human resource department with the following Menu: Hire an employee (Name, Job title, Phone Number) Fire an employee, based solely on seniority Show all employees Push: Save employees to a file Push: Load employees from a file back into the stack.