Answer:
Following are the program in the C++ Programming Language.
//set header file
#include <iostream>
//set namespace
using namespace std;
//define class
class format
{
//set access modifier
public:
//set string type variable
string res;
//define function
void names(string first_name, string last_name)
{
//set if-else if condition to check following conditions
if(first_name.length()>0 && last_name.length()>0)
{
res="Name: "+last_name+", "+first_name;
}
else if(first_name.length()>0 and last_name.length()==0)
{
res="Name: "+first_name;
}
else if(first_name.length()==0 and last_name.length()==0)
{
res="";
}
}
//define function to print result
void out(){
cout<<res<<endl;
}
};
//define main method
int main() {
//set objects of the class
format ob,ob1,ob2;
//call functions through 1st object
ob.names("John","Morris");
ob.out();
//call functions through 2nd object
ob1.names("Jhon","");
ob1.out();
//call functions through 3rd object
ob2.names("", "");
ob2.out();
}
<u>Output</u>:
Name: Morris, John
Name: Jhon
Explanation:
<u>Following are the description of the program</u>:
- Define class "format" and inside the class we define two void data type function.
- Define void data type function "names()" and pass two string data type arguments in its parameter "first_name" and "last_name" then, set the if-else conditional statement to check that if the variable 'first_name' is greater than 0 and 'last_name' is also greater than 0 then, the string "Name" and the following variables added to the variable "res". Then, set else if to check that if the variable 'first_name' is greater than 0 and 'last_name' is equal to 0 then, the string "Name" and the following variable "first_name" added to the variable "res".
- Define void data type function "out()" to print the results of the variable "res".
- Finally, we define main method to pass values and call that functions.
Answer:
To convert hexadecimal number 11BA to decimal, follow these two steps:
Start from one's place in 11BA : multiply ones place with 16^0, tens place with 16^1, hundreds place with 16^2 and so on from right to left
Add all the product we got from step 1 to get the decimal equivalent of 11BA.
Using the above steps, here is the work involved in the solution for converting 11BA to decimal number (Don't forget that we start from ones place to so on...)
Decimal equivalent of "A" = (A) 10 × 16^0 = 10
Decimal equivalent of "B" = (B) 11 × 16^1 = 176
Decimal equivalent of "1" = 1 × 16^2 = 256
Decimal equivalent of "1" = 1 × 16^3 = 4096
Decimal equivalent of "11BA" = 409625617610
11BA = 4538
Here is the final answer, The hexadecimal number 11BA converted to decimal is therefore equal to:
4538
Answer:
Options A and C.
Explanation:
In Oracle Cloud Infrastructure the two options which allows you to increase disk performance are;
1. Terminate the compute instance preserving the boot volume. Create a new compute instance using a VM Dense IO shape using the boot volume preserved.
2. Create a backup of the boot volume. Create a new compute instance a VM Dense IO shape and restore the backup.
Answer:
You would start by multiplying 9 with 1 then with 2 and then with 3 and so on as:
9 x 1 = 9
9 x 2 = 18
9 x 3 = 27
. . . . . . . .
Just put this into QBASIC statements now.
Let us assume you want to display 10 multiples of 9. Then you would want to multiply 9 with 1 and do the same thing upto 10. This is how you do it.
CLS
FOR I = 1 TO 10
PRINT 9 * I
NEXT I
END