Answer:
Explanation:
Here is the code
#include<iostream>
using namespace std;
template <class myType>
int generic(myType *a, myType b)
{
int i;
for(i=0;a[i]!=-1;i++)
{
if( b == a[i])
return i;
}
return -1;
}
int main()
{
int a[]={1,2,3,4,5,6,7,8,-1};
float b[]={1.1,2.1,3.1,4.1 ,5.1,6.1,7.1,-1};
if(generic(a,5)>0)
{
cout<<" 5 is foundin int at index "<<generic(a,5)<<endl;
}
else
{
cout<<" 5 notfound "<<endl;
}
if(generic(b,(float)5.1)>0)
{
cout<<" 5.1 isfound in float at index "<<generic(a,5)<<endl;
}
else
{
cout<<" 5.1 notfound "<<endl;
}
system("pause");
}
/*
sample output
5 is found in int at index 4
5.1 is found in float at index 4
*/
Answer:
Explanation:
IaaS - storage and network devices
SaaS - software upgrades and patches
MaaS - monitoring tools
PaaS - virtual computing platform
Answer:
The three quantitative characteristic properties of water is explained below in detail.
Explanation:
The three quantitative components of water incorporate the following:
1.Freezing point:
The water has a freezing point of 0 degrees Celsius.
2. Boiling point:
The water has a boiling point of 100 degrees Celsius.
3. Melting point:
The melting point of ice is 0 degrees Celsius.
These properties are all uncommon to water. Being uncommon means that these characteristics are only noticeable in water; hence, they can be beneficial in recognizing such a substance.
Answer:
An LS button
Explanation:
It appears on the (structure line 3)on the structure line, place your cursor in the <u>whi</u><u>te</u> field to the right of the E button (Recall that the E button represent the entry test).
Answer:
Following are the code to the given question:
#include <iostream>//header file
using namespace std;
class Window //defining a class Window
{
private:
int width, height;//defining integer variable
public:
friend ostream& operator << (ostream& stm, Window& width)//defining a friend function that takes two parameters
{
return stm<<"a ("<<width.width<<" x "<<width.height<<") window"; //use return keyword that return its values
}
Window(int width, int height): width(width), height(height)//defining parameterized constructor that inherit width and height in its parameters
{}
};
int main() //Main method
{
Window w(80,90);//calling class constructor
cout<<w;//print object value
return 0;
}
Output:
a (80 x 90) window
Explanation:
In the above code, a class "Window" is defined that uses a friend function "ostream& operator" is declared that uses the "ostrea&" as a data type to hold two-variable "stm and w" in its parameter, and declared the parameterized constructor to hold value by inheriting width and height in its parameters.
Inside the main method, a class object is created that calls the constructor and uses the print method to print object value.