Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Microsoft Visual Studio create a C++ program that solves the following problem. 1. Read the problem. Write a program that reads a .csv file

Using Microsoft Visual Studio create a C++ program that solves the following problem.

1. Read the problem.
Write a program that reads a .csv file containing student survey data. The lines in the file vary by what information is being recorded. Read each line into a union according to the fields present and then output the data to the console with titles that make the data understandable.
The file is made up of several sets of four different records. Each row contains a record. Each record starts with the name of the record type: Student, Semester, Course, and Survey.

Student - contains the student id of the individual student who took the surveys (9-digit number).

Semester - contains the semester (S = spring, U = summer, F = fall), year, and room number (0, zero = online).

Course - contains the CIS course number, the end score and grade of the student.

Survey - contains the 5 ratings the student gave the instructor during the course, from 5 down to 1.

Use this file:
Student 100015418
Semester U 2012 0
Course 1 97.3 A
Survey 5 5 4 4 3
Student 100581237
Semester F 2012 501
Course 20 82.4 B
Survey 5 4 3 3 3
Student 100058746
Semester F 2012 501
Course 20 71.7 C
Survey 4 4 3 3 3
Student 101548859
Semester S 2013 503
Course 22 91.7 A
Survey 4 5 5 5 3
Student 100005843
Semester S 2013 503
Course 22 78.7 C
Survey 3 3 3 3 2
Student 101254438
Semester S 2013 505
Course 52 89.5 A
Survey 3 4 3 4 5
Student 104588628
Semester S 2013 505
Course 52 81.1 B
Survey 5 4 4 4 3
Student 100253448
Semester U 2013 0
Course 1 42.4 F
Survey 2 1 1 1 1
Student 103548861
Semester F 2013 505
Course 23 88.8 A
Survey 4 4 4 5 4 3
Student 100004557
Semester F 2013 505
Course 23 79.9 B
Survey 3 3 4 4 3 2
Student 105551473
Semester F 2013 505
Course 23 91.8 A
Survey 5 5 5 5 5 4

for the survey data.

Your program must contain at least the following elements:
a. Stucts defined that will hold complex data from the individual records.
b. A union defined that will hold the data from the structs and other data that does not need to be stored in a struct.
c. Code that reads the input .csv file and properly stores the data in the union.
d. Code that displays the data in the console in a human readable fashion.
Your program should not assume that there are a certain number of records, but may assume that the records are grouped together so that they may be displayed as read. Do not use string data types in the structs or union.
2. Pseudocode.
I strongly suggest that before you start programming the solution, that you write pseudocode to insure that you understand the problem.
You are not required to submit your pseudocode for this lab.
3. Create a new project.
Visual C++
Win32 Console Application
Name the project CIS022_S2016_Lab9b your name
Select a location where you can find it later
Choose the default application settings
4. Write the program.
Write code that solves the problem described in item 1.
Pause the program so that the console does not disappear until a key is pressed.
5. Insure that you properly document your code.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions