Answer:
hazard mitigation grant
Explanation:
An emergency will be declared by the head of the state that can be president of the country or mayor of the city if they are unable to handle disasters that can be occurred in near future.
Hazard Mitigation Grant Program is the program that assists the state in implementing long term hazards mitigation measure following presidential declarations. According to the program, Hazard Mitigation Grant Program (HMGP) will provide the funds and assistance to the state to protect public or private properties through safety measures.
Answer:
1 void parseEmailAddress(string email, string& username, string& domain)
2 {
3 int found = email.find("@")
4 if (found > 0)
5 {
6 username = email.substr(0, found);
7 domain = email.substr(found+1, -1);
8 }
9 return;
10}
Explanation line by line:
- We define our function.
- We use an open curly bracket to tell the program that we are starting to write the function down.
- We apply the find method to the email variable that was passed by the main program. The find method tells us where is the "@" located within the email.
- We use an if statement to ensure that the value that we found is positive (The value is negative if an only if "@" is not in the email address).
- We use an open curly bracket to tell the program that we are starting to write inside the if statement.
- We apply the substr method to the email to take the username; it receives a start and an end value, this allows us to take from the beginning of the email (position 0) until the "@".
- We apply the substr method to the email to take the domain; it receives the position of the "@" character plus one to take the first letter after the "@" and a minus-one representing the last character on the email.
- We use a closing curly bracket to tell the program that the if statement has finished.
- We return nothing because we are using reference parameters, which means that the memory positions of username and domain are going to be filled by our parseEmailAddress function and the main function can access those values directly.
- We use a closing curly bracket to tell the program that the function has finished.
Answer:
See explaination
Explanation:
void bin2dec(char *s) {
int i = 0, num = 0;
while (s[i]) {
num *= 2;
num += s[i] - '0';
i++;
}
printf("%d\n", num);
}
The program Implement function bin2dec that takes a binary number bin_num as a string argument and prints out the corresponding decimal number.