This lab accompanies Chapter 2 (pp. 56-68) of Starting Out with Programming Logic & Design.
Name: Rhamses Graterol
Lab 3.1 – Pseudocode
This lab requires you to think about the steps that take place in a program by writing pseudocode. Read the following program prior to completing the lab.
Write a program that will take in basic information from a student, including their name and how many credits they have taken in Network Systems Administration program. The program will then calculate how many credits are needed to graduate. Display should include the student name and the number of credits left to graduate. This should be based off a 90 credit program, where some courses are half credits.
Step 1: This program is most easily solved using just a few variables. Identify potential problems with the following variables declared in the pseudocode. Assume that the college has the ability to offer half credits. (Reference: Variable Names, page 39-40).
Variable Name
Problem (Yes or No)
If Yes, what’s wrong?
Declare Real creditsTaken
No
Declare Int creditsLeft
Yes
Should be Real Numbers
Declare Real studentName
Yes
String
Constant Real credits Needed = 90
No
Step 2: What is wrong with the following calculation? (Reference: Variable Assignment and Calculations, page 43).
Set creditsLeft = creditsTaken – creditsNeeded
Set creditsLeft = creditsNeeded - creditsTaken
Set creditsLeft = 90 - 20
Step 3: Write the exact output you would expect from the following line of code if the user of the program enters “Nolan Owens”. (Reference: Displaying Items, page 40 – 41).
Display “The student’s name is “, studentName
Display “The student’s name is”, Nolan Owens
Step 4: Write the exact output you would expect from the following line of code if the user of the program enters a name of Nolan Owens and they have taken 20 credits so far. (Reference: Displaying Items, page 40 – 41).
Display “The Network Systems