Answer:
#include <iostream>
#include <map>
using namespace std;
int main()
{
map<int, int> numbers;
cout << "Enter numbers, 0 to finish" << endl;
int number;
while (true) {
cin >> number;
if (number == 0) break;
numbers[number]++;
}
for (pair<int, int> element : numbers) {
std::cout << element.first << ": occurs " << element.second << " times" << std::endl;
}
}
Explanation:
One trick used here is not to keep track of the numbers themselves (since that is not a requirement), but start counting their occurrances right away. An STL map< > is a more suitable construct than a vector< >.
Answer:
The most likely galaxy type to be identifiable regardless of orientation is: Irr
Explanation:
The Irr galaxies don't have a discernable or usual shape; that is why it is relatively easy to identify.
When we talk about E type galaxies, this statement proves itself by the way the cumulus of stars compounds the galaxy. The elliptical galaxies have the form of ellipses, with a reasonable distribution of stars. The degree of eccentricity is the number that complements the E letter; that's why E0 galaxies are almost spherical, while E7 is considerably elongated.
SBc, SBa galaxies are spiral; this means it can be flat in some angles difficulting their identification process; in this case, the last letter means the way the arms display their form, with "c" having a vague form and "a" well-defined arms. That's why in some angles can be mistreated as another type of galaxy.
Answer:
True
Explanation:
Building your personal brand requires extreme care when it comes to social media presence. In the age of internet there is nothing hidden, so whatever you post or comment will be seen by your audience and it can go in either way. It can either make your brand or break it. It is of utmost importance to leave a pleasant and positive impact on your audience. One should not indulge in inappropriate or controversial debates and try to avoid being too personal on social media.
Answer:
Handle the exception in a catch block or throw the exception to the method that called this method.
Explanation:
The try and catch statements occur in pairs. The try statement allows the user to define a block of code to be tested for errors while it is being executed.
The catch statement allows the user to define a block of code to be executed, if an error occurs in the try block.
If an exception is checked by a method, the method either handles the exception in a catch block or throw the exception to the method calling it.