

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


(There is no lab for Week 12.)
1. Working with a program with Record Structures
Use the new process for opening a Visual Studio project: a. Go to the C: drive and make a folder at the top level with your name or userid, something like: C:\njmccrac b. Open Visual Studio and go to create a new project/solution When this Dialog box opens, i. name: pick a name for the project – something like StudentRecords ii. Use Save All to save the project in the folder on the C drive
c. In this first part, create the form for the program discussed in class.
Making the form: make four Buttons, three Labels and a TextBox on the form that looks something like:
|Read Student Records| Status (label)
|Number| Number of Females (label) Number of Males (label)
|Find Oldest Student| |_______________| (textbox)
|Close|
d. Copy the data file “students.txt” from the web page and save it in the C:\name\StudentRecords\bin\Debug part of the project folder.
Click on the buttons to write the program. Use the program given in class, possibly renaming Labels or TextBoxes. This program contains code for all four of the buttons on the form. Be sure to check that the label names are in the code match yours on the form.
Test this program.
f. Now we are going to add two things to the program.
First, we are going to add a field to the student record structure. For every student, we also want to have the grade point average. Open the data file, “students.txt” in Notepad, and on every line add a comma and a GPA number. For example, line 1 could be:
Alex, M, 20, 73, 3.
In the program, find the declaration of the Structure called studentrec, add a field to the structure by adding a variable declaration. Specifically, after the other variables (name, gender, age, height), add a declaration something like
Dim gpa as Single
Then under Button1, add an Input statement to the while loop that will read the GPA variable for every student.
The second thing to add is to modify the button that displays the oldest student. Currently, it only displays the name of the student. Change the TextBox1.Text so that it also displays the GPA of the student.
Test your program.
Print your modified students.txt file and your StudentRecords program. Hand in these two sheets with the rest of the lab on Wednesday.
***************** At the end of lab ********************
Go to the C: drive where you put your folder with your name. Copy and paste the entire StudentRecords folder to the H: drive under your IST256 projects.
*************** Don’t forget to save your work! ****************