Monday, August 15, 2011

Computer help!!! pseudocode?

what is the answer to the following q's? 9. A group of variables is often called a ____. (Points: 1) linked group data structure data object module . A statement that asks a user to enter information is called a ____. (Points: 1) delimiter breaker prompt read 13. What is the problem with the following pseudocode if you assume that the housekeeping() module does not perform a read? start perform housekeeping() (without read) while not eof read invRecord profit = invPrice - invCost print invItemName, invPrice, invCost, profit endwhile (Points: 1) there is no priming read and the while not eof check may fail there is no check for the end of the file the loop is not structured there is no input Assume that out of 1000 employees, 900 employees in the company have medical insurance and 500 have dental insurance. How many times will the following decision structures be executed in total? if empDentalIns = "Y" then if empMedicalIns = "Y" then print empIdNumber, empLastName, empFirstName endif endif (Points: 1) 500 900 1500 1900 What pseudocode is used in a binary selection? (Points: 1) if-then if-then-else while do-while
--------------------
I agree with one of the other answerers on 4 out of the 5 questions. Their answers were. 1. data object 2. prompt 3. there is no input 4. 500 5. if-then-else But I believe they have got question 3. wrong. The answer should be: there is no priming read and the while not eof check may fail As the while loop while activate, and if it is the end of file when you first read it in, there will be no invRecord. A priming read should be done to check if the file is not empty. The following: perform housekeeping() (without read) while not eof read invRecord profit = invPrice - invCost print invItemName, invPrice, invCost, profit endwhile (Points: 1) Should be changed to something like. perform housekeeping() (without read) read invRecord while not eof profit = invPrice - invCost print invItemName, invPrice, invCost, profit read invRecord endwhile (Points: 1) On another note: It would only be 500 for the question about health and dental insurance if you need to have health insurance to be able to have dental insurance. If you could have dental insurance without health insurance, the answer would be: A minimum of 400 and a maximum of 500.
Source

No comments:

Post a Comment