Overview
Structured Data
In 0.4, you learned that an application can save information to a file and read it back later. In this assignment, the file-reading mechanics are already handled for you. Your focus shifts to a different question: How is the information organized?
You will inspect a supplied CSV file, identify its records and fields, connect that structure to UML class and object diagrams, and then use supplied code to load the CSV into a DataGrid. You will trace one representative value from the file into the running application and make one small change to the CSV so you can watch that value flow into the display.
You are not expected to write a CSV parser. The supplied CsvData.cs file exists only so the application can load the data while you focus on its structure.
User Story
As a student exploring course information, I want structured records from a supplied CSV file displayed in the First Day application so that I can see how fields and records in a file become rows, columns, and values in software.
Acceptance Criteria
- Begin from a copy of your completed 0.5 First Day solution
- Preserve the earlier clothing, shopping-list, and weather behavior
- Identify the header, records, fields, and individual values in the supplied CSV
- Connect the CSV structure to a UML class diagram
- Connect one specific CSV record to a UML object diagram
- Add the supplied CSV and CSV-loading infrastructure to the project
- Add the supplied DataGrid controls and event handler
- Use a breakpoint to inspect one representative field after the CSV has been loaded
- Display the structured records as DataGrid rows and fields as columns
- Change one supplied CSV value and verify the corresponding displayed value changes
- Submit the zipped solution through the Feedback System and submit the Feedback System URL to Canvas
Task List
- Get Started From Your 0.5 Solution
- Inspect the Supplied CSV
- Connect the CSV to Class and Object Diagrams
- Add the Structured-Data Files and DataGrid
- Load the Data and Trace One Value
- Change One CSV Value and Follow It
- Final Check and Submit
In 0.4, the main idea was persistence: information could survive after the program closed. In 0.6, the file already exists and the read operation is supplied. The new idea is structure: predictable fields appear in the same order for every record.
The supplied CSV contains fictional sample course records created for this walkthrough. The example codes and titles are instructional data, not official institutional curriculum records.
-
1. Back Up and Open Your Existing First Day Solution
Your First Day solution was renamed to your last name in 0.2. Keep that working name for the rest of the sequence. At the beginning of each module, make a backup of the completed previous checkpoint, then continue working in the original student-named solution.
Step 1 — Make a checkpoint backup
One Working NameThe backup identifies the completed checkpoint. The working solution remains named for you, so later First Day assignments continue in the same project without repeatedly renaming the solution.
Step 2 — Verify the previous checkpoint
- Build or run the solution before making the new 0.6 changes
- Verify the major behavior you completed in 0.5 is still present
- If the previous checkpoint is not working, correct that starting state before adding the new module work
-
2. Inspect the Supplied CSV
A CSV file stores structured information as text. Each line follows a predictable pattern, which lets software recognize fields and records rather than treating the entire file as one undifferentiated block of text.
Step 1 — Open Courses.csv before running any code
Open the supplied Courses.csv file in a plain text editor.
Supplied Courses.csvCourseCode,CourseTitle,Credits EX101,Digital Systems Basics,3 EX205,Web Foundations,2 EX310,Working with Data,3 EX415,Technology and Society,1
The first row names the fields. Each later row is one record containing values for those same fields. Step 2 — Identify the structure
- Identify the header row
- Identify the three field names
- Identify the first complete record
- Identify the value stored in the first record's
CourseTitlefield - Identify how many records appear after the header
Step 3 — Compare with the 0.4 text file
The 0.4 shopping-list file preserved text, but it did not establish a fixed set of named fields for every line. The 0.6 CSV uses the same fields for every record.
Go to topStructured DataFor this file, every course record follows the same structure: CourseCode, CourseTitle, Credits.
-
3. Connect the CSV to Class and Object Diagrams
You have already used UML class diagrams to describe reusable structure and object diagrams to describe one particular instance. A structured CSV provides a useful way to revisit that distinction.
Step 1 — Read the class diagram
The conceptual
CourseRecordclass describes the fields one course record can contain.A class diagram describes the reusable structure shared by the sample course records. Compare the class attributes with the CSV header:
CSV headerCourseCode,CourseTitle,CreditsStructure, Not a Required C# ClassThe UML class diagram is a model of the record structure. You are not required to create a
CourseRecordC# class in this assignment.Step 2 — Read one record as an object
The first CSV record contains actual values. An object diagram can represent those same values as one particular instance.
The class defines the structure; the object represents one particular record using that structure. Step 3 — Connect all three representations
The same structured information can be viewed as CSV fields and records, UML class structure, or one UML object instance. - CSV header field → class attribute
- CSV row → one record/object
- CSV cell value → one value in that record/object
-
4. Add the Structured-Data Files and DataGrid
The parser is supplied because CSV parsing is not the focus of this course. You will add the supplied files, then add a DataGrid so the loaded records have a visible row-and-column representation.
Step 1 — Add the supplied files
- Download Courses.csv
- Download CsvData.cs
- Add both files to the FirstDayScenario project
- Keep the filenames exactly as supplied
Both supplied files belong in the FirstDayScenario project. You do not need to modify CsvData.cs. Do Not Rewrite the CSV LoaderCsvData.cscontains implementation details such as reading lines, separating fields, and building a table. Those mechanics are provided infrastructure. Your task is to observe the structured data produced by that code.Step 2 — Add System.Data
Open
MainWindow.xaml.csand add the following line with the otherusingstatements.MainWindow.xaml.cs — add with the using statementsusing System.Data;Step 3 — Make the growing application scrollable
The First Day application now contains several module demonstrations. Use the supplied outer structure so the window can scroll rather than becoming taller than the screen.
MainWindow.xaml — use this Window/ScrollViewer structure around the existing content<Window x:Class="FirstDayScenario.MainWindow" ... Title="MainWindow" Height="900" Width="650"> <ScrollViewer VerticalScrollBarVisibility="Auto"> <Grid Height="1260"> <!-- Keep the existing First Day controls inside this Grid --> </Grid> </ScrollViewer> </Window>Keep all existing controls inside the inner Grid.
Step 4 — Add the structured-data controls
Place the following StackPanel below the existing weather section.
The structured-data section is a new extension below the existing 0.5 content. MainWindow.xaml — add this structured-data StackPanel<StackPanel HorizontalAlignment="Center" Height="330" Margin="0,795,0,0" VerticalAlignment="Top" Width="560"> <TextBlock Text="Sample Course Data" FontWeight="Bold" Margin="5" /> <Button x:Name="loadCourseDataButton" Content="Load Course Data" Width="360" Margin="5" Click="LoadCourseDataButton_Click" /> <DataGrid x:Name="courseDataGrid" Height="270" Margin="5" AutoGenerateColumns="True" IsReadOnly="True" /> </StackPanel>Move the output area below the new DataGrid.
MainWindow.xaml — replace the textOutput line<TextBox x:Name="textOutput" HorizontalAlignment="Center" Height="90" Margin="0,1140,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="560" BorderThickness="3" BorderBrush="#FFB3B3B4" VerticalScrollBarVisibility="Auto" />Step 5 — Add the supplied button event handler
Add this event handler inside the
MainWindowclass with the other button handlers.MainWindow.xaml.cs — add this event handler/// <summary> /// Loads the supplied sample CSV file and displays its structured records. /// </summary> /// <param name="sender">The object that initiated the event.</param> /// <param name="e">The event arguments for the event.</param> private void LoadCourseDataButton_Click(object sender, RoutedEventArgs e) { DataTable courseData = CsvData.Load("Courses.csv"); string firstCourseTitle = courseData.Rows[0]["CourseTitle"].ToString(); this.courseDataGrid.ItemsSource = courseData.DefaultView; this.textOutput.Text = "First record title: " + firstCourseTitle; }Check Your Work
- Build the solution
- Run the application
- Scroll to the new Sample Course Data section
- Verify Load Course Data and an empty DataGrid are visible
-
5. Load the Data and Trace One Value
The supplied loader reads the CSV and produces structured records for the application. You will pause after that work is complete and follow one easy-to-recognize value.
Step 1 — Set a breakpoint after the load
Set a breakpoint on this line:
Breakpoint linestring firstCourseTitle = courseData.Rows[0]["CourseTitle"].ToString();That line deliberately pulls one field from the first loaded record into a simple string so you can inspect it without learning the CSV parser.
Step 2 — Load the CSV
- Run the application
- Scroll to Sample Course Data
- Click Load Course Data
- When Visual Studio pauses, inspect
courseData - Press F10 once so
firstCourseTitlereceives its value - Inspect
firstCourseTitle
The representative title should match the CourseTitle field in the first CSV record. Step 3 — Predict the DataGrid
- How many columns should appear?
- What should the column names be?
- How many data rows should appear?
- What title should appear in the first row?
Step 4 — Continue and compare
Supplied DataGrid connectionthis.courseDataGrid.ItemsSource = courseData.DefaultView;
CSV fields become DataGrid columns. CSV records become DataGrid rows. Go to topOne Value, Three ViewsYou followed one value through CSV field → loaded application data → DataGrid cell.
-
6. Change One CSV Value and Follow It
The structure will remain exactly the same. Change only one field value and predict where that changed value should appear.
Step 1 — Change the first course title
Change:
Current first recordEX101,Digital Systems Basics,3to:
Revised first recordEX101,Digital Systems Fundamentals,3The complete file should now be:
Courses.csv after the one-value changeCourseCode,CourseTitle,Credits EX101,Digital Systems Fundamentals,3 EX205,Web Foundations,2 EX310,Working with Data,3 EX415,Technology and Society,1Step 2 — Predict before running
- Predict the new value of
firstCourseTitle - Predict which DataGrid cell should change
- Confirm that the field names and number of records did not change
Step 3 — Run the same application again
- Run the application
- Click Load Course Data
- Use the same breakpoint if you want to observe
firstCourseTitleagain - Continue to the DataGrid
- Verify the changed title appears in the first record
Changing one field value changes the corresponding application value without changing the record structure. Go to topWhat Stayed the Same?The fields stayed CourseCode, CourseTitle, Credits. The number of records stayed the same. Only one field value changed. Consistent structure lets the same supplied application code load the revised file without being rewritten.
- Predict the new value of
-
7. Final Check and Submit
Verify the complete 0.6 checkpoint before packaging the solution.
Step 1 — Complete the final technical check
Step 2 — Zip the solution
- Close Visual Studio
- Locate the LastName parent folder that contains the
.slnfile and project folder - Create a ZIP file of the entire solution folder
- Open the ZIP and confirm the solution file, FirstDayScenario project,
Courses.csv,CsvData.cs, and the inheritedWeatherSupport.csare present
Step 3 — Submit to the Feedback System
- Open the Feedback System
- Select the correct First Day 0.6 assignment
- Upload the zipped Visual Studio solution
- Review the Feedback System results and correct any in-scope issues if required
- Resubmit a corrected ZIP when needed
Step 4 — Submit the Feedback System URL to Canvas
- After the required Feedback System submission is ready, copy its URL
- Open the correct 0.6 First Day Assignment in Canvas
- Submit the Feedback System URL as your Canvas submission
Checkpoint SummaryYou inspected structured data before it entered the application, connected the CSV structure to UML class and object representations, used supplied code to load the data, traced a representative field with the debugger, displayed records and fields in a DataGrid, and verified that changing one source value changed the corresponding application value.
© 2026 Northcentral Technical College
Go to top