Question: C++ Write a program that will do the following: create a struct definition with the tag studentInfo for a struct that will store the following

C++

Write a program that will do the following:

create a struct definition with the tag studentInfo for a struct that will store the following data: name: Ann Annson age: 10 gpa: 1.10 grade: D

create an array students of 4 of these and initialize with the following data: Ann Annson, 10, 1.10, D Bill Billson, 20, 2.20, C Carl Carlson, 30, 3.30, B Don Donson, 40, 4.00, A

using text mode I/O, write the data in the array to a file called students.txt

using binary mode I/O, write the data in the array to a file called students.bin

create two new arrays of studentInfo; call the first studentsText and the second studentsBinary; each should have 4 elements

read the data from students.txt into studentsText

display the data from the array studentsText on the screen

read the data from students.bin into the array studentsBinary

display the data from the array studentsBinary on the screen

declare a new students variable called temp and then using random access commands, prompt the user for the student number to read, read just that record from the disk and into temp and display the contents of temp on the screen

NOTE! Do not use the string class in your struct definition. Instead, use the old c-style string (i.e. array of char)

Execution and source code listing was pasted into a Homework Template document.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!