This document provides 3 programming tasks: 1) Provide a char variable value satisfying a Boolean expression, 2) Provide int variable values satisfying another Boolean expression, 3) Complete a main() function that takes user input, checks for divisibility by 5, and conditionally outputs half the input value. The main() function must check divisibility, output half if divisible, otherwise increment and re-check before terminating.
Provide a value for the char-type variable x that satisfies the foll.pdf
1. Provide a value for the char-type variable x that satisfies the following Boolean expression (2
points):
bool q1 = x < 'R' && x > 'K' && x != 'P';
2. Provide values for int-type variables a and b that satisfy the following Boolean expression (2
points):
bool q2 = a < b && a > (1 - b) / 2;
3. Complete the following main() function by adhering to the following three (3) ordered
requirements,
then concluding with a valid return statement:
i. Write a selection statement (e.g. if, if-else) that determines if a user-input integer userInt is
divisible
by 5. (2 points)
ii. If userInt is divisible by 5, this program will output half of userInts value to the console,
preserving any information after the decimal point. (2 points)
iii. If userInt is not divisible by 5, this program will increment userInt by 1, then perform a
second
attempt to determine userInts divisibility by 5. If userInt becomes divisible by 5 as a result of the
increment, output the information specified in requirement ii. Otherwise, terminate the program
without
outputting any information to the console. (2 points)
#include
using namespace std;
int main()
{
int userInt; //DO NOT MODIFY
cin >> userInt;
//Complete Requirements i. - iii. here:
equirements i. - iii. here: