Pseudocode
Pseudocode is a technique that uses English-like statements to portray the sequence of steps involved in a program. Pseudocode is used when planning the solution to a problem.
§ We use words like Get, Input, Accept or Read to represent receiving information from some external source (the user, a file)
Get FirstName from TextBox
Input Year from TextBox
§ We use words like Print, Output, Write or Display to represent reporting information on a screen, printer or file.
Print “Name is”, FirstName on screen
Display Name is”, FirstName in label
Output EmployeeInformation to Printer
§ We can use words like Calculate or Compute along with arithmetic symbols (* / + - etc.) to do arithmetic.
Compute OvertimeHours = Hours – 40
Calculate GrossPay = Hours * PayRate
§ We can also use words like Add, Subtract, Multiply, Divide, etc. to do arithmetic.
Add Hours To TotalHours
Subtract FICAAmount from GrossPay
When assigning values to variables we are doing one of 4 things
1. Inputting value from external source (covered above).
2. Store the result of a calculation (also covered above).
3. Initializing, Reinitializing can be indicate by Let or initialize or reinitialize
· Initializing means placing a beginning value in a variable
Let the FICARate = .0768
Initialize StateTax Rate to .03
Initialize TotalHours = 0
· Reinitializing means replacing the initial value in a variable after it might have been alter by code.
Let EmployeeDeductions = 0
Reinitialize OvertimeHours to 0
1. Save a value for later use. To indicate storing a value for later use we can use words like Store, Save, Hold.
Store the DepartmentNumber in a Department # Hold Field
Save Sales Amount in CurrentHighSaleAmt