(1) Given the statement below, ifp is 6, thenq becomes 4. if(p == 6) q = 4;...
Question:
(1) Given the statement below, ifp is 6, thenq becomes 4.
if(p == 6) q = 4;
(a) True (b) False
(2) Given the statement below, ifq is 6, thenp becomes 4. if(p == 4) q = 6;
(a) True (b) False
(3) Given the statement below, ifp is 6, thenq becomes 4. if(p != 6) q = 4;
(a) True (b) False
(4) Given the statement below, ifq is 7, thenp becomes 4. if(q != 6) p = 4;
(a) True (b) False
(5) Given the statement below, ifq is 4, thenq becomes 6. if(q >= 6) q = 4;
(a) True (b) False
(2) Write anif statement to determine if the Boolean variable namedcheck1 is currently set to True. If it is, set the value of the Boolean variablecheck2 to False. Otherwise, set it to True.
(3) Write anif statement that determines whether the variablebalance is greater than 400.00. If it is, multiply the variablebalance by 1.06. Otherwise, multiply the balance by 1.05.
If(balance >400.00) {
(4) Assuming that an employee's years of service is stored in the Integer variable intYears , write anif statement that will set the value of the Boolean variable blnAward to True, if the employee's years of service is greater than 25 and less than 35. Otherwise, set the value of the Boolean variable to False.
(5) Write aswitchcase statement that tests the value of the integerintNumber . If the value ofintNumber is 0 , set theString variable namedchrResult to " F ". If the value ofintNumber is 1 , inclusive, set theString variable named
chrResult to " P ". Add adefault case which will set the character variable namedchrResult to " I ".
Write a complete program that prompts the user for a student's status and grade point average ( GPA ) and then determines whether or not the student should be placed on the Dean's list.Assume that a student is placed on the Dean's list when he/she has full-time status and a GPA of at least 3.50. Part-time students cannot be placed on the Dean's list regardless of their GPA.
Attach your completed source code and a snapshot of your output.
Probability And Statistics For Engineering And The Sciences
ISBN: 9781305251809
9th Edition
Authors: Jay L. Devore