Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

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

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions