Examlex

Solved

The Following Program Has Been Partitioned into Two Files

question 20

Essay

The following program has been partitioned into two files.The command line command for compiling this is CC B.cpp A.cpp,where CC is the name for your command line compiler.For VC++ this is CL,for Borland,this is BCC32,and for the GNU C++ compiler,this is g++.If you use an IDE (integrated development environment)you would have to place both these files in your project then click the compile button.
Predict the output and explain your prediction.
// This goes in file A.cpp
namespace
{
int func(int i)
{
return i*3;
}
int junk (int i)
{
return i*func(i);
}
// This goes in file B.cpp
#include <iostream>
int func(int i)
{
return i*5;
}
int junk(int i);//from A.cpp
int main()
{
cout <<"func(5)= " << func(5)<< endl;
cout <<"junk(5)= " << junk(5)<< endl;
}


Definitions:

Variable Costs

Costs that vary in direct proportion to changes in levels of an activity or production volume.

Fixed Costs

These are expenses that do not change with the level of production or sales, such as rent, salaries, and insurance premiums.

Net Income

The total earnings of a company after subtracting all of its expenses, including taxes and operating expenses, from its total revenues.

Required Sales

Required sales refer to the sales volume or revenue needed to cover all fixed and variable costs of a business within a specific period.

Related Questions