Answer:
xyz = 25
result = square(xyz)
print(result)
The above code assigns the value 25 to variable xyz as 5*5=25. Then next statement is a function call to square() function passing xyz to this function in order to compute the square of 25. The output is:
625
Explanation:
The above code can also be written as:
xyz = 5*5
result = square(xyz)
print(result)
The difference is that xyz is assiged 5*5 which is equal to 25 so the output produced will be the same i.e. 625.
The result variable is used to store the value of square of 25 after the square() method computes and returns the square of 25. So print(result) prints the resultant value stored in the result variable i.e. 625
Answer:
The answer is "both voluntary and non-voluntary context switch".
Explanation:
The description to this question can be described as follows:
Whenever processing requires resource for participant contextual switch, it is used if it is more in the situation of I/O tied. In which semi-voluntary background change can be used when time slice ends or even when processes of greater priority enter.
- In option a, It requires voluntary context switches in I /O bound.
- In option b, it requires a non-voluntary context switch for CPU bound.
0.61 (rounded up)
Explanation:
You add both 700 and 450 which will give you 1150g
You then divide 1150 by 100 which gives you 11.5
Then divide 7 by 11.5 which will give you 0.61 as cost of every 100 grams
Answer:
C++ code is given below
Explanation:
#include<iostream>
#include <cstring>
using namespace std;
int housekeeping(string EOFNAME);
int mainLoop(string name,string EOFNAME);
int finish();
void main()
{
string name;
string EOFNAME = "ZZZZ";
cout << "enter the name" << endl;
cin >> name;
if (name != EOFNAME)
{
housekeeping(EOFNAME);
}
if (name != EOFNAME)
{
mainLoop(name , EOFNAME);
}
if (name != EOFNAME)
{
finish();
}
system("pause");
}
int housekeeping(string EOFNAME)
{
cout << "enter first name " << EOFNAME << " to quit " << endl;
return 0;
}
int mainLoop(string name, string EOFNAME)
{
int hours;
int rate,gross;
int DEDUCTION = 45;
int net;
cout << "enter hours worked for " << name << endl;
cin >> hours;
cout << "enter hourly rate for " << name << endl;
cin >> rate;
gross = hours*rate;
net = gross - DEDUCTION;
if (net > 0)
{
cout << "net pay for " << name << " is " << net << endl;
}
else
{
cout << "dedections not covered.net is 0.";
}
cout << "enter next name or " << EOFNAME << " to quit" << endl;
cin >> name;
return 0;
}
int finish()
{
cout << "end of job"<<endl;
return 0;
}
Answer:
Explanation:
The clients that would be best suited for this opportunity would be small business or business' that do not have the hardware/space resources necessary to create the computing power that they need. Instead, they can simply pay for these cloud-based services which provide all of the necessary computing/hardware power and resources necessary so that the company can easily fulfill all of their tasks without any problems. Bigger companies can easily pay for and implement their own hardware to solve their problems which may benefit them even more in the long-term.