void difference(int a, int b) {
---
int difference(int a, int b) { #paired
---
if (a - b > 0) {
---
if (a - b < 0) { #paired
---
cout << a - b;
}
---
else {
---
cout << -1;
}
---
}
Construct a function, matic, that takes as inputs 2 integers, x and y, and prints βautomaticβ if x is an odd number, βsystematicβ if x is greater than y, AND βhydromaticβ if y is not equal to x. Check all 3 conditions.
According to a logic game, a knight is someone who cannot tell a lie, and a knave is someone who cannot tell the truth. Construct a function that takes two booleans: the truth value of the story, and the truth value told by the person. The function should print whether the person was a knight or a knave.
If a cat is in a good mood, it purrs; when itβs in a bad mood, it meows. If a doog is in a good mood, it barks; when itβs in a bad mood it woofs. Construct a function that accomplishes this.
Construct a recursive function that tells the user to enter a positive number. It should then output that number to the terminal. If the user enters a negative number or zero, prompt the user again.
In the table of ASCII characters, the lowercase alphabet consists of characters 97-122. The uppercase alphabet consists of characters 65-90, which is a 32 character shift back from the lowercase. Construct a recursive function that asks the user to input a LOWERCASE character, converts that character to UPPERCASE character and prints it. If the user enters a character outside of the range of the LOWERCASE alphabet, prompt the user again. Hint: β||β means βorβ when used between two conditional statements.