0.6 First Day Assignment

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

Task List

  1. Get Started From Your 0.5 Solution
  2. Inspect the Supplied CSV
  3. Connect the CSV to Class and Object Diagrams
  4. Add the Structured-Data Files and DataGrid
  5. Load the Data and Trace One Value
  6. Change One CSV Value and Follow It
  7. Final Check and Submit
0.4 vs. 0.6

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.

Sample Data

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. 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 Name

    The 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

    1. Build or run the solution before making the new 0.6 changes
    2. Verify the major behavior you completed in 0.5 is still present
    3. If the previous checkpoint is not working, correct that starting state before adding the new module work
    Go to top
  2. 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.csv
    CourseCode,CourseTitle,Credits
    EX101,Digital Systems Basics,3
    EX205,Web Foundations,2
    EX310,Working with Data,3
    EX415,Technology and Society,1
    Screenshot placeholder showing Courses.csv with a header row and four structured sample records
    The first row names the fields. Each later row is one record containing values for those same fields.

    Step 2 — Identify the structure

    1. Identify the header row
    2. Identify the three field names
    3. Identify the first complete record
    4. Identify the value stored in the first record's CourseTitle field
    5. 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.

    Structured Data

    For this file, every course record follows the same structure: CourseCode, CourseTitle, Credits.

    Go to top
  3. 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 CourseRecord class describes the fields one course record can contain.

    UML class diagram for CourseRecord with CourseCode string, CourseTitle string, and Credits int.
    A class diagram describes the reusable structure shared by the sample course records.

    Compare the class attributes with the CSV header:

    CSV header
    CourseCode,CourseTitle,Credits
    Structure, Not a Required C# Class

    The UML class diagram is a model of the record structure. You are not required to create a CourseRecord C# 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.

    UML diagram containing CourseRecord and one firstCourse object with CourseCode EX101, CourseTitle Digital Systems Basics, and Credits 3.
    The class defines the structure; the object represents one particular record using that structure.

    Step 3 — Connect all three representations

    Conceptual UML diagram connecting the CSV header to the CourseRecord class and the first CSV row to the firstCourse object.
    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
    Go to top
  4. 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

    1. Download Courses.csv
    2. Download CsvData.cs
    3. Add both files to the FirstDayScenario project
    4. Keep the filenames exactly as supplied
    Screenshot placeholder showing Courses.csv and CsvData.cs added to the FirstDayScenario project in Solution Explorer
    Both supplied files belong in the FirstDayScenario project. You do not need to modify CsvData.cs.
    Do Not Rewrite the CSV Loader

    CsvData.cs contains 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.cs and add the following line with the other using statements.

    MainWindow.xaml.cs — add with the using statements
    using 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.

    Screenshot placeholder showing where the Sample Course Data controls and DataGrid belong below the 0.5 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 MainWindow class 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

    1. Build the solution
    2. Run the application
    3. Scroll to the new Sample Course Data section
    4. Verify Load Course Data and an empty DataGrid are visible
    Go to top
  5. 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 line
    string 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

    1. Run the application
    2. Scroll to Sample Course Data
    3. Click Load Course Data
    4. When Visual Studio pauses, inspect courseData
    5. Press F10 once so firstCourseTitle receives its value
    6. Inspect firstCourseTitle
    Screenshot placeholder showing Visual Studio paused after the supplied CSV loader returns, with courseData and firstCourseTitle available for inspection
    The representative title should match the CourseTitle field in the first CSV record.

    Step 3 — Predict the DataGrid

    1. How many columns should appear?
    2. What should the column names be?
    3. How many data rows should appear?
    4. What title should appear in the first row?

    Step 4 — Continue and compare

    Supplied DataGrid connection
    this.courseDataGrid.ItemsSource = courseData.DefaultView;
    Screenshot placeholder showing CourseCode, CourseTitle, and Credits columns with four records in the DataGrid
    CSV fields become DataGrid columns. CSV records become DataGrid rows.
    One Value, Three Views

    You followed one value through CSV field → loaded application data → DataGrid cell.

    Go to top
  6. 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 record
    EX101,Digital Systems Basics,3

    to:

    Revised first record
    EX101,Digital Systems Fundamentals,3

    The complete file should now be:

    Courses.csv after the one-value change
    CourseCode,CourseTitle,Credits
    EX101,Digital Systems Fundamentals,3
    EX205,Web Foundations,2
    EX310,Working with Data,3
    EX415,Technology and Society,1

    Step 2 — Predict before running

    1. Predict the new value of firstCourseTitle
    2. Predict which DataGrid cell should change
    3. Confirm that the field names and number of records did not change

    Step 3 — Run the same application again

    1. Run the application
    2. Click Load Course Data
    3. Use the same breakpoint if you want to observe firstCourseTitle again
    4. Continue to the DataGrid
    5. Verify the changed title appears in the first record
    Screenshot placeholder showing Digital Systems Fundamentals in the first DataGrid row after the CourseTitle was changed in Courses.csv
    Changing one field value changes the corresponding application value without changing the record structure.
    What 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.

    Go to top
  7. 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

    1. Close Visual Studio
    2. Locate the LastName parent folder that contains the .sln file and project folder
    3. Create a ZIP file of the entire solution folder
    4. Open the ZIP and confirm the solution file, FirstDayScenario project, Courses.csv, CsvData.cs, and the inherited WeatherSupport.cs are present

    Step 3 — Submit to the Feedback System

    1. Open the Feedback System
    2. Select the correct First Day 0.6 assignment
    3. Upload the zipped Visual Studio solution
    4. Review the Feedback System results and correct any in-scope issues if required
    5. Resubmit a corrected ZIP when needed

    Step 4 — Submit the Feedback System URL to Canvas

    1. After the required Feedback System submission is ready, copy its URL
    2. Open the correct 0.6 First Day Assignment in Canvas
    3. Submit the Feedback System URL as your Canvas submission
    Checkpoint Summary

    You 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