Cis115 final exam 1
Upcoming SlideShare
Loading in...5
×
 

Cis115 final exam 1

on

  • 362 views

 

Statistics

Views

Total Views
362
Views on SlideShare
362
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft Word

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Cis115 final exam 1 Cis115 final exam 1 Document Transcript

  • CIS115 Final Exam PLEASE DOWNLOAD THE ANSWERS HERE!!!1. (TCO 1) What does IPO of IPO Model stand for? (Points : 4)2. (TCO 1) What is a data item with a name and a value that remain thesame during the execution of a program? (Points : 4)3. (TCO 1) What symbol in a flowchart would be used by a developer torepresent an input or output operation? (Points : 4)4. (TCO 1) Set is a process. What data type would you expect thevariable, name, to have? (Points : 4)5. (TCO 1) You are using dollar amounts in an algorithm. What datatype would you assign? (Points : 4)6. (TCO 2) What tool is used by developers to design logic usingspecific shapes/symbols? (Points : 4)7. (TCO 2) When a program evaluates mathematical expression, whichof the following operators (or mathematical operations) has the lowestprecedence? (Points : 4)8. (TCO 2) Using the assignment statement, + sales, which side of theequal sign is evaluated first? (Points : 4)9. (TCO 2) What value will be contained in the variable, x, after thefollowing statement is executed?
 * 5 / 10 + 6 (Points : 4)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 path
  • executes”
 EndIf (Points : 4)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 determines if the userenters a number between 20 and 45? (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
 DisplayZ (Points : 4)1. (TCO 5) The variable used to create an expression controlling theloop is known as the _____. (Points : 4)2. (TCO 5) Which of the following statements is false? (Points : 4)3. (TCO 5) Which control structure is classified as a loop? (Points : 4)4. (TCO 5) Repetition that loops a certain number of times is typicallyreferred to as _____. (Points : 4)5. (TCO 5) How many times will the following loop be executed? 
 Set
 DOWHILE x <> 7
 Display x
 Set + 1
 ENDO (Points : 4)6. (TCO 7) What is a subscript or an 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) What is the value of the index used to access the last elementin a zero-based array declared as num(12)? (Points : 4)
  • 9. (TCO 7) When loading/initializing the elements of an array, whatcontrol structure is used to move through each element within thearray? (Points : 4)10. (TCO 7) A zero-based array named sales has been declared andloaded with the values: 100, 1100, 3400, 5550, 3000, 22300, 1200.What value will be stored in the array element, sales(2)? (Points : 4)11. (TCO 6) A record contains _____. (Points : 4)12. (TCO 6) What are the three modes of operation on a file? (Points : 4)13. (TCO 8) Many algorithms require direct communication fromusers. These types of algorithms are called _____. (Points : 4)14. (TCO 9) What type of error occurs when an array subscript’s valuegoes beyond the total number of elements in the array? (Points : 4)15. (TCO 2) What type of variable can be accessed by any modulewithin the design? (Points : 4)1. (TCO 10) A department store is having a customer appreciation sale.Depending on the total dollars purchased, the customer could receive adiscount on total purchases. You are to develop pseudocode that willobtain the total dollars purchased from the user, determine the discountpercent, and display the total amount due. When the purchases are morethan $500, the discount is 10%. When the purchases are $500 or less, thediscount is 6%. (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.What statement(s) would you need to add to correct the logic? Be sure toexplain why you are adding the statements.
 Set 
 DOWHILE num<=7
 Set + num
 ENDO
 Display total (Points : 10) View slide
  • 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 7 have a 5% salestax. The 8-24 codes have a sales tax of 7%. Codes above 24 have a salestax of 9%. The code is entered by the user.
 Begin
 Declare RealsalesTax
 Declare ____ countyCode
 _____ “Enter the countycode: “
 Input _____________
 If _______ <= 7 then
 Set
 Else
 If ______ AND ______then
 ______________
 Else
 Set
 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 ___________
 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(_________) then
 Display “secondary color View slide
  • 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) Compare and contrast sequence controlstructures and selection control structures. (Points : 10)