Preview

This Is a Paper

Satisfactory Essays
Open Document
Open Document
469 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
This Is a Paper
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?"

What will be printed if the input is 0? * “you fail” * “how did you do?” *
What will be printed if the input is 100? * “how did you do?” *
What will be printed if the input is 51? * “your grade is 51” * “you did OK” * “how did you do?” *
What will be printed if the user enters “Wingding”?
The program will terminate because it is expecting an integer value and a “Wingding” will cause an error in the program which will cause it to crash. *
Is this design robust? If so, explain why. If not, explain what you can do to make it robust. * The design is not robust as there are no statements for error handling and handling exceptions. To make this code more robust I would add error handling statements like the user can only enter numbers that are between 0 and 100. Also the user cannot enter any strings like winding and other data types, for other numbers and data types the system will display "invalid input. Please enter a number between 0 and 100." Also notice that it doesn't handle the case of entering 49. You need <= 49, as it is now, when you enter 49 all it will say is "how did u do?" same thing with entering 100 and for anything over 100. *
How many levels of nesting are there in this design?
There is one level of nesting in the design. *
Provide a set of values that will test the normal operation of this program segment. Defend your choices. * Test Values
Input (X)

You May Also Find These Documents Helpful

  • Satisfactory Essays

    cout << "You are in factorial program of C++. Please enter a +ve integer:- ";…

    • 426 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pt1420 Unit 7 Study Guide

    • 582 Words
    • 3 Pages

    Display it on the next line in decimal and the user if he or she wants to do it. Again if the user type ‘y’ or ‘Y’ the program repeats. If the user type anything else the program terminates. If the user types an illegal character, prompt the user to type again. Page: 115…

    • 582 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Mat 540 Week 4 Paper

    • 1775 Words
    • 8 Pages

    * Is this design robust? If so, explain why. If not, explain what you can do to make it robust.…

    • 1775 Words
    • 8 Pages
    Powerful Essays
  • Satisfactory Essays

    Case Analysis

    • 293 Words
    • 2 Pages

    3. You need to write while(x>1){}. - DON'T - Penalties will be assessed for code sharing.…

    • 293 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    A Paper

    • 1140 Words
    • 5 Pages

    The precipitated calcium carbonate is then filtered, dried, and weighed. The moles of calcium carbonate, CaCO3, are equal to the moles of Group 1 metal carbonate, M2CO3, added to the original solution. Dividing the mass of the unknown carbonate by the moles of calcium carbonate yields the formula weight, and thus the identity, of the Group 1 metal carbonate.…

    • 1140 Words
    • 5 Pages
    Good Essays
  • Better Essays

    Growing up as the oldest sister to a mentally challenged sibling with multiple learning disabilities and having a mother who is a Special Education Teacher to autistic and behavioral challenged children, I have been surrounded by the train wreck called the No Child Left Behind Act (NCLB). While the NCLB is supposed to hold our schools accountable and to offer assistance to struggling students who are unable to pass the standardize testing. What happens to the students who have learning disabilities? What happens to our vocational students (Home economics, welding,…

    • 683 Words
    • 3 Pages
    Better Essays
  • Good Essays

    mid term paper

    • 1704 Words
    • 5 Pages

    What were some of the changes that took place in Europe between the years 1000 and 1492, and why did those changes lead to European exploration and overseas expansion?…

    • 1704 Words
    • 5 Pages
    Good Essays
  • Good Essays

    8th Grade Paper

    • 436 Words
    • 2 Pages

    The ancient Greek Democracy and the ancient Roman Republic might seem like they are the same but they actually differ in some points. A Greek Democracy focuses on voting directly on an issue, while a Roman Republic focuses on voting for representatives. That is mainly what makes a Greek Democracy and a Roman Republic different. But in the end they both end up being similar by giving power to the people.…

    • 436 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    2.5 Explain the purpose of health and safety procedures when providing a reception service, including own responsibilities.…

    • 252 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Ninth grade so far has been fun but interesting. First, the classes are fun and exiting. Classes are full of fun and we even get some freedom of which classes we want to take. Next, in high school there is a lot of fun school activities. There are ball games, winter week, homecoming week, pep fests, parades, and many other fun things. Finally, the older kids are a lot nicer than I expected. I like the older kids mainly because they are really helpful and most of them are nice. LFCHS is a fun place for ninth graders to start a high school career.…

    • 104 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    High School Paper

    • 285 Words
    • 2 Pages

    There is nothing particularly noteworthy about Robert Shawn Keever. He is loud, boisterous, sarcastic, and a man of total depravity. To date he has been in no clubs or sports. He has yet to hold a job, nor do I believe he has the capability to even hold such a responsibility. If it were a matter of GPA, he’d fall short there too as it is 2.3. As a student he has no ambition for higher education and would rather join the military. His relationship with his peers and family can be described as abusive and unruly. In the past he has skipped school and deliberately started fights. Also, he has no faith. This being a nation founded by Jesus would make him an enemy of America and its values. His only saving grace is a profound love for most social studies and a strong sense of loyalty to those who have managed to make friends with him. Thus far he has taken every social studies class Smyrna High School has to offer.…

    • 285 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Variables: This program gets a number from the user. We need a variable to hold the number. We need to print the numbers from 1 up to the user's number. We need a second variable for this.…

    • 789 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Im Sorry Research Paper

    • 885 Words
    • 4 Pages

    I’m sorry. Two simple words… why do we humans believe that by saying these two words, they would somehow take back all offenses and heal all the wounds which you have created? How can you say regretful remarks, make selfish decisions, and expect to fix the whole ordeal by saying these two little words? We have been taught since a young age, to assume that saying I’m sorry will heal all the pain we caused. My concern, however, is not the words themselves but, the way they are delivered in the most detached and meaningless way possible, only in hopes of suppressing the situation. The method to correctly apologize, however, is fairly simple. First, you must own the mistake you have made; secondly, you must step in the other’s shoe in order to…

    • 885 Words
    • 4 Pages
    Good Essays
  • Better Essays

    5 Page Research Paper

    • 1124 Words
    • 3 Pages

    Organizational behavior is the study of attitudes and behaviors of people in an organization. Human attitudes and behaviors regulate efficiency of any organization. The approach of organizational behavior is the system approach. It interprets people and organization relationships. The purpose is to build better relationships by achieving human, organizational, and social objectives. I am diagnosed with Cystic Fibrosis and I am in and out of the hospital on a normal basis. I noticed over the years that there are many challenges and opportunities today in hospital facilities dealing with organizational behavior.…

    • 1124 Words
    • 3 Pages
    Better Essays
  • Good Essays

    Selection Struture

    • 385 Words
    • 2 Pages

    To make a decision based on the value of a variable we have used the if-then-else statements. If there are multiple values the variable can take on, we have used multiple or nested if-then-else statements. The case selection structure provides multiple alternatives. It inspects a value and chooses the right path of execution that is assigned to that value. For example, a case selection structure could be used to divide the code based…

    • 385 Words
    • 2 Pages
    Good Essays

Related Topics