Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 4 [33] Note: Read through the whole of Question 4 below before you attempt to answer the questions that follow Also provide only the

image text in transcribed
image text in transcribed
QUESTION 4 [33] Note: Read through the whole of Question 4 below before you attempt to answer the questions that follow Also provide only the member functions requested and required by the question The Exams department keeps a file with a list of all the modules in which exams are written for each module, the module code and module name are stored in the file Exams.dat Once the exam timetable has been determined the file Exams.dat needs to be updated with the number of students who will write the exam as well as the date on which the exam will be written However, every exam period, the same exams are written The Exams department, therefore wants to keep the file Exams dat intact They require a program that will copy the contents of the file Exams.dat to another file called Exams Detail.dat in which the number of students who will write the exam as well as the date on which the exam will be written, have been added to the module code and module name for each exam This will create a record for each exam in file ExamsDetail.dat TURN OVER COS1512 Oct Nov 2019 Complete the program below, using separate compilation, to assist the Exams Department The program uses a class Exam This class has four member vanables mode, a string for the module code mame, a string for the module name nestudents, an integer value to indicate the number of students who will write the exam examDate, a string for the date on which the exam will be written In addition, the class Exam has the following member functions A default constructor that initialises all the strings to empty strings, and the integer member variable to o An overloaded constructor to initialise member vanables to specified values A destructor . An accessor getCode) A mutator set.Date() An overloaded stream extraction operator>> Implemented as a friend function, to read an Exam object from a file An overloaded stream insertion operator 7/1. Include files needed using namespace std. int main() 1 2 1/2. Declare anput file, open file Exams.dat // and check that file exists (2 marks) 3 1/3. Declare output file, open file 1/ ExamsDetail.dat and check that file exista (2 marks) TURN OVER COS1512 Oct/Nov 2019 string code, name, date, int number: whale //4. Read the module code and module // name from fale Exams.dat 1 cout > number: cout > date. 5 J/5 Instantiate an object anExam using the 1/overloaded constructor to initialise the object wath the values 1/obtained 6 J/6. Output object anexan to file //ExamsDetail.dat 7 //7.close files return 0

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

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago