Upcoming SlideShare
×

# Cis115 final exam 2

306 views
238 views

Published on

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
306
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
2
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Cis115 final exam 2

1. 1. CIS115 Final Exam PLEASE DOWNLOAD THE ANSWERS HERE!!!1. What is the first step in software development?2. What are named locations in a computer’s memory holdinginformation required by a program?3. What symbol in a flowchart would be used by a developer torepresent the beginning or ending point?4. ) Set name = “BSCIS” is a process. What data type would you expectthe variable, name, to have?5. (You are using dollar amounts in an algorithm. What data type wouldyou assign?6. What tool is used by developers to design logic using specificshapes/symbols?7. When a program evaluates mathematical expression, which of thefollowing operators (or mathematical operations) takes precedence?8. (Which one of the following is a valid assignment statement in aprogram?9. (Evaluate (2 * 3) ^ 3.10. (TCO 2) Review the partial pseudocode below. What is the correctmath expression to complete the algorithm and total sales for bothregions?  Prompt “Enter total sales for region 1: “  Inputregion1  Prompt “Enter total sales for region 2: “  Inputregion2  Set _____  Display “total sales: “ + total (Points : 4)11. (TCO 3 & 4) Review the pseudocode below. What will be displayedwhen this algorithm executes?  Set   If ((x > = 10) AND (x < 20))then  Display “the IF path executes”  Else  Display “the ELSE pathexecutes”  EndIf (Points : 4)
2. 2. 12. (TCO 3 & 4) What value gets displayed for the variable X?  Set  Set   Set   If (B > 15) AND (() OR (C <= 15)) then  Set  Else  Set   EndIf  Display X (Points : 4)13. (TCO 3 & 4) In the following pseudocode, what raise will anemployee in Department 6 receive?  If department < 2 then  Set  Else  If department < 6 then  Set   Else  Set   EndIf  EndIf(Points : 4)14. (TCO 3 & 4) Which of the selection structures determine whetherthe user enters a number outside a range of 5 and 15? (Points : 4)15. (TCO 3 & 4) What value gets displayed for the variable Z?  Set  Set   Set   If ((balance <> 800) OR (stateCode <> 6) OR(creditCode <> 7) then  Set   Else  Set   EndIf  Display Z(Points : 4)1. (TCO 5) The statements executed within a loop are knowncollectively as the _____. (Points : 4)2. (TCO 5) Which of the following statements is false? (Points : 4)3. (TCO 5) A DO loop is considered what type of loop? (Points : 4)4. (TCO 5) What happens when the loop control variable is notchanged? (Points : 4)5. (TCO 5) How many times will the following loop beexecuted?   Set   DOWHILE num <= 6  Display num  Set +1  ENDO (Points : 4)6. (TCO 7) What is another name for an array’s index? (Points : 4)7. (TCO 7) Suppose you have an array named number,  and two of itselements are number(1) and number(4). You know that _____. (Points :4)8. (TCO 7) Which one of the following correctly declares a zero-basedarray of four integers? (Points : 4)
3. 3. 9. (TCO 7) When processing the elements of an array, what controlstructure is used to move through each element within the array? (Points: 4)10. (TCO 7) A zero-based array named sales has been declared andloaded with the values 100, 1100, 3400, 5550, 3000, 22300, and 1200.What value will be stored in the array element sales(1)? (Points : 4)11. (TCO 6) A file contains _____. (Points : 4)12. (TCO 6) What is automatically placed at the bottom of a file whenthe file is closed? (Points : 4)13. (TCO 8) Menu-driven programs need to give the user the option to_____. (Points : 4)14. (TCO 9) What type of error occurs when a program will not executebecause the rules of the language have been violated? (Points : 4)15. (TCO 2) The first module is usually considered to be called the_____ module. (Points : 4)1. (TCO 10) A retail store is having a customer appreciation sale.Depending on the total dollars purchased, the customer could receive adiscount on his or her total purchases. You are to develop pseudocodethat will obtain the total dollars purchased from the user, determine thediscount percentage, and display the total amount due. When thepurchases are more than \$100, the discount is 10%. When the purchasesare \$100 or less, the discount is 5%. (Points : 10)2. (TCO 10) A small business in your neighborhood would like anapplication developed that determines the average dollar amount spentfor every three purchases. The user will enter three different purchaseamounts. You need to display the average to your client. Complete thepseudocode to design your logic. (Points : 10)3. (TCO 9 & 10) There is a logic error in the following pseudocode. Theloop needs to execute four times. What statement(s) would you need toadd or change to correct the logic? Be sure to explain why you areadding or changing the statements.  Set   REPEAT  Set +
4. 4. 1  UNTIL total < 7  EndWhile  Display total (Points : 10)4. (TCO 4 & 10) Complete the pseudocode by rewriting the algorithm.The design is determining the correct sales tax depending on the countyidentifying code. Counties with a number less than 10 have a 6% salestax. The 11–25 codes have a sales tax of 7%. Codes above 25 have asales tax of 8%. The code is entered by the user.   Begin  DeclareReal salesTax  Declare _____ countyCode  _____ “Enter the countycode: “  _____ countyCode  If _____ <= 10 then  Set   Else  If_____ AND _____ then  Set  Else  _____  EndIf  _____  Display “the sales tax is: “ +_____  End (Points : 10)5. (TCO 5 & 10) Complete the pseudocode by rewriting the algorithm.The design is to display a 60-second countdown.  Begin  Declare_____ count  Set   REPEAT  Display “countdown: “ +_____  Set - 1  UNTIL _____  EndDo  Display “LIFTOFF!”  End (Points : 10)6. (TCO 4, 5 & 10) Complete the pseudocode by rewriting thealgorithm. The colors red, blue, and yellow are known as primary colorsbecause they cannot be made by mixing other colors. When you mix twoprimary colors, you get a secondary color. Mixing yellow and blue getsyou green. Mixing red and blue gets you purple. The algorithm allowsthe user to enter two primary colors and then displays the resultingsecondary color. The colors entered by the user will be validated toensure they entered a primary color.  Begin  Declare Stringcolor1  Declare String color2  Declare String control1  DeclareString control2  _____ “Enter first primary color: “  Input_____  Prompt “Enter the second primary color: “   Input_____  Set control1 = “n”  DOWHILE control1 = “n”  If (color1<> “yellow”) _____ (color1 <> “red”) _____ (color1 <> “blue”)then  Prompt “first primary color is invalid”  Input_____  Else  Set control1 = “y”  ENDO  Set control2 =“n”  DOWHILE control2 = “n”  If (color2 <> “yellow”) _____(color2 <> “red”) _____ (color2 <> “blue”) then  Prompt “secondprimary color is invalid”  Input color2  Else  Set control2 =“y”  ENDO  If (color1 = “red”) AND (_____) then  Display“secondary color is: purple”  EndIf  If (color1 = “yellow”) AND
5. 5. (_____) then  Display “secondary color is: green”  EndIf   End(Points : 10)7. (TCO 1, 2, 3, & 4) Describe the difference between a flowchart andpseudocode and explain whether one is more important to develop thanthe other. (Points : 10)8. (TCO 1, 2, 3, 4, & 5) Describe two of the three control structures andhow relational and logical operators are used. (Points : 10)