Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

problem 1)a) prepare the output for the following program code:

# include
void divide(int x, int y){
cout<<”\n Inside function”;
try{
if(y= = 0)
throw y;
else
cout<<”\nDivision=”<} catch(int) {
cout<<”\n Caught integer inside function”;
throiw;
}
cout<<”\nEnd of function”;
}
void main( ) {
cout<<”\n Inside main”;
try{
divide(10,3);
divide(30,0);
} catch(int) {
cout<<”\n Caught integer inside main”;
}
cout<<”\n End of main”;
}

problem 2)a) Give any 4 manipulators and their equivalent ios functions.

b) prepare a user defined manipulator called currency that prints L. prepare another user defined manipulator called form which prints **+798.650 ( width is 10). These manipulators must be used in main to display L**+798.650

c) In what order are the constructors called when a derived class object is created. Assume that there are virtual and normal base classes. Describe with a appropriate ex.

problem 3)a) Which of the following declarations and definitions must be put in the header file?

i) float f1;

ii) extern int sum;

iii) void putvalues(float * f, int size);

iv) inline bool isequal(const int &, const int &) { }

b) What are the differences between a reference parameter and a pointer? When should a pointer be used? When it should not be used? Describe it with suitable ex.

c) Give the three steps of function overload resolution.

C/C++, Programming

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

Have any Question? 


Related Questions in C/C++

Discussion questionsplease respond to all of the following

Discussion Questions Please respond to all of the following prompts: • What is a friend function and how is it declared? • Which operators cannot be overloaded and why? • What is a macro in C++ programming and what are s ...

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 programming assignment-q1 using for loop write a c

Computer Programming Assignment- Q1. Using for loop, write a C++ program that prints out the multiples of 3 up through 75, separated by a blank space.  3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 ...

Pa 1 word countertabulating basic document statistics is an

PA #1: Word Counter Tabulating basic document statistics is an interesting exercise that leverages your knowledge of strings, files, loops, and arrays. In this homework, you must write a C++ program that asks the user fo ...

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

Only one programwrite a c program to find fibonacci numbers

Only one program Write a C++ Program to Find Fibonacci Numbers using Dynamic Programming.

C program codeoverviewfor this assignment write a program

C++ program code Overview For this assignment, write a program that will simulate a single game of Craps. Craps is a game of chance where a player (the shooter) will roll 2 six-sided dice. The sum of the die will determi ...

Descriptionnbspin this assignment you will write a c

Description:  In this assignment you will write a C++ program that finds the kth largest number among a set of N numbers. It will implement the solution using two different algorithms and measure the time elapsed during ...

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

Assignment simple 5-card poker gamein this assignment you

Assignment: Simple 5-Card Poker Game In this assignment, you will develop a simple poker game, complete with basic AI, using the object oriented programming principles discussed in class. Flow of Play Your poker game's p ...

  • 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