CIS 155 CIS155 Week 2 Quiz Answers

(TCOs 2, 3) What symbol would be used in a flowchart for the following statement?
discount = price * .05  (TCOs 2, 3, 8) Assume that the variables num and rate
are integer variables, and dept is a string variable. Which of the following assignment statements is invalid?  (TCOs 2, 3, 8) What is the final value of y at the end of these statements?
Â Â Â Â Â Â Â Â Â Â Â x = 5
Â Â Â Â Â Â Â Â Â Â Â y = 2 * x
Â Â Â Â Â Â Â Â Â Â Â y = y + 1  (TCOs 2, 8) Write a valid assignment statement for the following: Multiply x by 2 and store the result in z.
 (TCOs 3, 8) Evaluate the following expression.
Â Â Â Â Â Â Â Â Â Â Â 30 MOD 4  (TCOs 3, 8) Evaluate the following expression using the values x = 10, y = 5, and z = 3.
Â Â Â Â Â Â Â Â Â Â Â x
MOD y + z  (TCOs 2, 3, 8) List the inputs and outputs and write the psuedocode to solve the following problem (8 points): The program will prompt the amount of a bill in a restaurant and the percentage tip to leave (input 10 for 10%). The program will calculate and display the amount of the tip.