Answer:
Explanation:
bool isPalindrome(string str)
{
int length = str.length();
for (int i = 0; i < length / 2; i++) {
if (str [i] != str [length – 1 – i]) {
return false;
}
}
cout << str << "is a palindrome";
return true;
}
Answer:
A. True
Explanation:
Websites are created using html, css, javascript and other web based programming languages. When a website page is requested, the host server sends the copy of the source code to the web browser of the client system, the web browser is able to interpret the source code and displays the graphical representation on the web browser for the client.
This is an incomplete question. The complete question is given below:
Mike has never used slide presentation software before but he needs to create a presentation by the end of the week what resource would be most helpful to mike
a. The 350-page printed manual from the slide presentation software publisher
b. A free tutorial the slide presentation software publisher has posted on the company website
c. A trouble-shooting website created by a third party
d. The 350-page online manual from the slide presentation software publisher
Answer:
b - A free tutorial the slide presentation software publisher has posted on the company website
Explanation:
As Mike has a short time and no prior experience with a slide software, then in this scenario, the best, simplest and fastest way to learn and create a presentation a free tutorial which the slide presentation software publisher has posted on the company website as this is the same company that has created this particular software so he can be rest-assured that the resource he is relying on is authentic and up-to-date with information on latest features.
Moreover, it's efficient and quick way to learn from a free tutorial rather than from 350-page printed or online manual especially for a beginner.
Besides, his purpose is to create the presentation using the software and not trouble-shooting so trouble-shooting website created by a third party is not useful for him and it also might not be authentic or updated as well.
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:
2^32 times as many values can be represented
Explanation:
32-bit. This means that the number is represented by 32 separate one’s and zero’s. 32 bits of 2 possible states = 2^32=4,294,967,296 possible values.
Integer meaning that only whole multiples of one are accepted.
Signed meaning that negative values are accepted. This halves the number of possible positive values (roughly), so the largest number you can represent is 2^31–1=2,147,483,647, but instead of 0, the smallest number you can represent is -2,147,483,648. An unsigned 32-bit integer, by contrast, can represent anything from 0 to 4,294,967,295.