Download presentation
Presentation is loading. Please wait.
1
Pseudo Code
2
What is pseudocode? An artificial and informal language that helps programmers develop algorithms Pseudocode is text based – Plain English The purpose is to elaborate on the algorithmic detail and not just cite an abstraction
3
What is an algorithm? A procedure for solving a problem in terms of the actions to be executed and the order in which those actions are to be executed A sequence of steps executed to solve the problem
4
Problem #1 Write the pseudo code such that a program prints “Passed” when a student’s grade is passing and “Failed” when the student’s grade is not passing
5
Problem #1 Solution Ask the user to enter a grade
If the grade is equal or greater than 70 print “passed” Otherwise, if the grade is less than 70 print “failed”
6
Problem #2 Write the pseudocode for going to Torchy’s Tacos and ordering and eating a ‘Trailer Park’ taco and a coke.
7
Problem #2 Solution Enter Torchy’s Taco
Order a Trailer Park taco and a coke Pay for order Wait for order When called, receive order Sit at table While still hungry, take bite of taco If thirsty take drink of coke When finished Throw away trash Exit
8
Problem #3 Average the grades of 10 students and print the average
9
Problem #3 Solution Set total to 0 Set the number of students to 10
Set the gradeCounter to 0 Ask the user to enter 10 grades While gradeCounter is less than or equal to numberOfStudents, ask the user to enter a grade. input all grades and add each grade to the total When finished retriving the grades, set the classAverage to the total divided by the numberOfStudents Print the class average Exit
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.