Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

Answer the following problems

problem1)  

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.                                    

problem2)                            

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

problem3)    

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.

problem4)

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

problem5)  

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?         

problem6)

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.            

problem7)   

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++

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 ...

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 ...

Question 1you are facing the following problem you are

Question 1 You are facing the following problem: You are given a robot and your task is to "guide" the robot through a 2-dimensional maze such that the robot can reach a desired goal state. Assume that the maze is define ...

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.

You need to program a microprocessor that would have a

You need to program a microprocessor that would have a temperature, gas, humidity and PIR sensor connected to it. It would send the data to a PC via a Zigbee and receive commands from the PC via the Zigbee to control mot ...

Please use codeblockslist the program and the output on the

Please use codeblocks List the program and the output on the command line Eg #include #include using namespace std; int main() { floatjohno = 0.5; size_t size = 24; vector array(size); for(inti=0; i     { johno = johno + ...

Object oriented programmingassignmentq1 assuming there are

Object Oriented Programming Assignment Q1: Assuming there are 7.481 gallons in a cubic foot, write a program that asks the user to enter a number of gallons, and then displays the equivalent in cubic feet. Q2: You can co ...

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 ...

Problem 1overview for problem 1a of this assignment you

Problem #1 Overview: For problem 1(a) of this assignment, you will need a C++ compiler. In order to receive credit, your program must compile and run; and you must provide the actual source code file so that I can compil ...

Computer programmingobjectives1 opening a file reading from

Computer Programming Objectives: 1. Opening a file, reading from file, writing to a file and closing a file. 2. Sequential access files handling. 3. Practice C++ programming problems. Note: Carefully read the following i ...

  • 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