Step 1
Variable Name
Problem (Yes or No)
If Yes, What’s wrong?
Declare Real creditsTaken
No
Declare Int creditsLeft
Yes
Declare as Double, Int can’t account for half credits
Declare Real studentName
Yes
Needs to be String, not Real.
Constant Real creditsneeded = 90
No
Step 2
The calculation is backwards. Should be Set creditsLeft = creditsNeeded – creditsTaken.
Step 3
The student’s name is Nolan Owens
Step 4
The Network Systems Administration degree is awarded after 90 credits and Nolan Owen has 70 left to take before graduation.
Step 5
1. //Provide documentation on line 2 of what this program does
2. //This program shows how many credits a student needs to graduate
3. //Declare variables on lines 4, 5, 6, and 7
4. Declare Real creditsTaken
5. Declare Double creditsLeft
6. Declare String studentname
7. Declare Constant Real creditsneeded
8. //Ask for user input of studentname and creditsTaken on line 9-12
9. Display “What is the student’s name?”
10. Input studentname
11. Display “How many credits has the student taken?”
12. Input creditsTaken
13. //Calculate remaining credits on line 14
14. Set creditsLeft = creditsNeeded – creditsTaken
15. //Display student name and credits left on line 16 and 17
16. Display “The students name is “, studentName.
17. Display “They have”, creditsLeft, “credits left until graduation”
Lab 3.2
Lab 3.3
Const fiberCost As Double = 0.87 Dim companyName As String = "NO VALUE" Dim numFeet As Double = 0 Dim totalCost As Double = 0
Console.Write("Enter company name: ") companyName = Console.ReadLine() Console.WriteLine()
Console.WriteLine("Number of feet") numFeet = Console.Read()
totalCost = numFeet * fiberCost
Console.WriteLine(companyName & "that's cost per foot") totalCost = Console.ReadLine()
Console.Write("Press enter to continue...") Console.Read()