Questions


July 2022 1 20 Report
Answer any one out of the following (A or B) questions in about 100 to 150 words.

(A) class Book
{
char book_name[20], writer [20];
int no_of_pages;
public:
void read();
void show();
};
class Tbook: private Book
{
int no_of_lessons, no_of_exercises;
protected:
int standard;
public:
void readtbook();
void showtbook();
};
class sciencebook: public tbook
{
char topic[20];
public:
void readsciencebook();
void showsciencebook();
};

(i) Name the data members and member functions which can be accessed from the member
function of class sciencebook.
(ii) Name the member functions which can be accessed by an object of (a) class tbook (b)
class sciencebook


(B) Write a C++ program as per the following instructions:
(i) Write a C++ code which reads the contents of a text file "first_file.txt" 1
(ii) Write a function named vowel_words() which will segregate the words starting with
vowels from the "first_file.txt" 2
(iii) Write a C++ code which writes the resultant words to the output file, "second_file.txt".1
Example: Content of first_file - "I am going to buy an umbrella"
Output in second_file.txt - I am an umbrella

Answers & Comments


Add an Answer


Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Helpful Social

Copyright © 2024 EHUB.TIPS team's - All rights reserved.