Ask Question, Ask an Expert


Ask C/C++ Expert

Home >> C/C++

Answer the following problems


Describe the term Class and Object using ex of a student class. Student class represents name, enrolment number, father’s name, telephone number, programme code and date of birth of a student. The class has the function to illustrate the information about student except date of birth, and to modify information of telephone number and programme. Name the private and public members (data members as well as member functions) for the class student. Define the data types of member variables using C++ and create few objects of the class. Could you put information in those objects? Give reasons.                                    


Describe the following terms in context of object oriented programming using student class of problem 1. You should use C++ to define student class. Additionally, suppose that student class has a sub class namely “PhD Student” who has the extra field “Department”. The function to describe the information about PhD student also prints department in addition to showing information as shown by the student class.                             

(a) Overloaded Constructors

(b) Encapsulation

(c) Inheritance

(d) Polymorphism


prepare down the advantages of using UML? Create class diagram for a University having classes – Student, Teacher, Subject and Programme. Make appropriate assumptions, if any.


Describe the usage of the following C++ operators with the help of the ex program.

(a) operator for type casting

(b) operator for bitwise OR

(c) operator for dereferencing an address

(d) comma operator


Differentiate between call by value and call by reference with the help of an ex in content of function call. Describe the advantages of call by value. What does C++ uses?         


prepare down the template class “binaryTree” in C++. The class must have functions for search and insert and element into a binaryTree. Use this template to make a binary tree of integer keys. Make appropriate assumptions, if any.            


Create a class AlphaString which stores only alphabets in a string of arbitrary length. String has a constructor which ensures that String has only Alphabets. Class also has the copy constructor, and an overloaded + operator. The overloaded + operator must perform concatenation of two strings. Does the class need an explicit destructor? Justify your answer.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M92360

Have any Question? 

Related Questions in C/C++

This program involves using stl listsfor this program you

This program involves using STL lists. For this program you will implement three functions whose prototypes are given below: list ::iterator mxIter(list ::iterator first, list ::iterator last); void selectSort(list & aLi ...

Objectives- gain experience with if if else and switch

Objectives - Gain experience with if, if else, and switch statements in C programs. - Experience using % operator and true false logic. Hints This program will be MUCH easier if you design how to do the logic in your own ...

Discussion questonsplease respond to all of the following

Discussion Questons Please respond to all of the following prompts: • How are input and output accomplished in C++? • How do cin and cout relate to ostream and istream? Lab Activity 1. Write a C++ program per the require ...

Here are two examplesifcounter7continueifcounter7break1

Here are two examples: if(counter==7) continue; if(counter==7) break; 1. Write a for loop that counts only the odd numbers out of the first five numbers entered from the keyboard, but does not count (skips) the number 7. ...

Programming assignment- in this assignment you are

Programming Assignment- In this assignment you are requested to write a C++ program that displays the following colored pyramid on the screen: - The pyramid is 71 characters wide and 21 characters high. - To draw it, you ...

Write a program that calculates mileage reimbursement for a

Write a program that calculates mileage reimbursement for a salesperson at a rate of $0.35 per mile. Your program should interact with the user in this manner: MILEAGE REIMBURSEMENT CALCULATOR Enter beginning odometer re ...

More often than not entrepreneurs will fail several times

"More often than not, entrepreneurs will fail several times before they make it and will usually learn a lot in the process. To help these entrepreneurs to succeed will require a cultural shift. We need to encourage Aust ...

Computer scienceprogram-write a c program that willpresent

Computer Science Program- Write a C++ program that will: Present the user with a menu of choices: 1. Random number 2. String 3. Type Casting 4. Integer Math Then, in an if-else if structure (or switch) write the code for ...

1 write a program to find the sum amp average of the given

1) Write a program to find the sum & average of the given numbers using the while loop. 2) Write a program in C to find the sum and average of the given numbers stored in an array of n values.

Cs492 programming assignment-the program must be written in

CS492 Programming Assignment- The program must be written in C or C++, and run on a linux machine. ALL source code you submit must be well documented (documentation is an indicator of understanding!) Programs that cannot ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate