OBJECT LOG BOOK


Submit solution

Points: 10
Time limit: 100.0s
Memory limit: 10M

Authors:
Problem type
Allowed languages
C++

Design a C class StudentLog that prints a log of all operations in its object’s life cycle i.e print CREATED, COPIED, ACCESSED, MUTATED, and DESTROYED when an object of the class is created, copied, its value read, its value changed, and object destroyed respectively. Student class stores name, roll no, and marks in 5 subjects (use appropriate data types). Use the concepts of constructor and destructors

Write a menu-driven C program that creates a StudentLog object studobj and performs operations on it. Your program should repeatedly read a character from the user and do the following:

R - Read name and rollno into studobj from the user

M - Read 5 integers from the user and Set marks

C - Check whether the student passes ( gets 50% marks). Print “PASS/FAIL”

X - Exit the program

INPUT FORMAT

R

Shyam

CB.EN.2013456CSE

M

32

24

45

12

9

C

X

OUTPUT FORMAT:

CREATED

MUTATED

MUTATED

ACCESSED

FAIL

DESTROYED


Comments

There are no comments at the moment.