Question: WRITE CODE IN C++ Consider the class called student which models the following states and behaviors of a student: - States: Name, Roll Number, Marks,
WRITE CODE IN C++
Consider the class called student which models the following states and behaviors of a student: - States: Name, Roll Number, Marks, Grade - Behaviors: 1. Read_data() 2. Display grade () 3. Compute_grade () - Perform the following operations: Create an object of student type and reads its data. Write the object onto a file (say "student.dat"). Read the object from the file. Display the data onto the screen. Hint: ofstream Myfile; Myfile . open ("student.dat", ios::app); Myfile.write((char*)this, sizeof(* this)); Myfile.close()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
