Problem Solving for Programmers Quiz

User Generated

YbeqBqva

Programming

Description

I have quiz on my problem solving for programmers class, and i want someone to solve it to me. I will upload the quiz, give it a look, if you have any questions ask me.

Unformatted Attachment Preview

CS1250 Test #2 Pre Test Extra Credit Tracing Through Logic Problems – 1. Trace through the following loop and show the values for variables X and Y: Y=2 For X = 2 to 40 Step 10 Y=X–Y+2 Next X Y = X – Y - 15 Value of X ________ Value of Y ________ 2. Trace through the following loop and show the values for Q, R & T. Q = 10 R=6 T=1 Do Until Q < 2 Q=Q–4 R=Q–R/2 T=T+R End Do Value of Q _______ Value of R _______ Value of T _______ 3. Trace through the following loop and show the values for MiceOrdered, MiceSent, and MiceUsed. Declare MiceOrdered = 12 Declare MiceSent = 8 Declare MiceUsed = 0 Declare MiceTested = 4 Do Until MiceOrdered = MiceSent If MiceOrdered – MiceSent 0 MiceUsed = MiceUsed + 1 MiceOrdered = MiceOrdered – 1 Endif MiceTested = MiceTested + 1 End Do Value of MiceOrdered ________ Value of MiceSent ___________ Value of MiceUsed ___________ Value of MiceTested _________ Question about Problem 3 4. Is Problem 3 a Post Test Loop or a Pre Test Loop? _______________________________________ True/False Questions 1. If Number = 3, indicate whether each of the following statements is true or false: a. (Number * Number) >= (2 / Number) ______ b. (3 * Number – 3) >= 7 ______ 2. “A” “A ” ______ 3. “E” = “e” ______ 4. If N1 = “Ann” and N2 = “Anita”, indicate whether each of the following statements is true or false: a. (N1 = N2) AND (N1 >= “Ann”) ______ b. (N1 = N2) OR (N1 >= “Ann”) ______ c. Not (N1 > N2) ______ 5. The body of a pre-test loop must be executed at least once. _____ Debugging Exercise // A standard mortgage is paid monthly over 30 years. // This program is intended to print 360 payment coupons // for each new borrower at a mortgage company. Each coupon // lists the month number, year number, and a friendly mailing reminder. Start Declarations Num Months = 12 Num Years = 30 String MSG = “Remember to allow 5 days for mailing” Num acctNum Num monthCounter Num yearCounter String StopProgram Housekeeping() Do While acctNum = StopProgram PrintCoupons() End Do Finish() Stop Housekeeping() Output “Enter account number or “, StopProgram, “ to quit” Input acctNum Return PrintCoupons() Months = 1 Do While yearCounter
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hello, Here you go!I have done the assignment in two files.In one, I only provided the answers. It depends on what you were required to do. In the second file, i provided a file showing the trace step by step and the values. The trace values are bold. As for the last Question, I have corrected the algorithm on one file highlighting the mistakes in Yellow. I have then written about them in the "clean File" To just ensure that all is alright. Please take the two files, look at them and let me know if there is anything I need to add or remove. I will be out for a few hours but I will be back before the time here expires.

CS1250 Test #2 Pre Test Extra Credit
Tracing Through Logic Problems –

1. Trace through the following loop and show the values for variables X
and Y:

Y=2
For X = 2 to 40 Step 10
Y=X–Y+2
Nex...


Anonymous
Really useful study material!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags