Preview

Algorithm: Failure and Program Segment

Satisfactory Essays
Open Document
Open Document
387 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Algorithm: Failure and Program Segment
Axia College Material
Appendix J

Algorithm Verification

Consider the following selection statement where X is an integer test score between 0 and 100.

input X

if (0 <= X and X < 49) output "you fail"

else if (50 <= X and X < 70) output "your grade is" X output "you did OK"

else if (70 <= X and X < 85) output "your grade is" X output "you did well"

else if (85 <= X and X < 100) output "your grade is" X output "you did great"

endif output "how did you do?"

o What will be printed if the input is 0? Failed grade o What will be printed if the input is 100? Passing grade o What will be printed if the input is 51? Average grade o What will be printed if the user enters “Wingding”? How did you do? o Is this design robust? If so, explain why. If not, explain what you can do to make it robust. This design is not robust due to lack of check data job. It should appear at the beginning before the analysis to determine if this was a number within the scope required. You must check to ensure number is correct, otherwise it is an error, then you must re-enter and start again. o How many levels of nesting are there in this design? There are a total of 4 nest levels and a default level. o Give a set of values that will test the normal operation of this program segment. Defend your choices. -1,0,49,50,51,69,70,71,84,85,86,99,100,101 All values one below the other, and one above the various numbers strictly for researching if the actual numbers work properly. o Give a set of test values that will cause each of the branches to be executed. Some test values would be 25,65, 75, 95 and 101 in which 101 would be default. o Give a set of test values that test the abnormal operation of this program segment. Test values that would have an abnormal operation on this program segment has to be -1, and 101 because it goes above and below the actual algorithm.

Vanessa Dunigan
IT210
Week 6 Checkpoint
University of

You May Also Find These Documents Helpful

  • Satisfactory Essays

    = z) return true; else return false; } Problem 5 a. Output: 720 b. Output: 0 c. Output: 71 d. Output: 362880 Problem 6 a. Output: “Take Programming I.” b. Output:…

    • 188 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    SD1230 Lab 1

    • 239 Words
    • 2 Pages

    2. What type of instruction is used to execute different code based on a condition? -Jumps…

    • 239 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    IT210 R5 Appendix D 2

    • 197 Words
    • 2 Pages

    I. Running a program using various sets of inputs to determine if the program is running properly…

    • 197 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pt1420 Unit 7 Study Guide

    • 582 Words
    • 3 Pages

    12.Write a program to put the sum 100+95+90+..........+5 in AX. Then display the result. Page: 114…

    • 582 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Mat 540 Week 4 Paper

    • 1775 Words
    • 8 Pages

    * Provide a set of test values that will cause each of the branches to be…

    • 1775 Words
    • 8 Pages
    Powerful Essays
  • Satisfactory Essays

    Comp 122 Week 1 Ilab

    • 662 Words
    • 3 Pages

    5. Write the program to implement your algorithm. Test your program using your test cases. Did your program produce the values predicted in your test cases? Explain.…

    • 662 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    c. Modify the program of Part b so that at the option of the user, it displays…

    • 300 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Using the knowledge that you have obtained from the experiment, speculate as to why the values obtained were negative. [ C / 1 ]…

    • 598 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    E. Calculate the weighted total points based on the four category points (assignment average, lab points, midterm average, and final exam) and their respective weights (stored in the range B40:B43) in cell Y8. Use the relative and absolute cell references as needed in the formula. The first student’s total weighted score is 90.…

    • 472 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Lab 3 Student

    • 1264 Words
    • 7 Pages

    Step 4: Write the exact output you would expect from the following line of code if the user of the program enters a name of Nolan Owens and they have taken 20 credits so far. (Reference: Displaying Items, page 40 – 41).…

    • 1264 Words
    • 7 Pages
    Satisfactory Essays
  • Good Essays

    Macro Examples

    • 1120 Words
    • 5 Pages

    7. The If…Then…Else…End If code allows code to be conditionally executed depending on whether a specified logical condition has been met.…

    • 1120 Words
    • 5 Pages
    Good Essays
  • Powerful Essays

    * Vary sequences, configurations, and data to increase the probability that, if there is a problem, testing will find it. ƒ…

    • 1099 Words
    • 5 Pages
    Powerful Essays
  • Satisfactory Essays

    What Is Pseudocode?

    • 413 Words
    • 2 Pages

    First, you need to understand that pseudocode is not a programming language. Pseudocode cannot be compiled nor executed on a computer, and there is no real formatting or syntax rules. It is simply one step, a very important step, in producing the final code. The benefit of pseudocode is that it enables the designer to concentrate on the algorithms without worrying about all the syntactic details of a programming language. In fact, you can write pseudocode without even knowing what programming language will be used for the final implementation.…

    • 413 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Major excell assignment

    • 1000 Words
    • 4 Pages

    (e) Sum the number of students with “Yes” in both the Consistent A and Consistent C or D columns. Place these sums in cells E40…

    • 1000 Words
    • 4 Pages
    Satisfactory Essays
  • Better Essays

    IF STATEMENT SAMPLE 1 <?php $studentId = 'A1110601'; if ( $studentId == 'A1110601' ) { echo ' Student ID: '.$studentId. '<br/>'. ' Welcome! Inah Ysabela Marie D. Alegre'; } ?> SAMPLE 2 <?php $birthdate = 'April 8, 1995';…

    • 989 Words
    • 4 Pages
    Better Essays