Answer:
Following are the code to this question:
#include <iostream> //defining header file
using namespace std;
void numbers(ostream &outs, const string& prefix, unsigned int levels); // method declaration
void numbers(ostream &outs, const string& prefix, unsigned int levels) //defining method number
{
string s; //defining string variable
if(levels == 0) //defining condition statement that check levels value is equal to 0
{
outs << prefix << endl; //use value
}
else //define else part
{
for(char c = '1'; c <= '9'; c++) //define loop that calls numbers method
{
s = prefix + c + '.'; // holding value in s variable
numbers(outs, s, levels-1); //call method numbers
}
}
}
int main() //defining main method
{
numbers(cout, "THERBLIG", 2); //call method numbers method that accepts value
return 0;
}
Output:
please find the attachment.
Explanation:
Program description:
- In the given program, a method number is declared, that accepts three arguments in its parameter that are "outs, prefix, levels", and all the variable uses the address operator to hold its value.
- Inside the method a conditional statement is used in which string variable s and a conditional statement is used, in if the block it checks level variable value is equal to 0. if it is false it will go to else block that uses the loop to call method.
- In the main method we call the number method and pass the value in its parameter.
Answer:
If the responsibilities are distributed ,the disputes amongst people wont take place because their wont be any partiality, everyone would be equal. Moreover it is difficult for one person to control everything at once and multiple people would help the work to be organized as everyone will have their own part of work which is supposed to be fulfilled.
Answer:
b) Plus sign
Explanation:
The plus sign or addition operator (+) accomplishes concatenation. This is a greatly used in the Java's output Statement to combine values coming from different data types into a formatted output
consider the code snippet below which uses concatenation to output information about an individual
public class Name {
public static void main(String[] args) {
int age =18;
String name = "John";
System.out.println("His name is "+name +" and his age is "+age);
}
}
The + operator has been used to concatenate the int value age and the String value stored in name to the output
Answer:
Explanation:
When you have a single copy, a large number of concurrent updates that are supposed to go to a file may result in the user obtaining incorrect information. This incorrect information obtained them leads to the file being left in an incorrect state. When you have a lot of or multiple copies, then storage waste exist and the various copies might happen not to be consistent with respect one other. In summary, what happens is that
a) Using one copy saves space, but also the change might have an effect on all the users.
b) Using multiple copies avoids eliminates the change problem, while creating its own problems, using more space.