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.
When extinguishing a fire, the extinguisher's stream should be aimed at the base of the flame using a sweeping motion. This will allow one to kill the fire from the source. This will quickly put out the fire faster applying the extinguisher from the upside.
The fixed point representation of the state of the cpu register is a binary number
The positive real number of the state of the cpu register is 17.53125
<h3>How to determine the positive real number?</h3>
The state of the cpu register is given as:
State = 10001.10001 in binary
To convert the number to a positive real number, we make use of the following product rule
State = 1 * 2^4 + 0 * 2^3 + 0 * 2^2 + 0 * 2^1 + 1 * 2^0 + 1 * 2^-1 + 0 * 2^-2 + 0 * 2^-3 + 0 * 2^-4 + 1 * 2^-5
Evaluate the products
State = 16 + 0 + 0 + 0 + 1 + 0.5 + 0 + 0+ 0 + 0.03125
Evaluate the sum
State = 17.53125
Hence, the positive real number of the state of the cpu register is 17.53125
Read more about fixed point representation at:
brainly.com/question/16612919
Answer: Decreasing Function????????????????????????????????
Explanation:
I'm confused, but I'm still gonna try and answer