Answer:
Hi!
10010101 = 149;
01110110 = 118;
00110011 = 51;
11100010 = 226;
10000001 = 129;
Explanation:
To convert binary numbers you can use this formula:
, where position of the bit₀ is the rightmost digit of the number.
Results, using the formula:
10010101 = 1*2⁰+1*2²+1*2⁴+1*2⁷ = 1 + 4 + 16 + 128 = 149.
01110110 = 1*2¹+1*2²+1*2⁴+1*2⁵+1*2⁶ = 118;
00110011 = 1*2⁰+1*2¹+1*2⁴+1*2⁵ = 51;
11100010 = 1*2¹+1*2⁵+1*2⁶+1*2⁷ = 226;
10000001 = 1*2⁰+1*2⁷ = 129;
<em>Note:</em> All bits in 0 multiplied by any number are 0.
Answer:
The program in C++ is as follows:
#include <iostream>
#include <vector>
using namespace std;
int main(){
vector<int> nums;
int num;
cin>>num;
while(num != -1){
nums.push_back(num);
cin>>num; }
for (auto i = nums.begin(); i != nums.end(); ++i){
cout << *i <<endl; }
return 0;
}
Explanation:
This declares the vector
vector<int> nums;
This declares an integer variable for each input
int num;
This gets the first input
cin>>num;
This loop is repeated until user enters -1
while(num != -1){
Saves user input into the vector
nums.push_back(num);
Get another input from the user
cin>>num; }
The following iteration print the vector elements
<em> for (auto i = nums.begin(); i != nums.end(); ++i){
</em>
<em> cout << *i <<endl; }
</em>
Answer: D. invade public space.
Explanation:
Flash mob refers to the group of people who gather in a public place, and then perform for a brief time and then leave after they perform. The performance is typically meant for satire, entertainment, satire, or can be a form of artistic expression. An example of flash mob is people gathering to sing a song, choreography or people involved in a pillow fight.
Some critics of flash mobs believes that flash mobs invade public space and can sometimes be out of control when there are a large number of people who are participating.