Below is one way to fix the program. Since we want βTHE TEAMβ to print three times, we must check all three conditons. this means changing the else if statements to if statements.
You are part of a class where everyone passes, but itβs very hard to pass with an A. Fix the function so it prints your letter grade according to this scheme. [0, 50) = C, [50, 95) = B, and [95, 100] = A.
You are part of a class where everyone passes, but itβs very hard to pass with an A. Fix the function so it prints your letter grade according to this scheme. [0, 50) = C, [50, 95) = B, and [95, 100] = A. Use the lines to construct the code, then go back to complete the Activecode.
Fix the infinite recursion in the code below. The function should not count any numbers after 10 (the highest numbers that should print are 9 or 10). When it is done counting, the function should print that.
Below is one way to fix the program. The infinite recursion happens when we use an odd number as an argument. By checking that a number is less than 99, the highest numbers to recurse are 98 and 97. 98 + 2 == 100 and 97 + 2 == 99, so we never count past 100.
Finish the code below so that it prints true if x is even and false if x is odd. Use the lines to construct the code, then go back to complete the Activecode.
Write the function greaterThan that prints true if the first double argument is greater than the second double argument. Be sure to include any necessary headers. Use the lines to construct the code, then go back to complete the Activecode.
void greaterThan(double a, double b) {
---
void greaterThan(int a , int b) { #paired
---
if (a > b) {
cout << "true";
}
---
if (a < b) {
cout << true;
}
---
else {
cout << "false";
}
---
if (double a > double b) {
cout << true;
} #distractor
---
}
Write the function goodVibes that prints βIβm having a mood day!β depending on the value of mood. If mood is βbadβ, then the function should not do anything since itβs good vibes only. Be sure to include any necessary headers.
Below is one way to write the program. The return allows the function to exit if there are bad vibes in the room. Otherise, the function prints as directed.
Write the function exclusiveOr that prints true If either a OR b is true, and prints false otherwise. Be sure to include any necessary headers. Use the lines to construct the code, then go back to complete the Activecode.
Write the function countdown that takes a positive integer and decrements it until eaching zero, printing the number at each step of the way. Once it reaches zero, it should print βBlastoff!β
Write the function printNegativeNum that asks the user for a negative number. If the user does not provide a negative number, it should contine asking until the user provides one. It should then print the negative number.
Write the function printNegativeNum that asks the user for a negative number. If the user does not provide a negative number, it should contine asking until the user provides one. It should then print the negative number. Use the lines to construct the code, then go back to complete the Activecode.