Social media is the high capacity of communication links
It is just a declaration of an object variable, <em>person</em>, in JavaScript. Within a <em>person</em> object, there are key:value pairs. The code that you shared has the following keys: name, age, and favouriteFood, whereas the values of those keys are: Mike, 25, and pizza.
There is <em>no</em> alert statement in this code snippet; therefore, it <em>will not alert </em>anything. This code contains only a variable called <em>person, </em>and that's it!
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.
Answer:
Economic.
Explanation:
In the following scenario, In Quincy, WA, a community that formerly would have a community of 3,500, they are developing new infrastructure. In addition to such friends and neighbors, Quincy citizens will also be seeing more traffic signals, a shopping center, rising property prices, and new opportunities.
So, the following scenario is best suited for the economic changes.
Answer:
program :
def separate_int_and_str(list_1):# function to seprate the list.
str_list=[] #list to hold the
int_list=[]#list which holds the integer value.
for x in list_1: #for loop to extract the list.
if(type(x)==str): #if condition to check the type of the element.
str_list.append(x)#create a list for the string value.
elif(type(x)==int): #check condition for th einteger value.
int_list.append(x)#create a list for the integer value.
Explanation:
- The above-defined function is written in the python language, which used the code to separate the list for integer and the string value.
- There are two lists define in the function which holds the integer and the string value separately.
- There is a 'for' loop which scans the element of the list and checks the list by the help of type function which tells the class of the element.
- Then if the type function states that the element is from the strong class, it will assign the element on the string list otherwise it assigns the element in the integer list.