Preview

Programming Logic

Good Essays
Open Document
Open Document
1499 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Programming Logic
Programming Logic and Design, 6th Edition

Chapter 5

Exercises

1. What is output by each of the pseudocode segments in Figure 5-22?

Answer:
|a. |5, 22, 5 |
|b. |4, 6, 7 |
|c. |5, 6 |
|d. |Goodbye |
| |Goodbye |
| |Goodbye |
| |Goodbye |
| |Goodbye |
| |Goodbye |
| |Goodbye |
| |Goodbye |
| |Goodbye |
|e. |Hello |
| |Hello |
| |Hello |
|f. |Adios |
| |Adios |
| |Adios |
| |Adios |
| |Adios |
| |Adios |
| |Adios |
| |Adios |

2. Design the logic for a program that outputs every number from 1 through 10.

Answer: A sample solution follows

You May Also Find These Documents Helpful

  • Satisfactory Essays

    PT1420 Unit 8 Lab 8

    • 365 Words
    • 2 Pages

    Step 7: Write a for loop that will display the numbers starting at 20, then 40, then 60,…

    • 365 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pt1420 Unit 7 Study Guide

    • 582 Words
    • 3 Pages

    2.Write a program to (a) display a “?” (b) read two decimal digits whose sum less than 10 (c) display them and their sum on the next line. Page: 80…

    • 582 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    code program

    • 317 Words
    • 2 Pages

    (Compilation screenshot) - Insert here a screenshot of the result of compiling the above source code: NetBeans IDE 7.3.1 compiles but it did not go to the screen so I could see it, this is why I sent you a message yesterday to let you know this. But the program did run without any problems.…

    • 317 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Logical Design Pt. 2

    • 641 Words
    • 3 Pages

    Hello sirs, my name is , it has come to my attention that there are some misconceptions about the value in normalizing your database. I wanted to write this correspondence to address any concerns that you may have about flexibility while entering your data into the system. This letter is to assure you and the other members of your executive board that you will have some flexibility within your E-R Model.…

    • 641 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Syllogisms & Logic

    • 682 Words
    • 3 Pages

    The following are examples of syllogistic arguments that are missing the conclusions. Study the two reasons very carefully and complete the syllogism with the conclusion that logically follows.…

    • 682 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    1. A computer store was robbed over the weekend, and the police have rounded up four suspects. The detective interrogated them and determined that one of them was indeed the robber. Here were the statements:…

    • 328 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Logic and Correct

    • 29095 Words
    • 117 Pages

    Congratulations! 100% Correct! Formal Commands [Quiz #1] completed! Congratulations! 100% Correct!…

    • 29095 Words
    • 117 Pages
    Satisfactory Essays
  • Good Essays

    As the lead single from his third album, the song “Everybody” (2017) by Logic mainly focuses on racial equality. Born Sir Robert Bryson Hall II from Gaithersburg, Logic represents the classic rag-to-riches tale. As a biracial rapper, Logic grew up with parents who struggled with drug and alcohol addictions. Now he makes roughly 10 million dollars with his music, and tries to spread his message“peace, love, and positivity” around the world. As Logic addresses this international problem through his music, he adds his own little take on racial acceptance for all.…

    • 569 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Deductive Reasoning

    • 697 Words
    • 3 Pages

    It is important to understand what is known prior to making a decision because the decision could be either wrong or right. Making decisions at times can be a hard thing to do. There are many pros and cons for decision making. In argument five To Cheat or Not to Cheat Jenna has a big decision to make. She has to decide whether or not she wants to continue her class by being honest or to cheat because it will help her out in the end. Her decision can result in failure for the class or if she can prep herself to do better she can pass this class. If she doesn’t think about what the consequences can be she will turn to cheating because it is an easy escape. Making decisions can also come with consequences if you don’t make the right choice. People make choices by impulse which usually comes with a negative reward. Jenna needs to decide what is right for her rather than what Cyndi thinks she should do. If Jenna happened to cheat she would fail the class and have to retake it. Her best bet is to buckle down and do the work herself. With her making the right choice can benefit her in many ways like knowing that she did the work herself and didn’t cheat. Cheating can leave a big chip on your shoulder and she wouldn’t have that if she was honest and did her work by herself. Jenna can set aside an amount of time where she can study every day and still have time to take care of her ill parent. Doing this can is a good decision so she can still do things she needs to do around the house. A few hours of studying a day can help bring up her grade. That is the better reward rather than cheating her way through school.…

    • 697 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Hello

    • 888 Words
    • 4 Pages

    1) prompt the user to enter an integer N (in this document we call the input number N, but of course…

    • 888 Words
    • 4 Pages
    Good Essays
  • Good Essays

    The trick of logic

    • 993 Words
    • 3 Pages

    The story uses first person point of view to illustrate how a man deals with and reacts to the fact that his father’s second wife demands maintenance from him. The narrator of this story is the son of the wealthy father. At first the man takes a strong stand that he has no reason to and would never give the woman his money. But at the end of the story, due to his sympathy, he slightly changes his opinion and starts to feel bad for the woman. With several symbols, the story vividly elucidates that humanity could be tough to concur, but it can also be subtle and easy to take advantage of sometimes.…

    • 993 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    "HD - Adidas Commercial - F50 Adizero - Lionel Messi, David Villa - HD "…

    • 387 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Deductive Reasoning

    • 1835 Words
    • 53 Pages

    Deductive reasoning happens when a researcher works from the more general information to the more specific. Sometimes this is called the “top-down” approach because the researcher starts at the top with a very broad spectrum of information and they work their way down to a specific conclusion. For instance, a researcher might begin with a theory about his or her topic of interest. From there, he or she would narrow that down into more specific hypotheses that can be tested. The hypotheses are then narrowed down even further when observations are collected to test the hypotheses. This ultimately leads the researcher to be able to test the hypotheses with specific data, leading to a confirmation (or not) of the original theory and arriving at a conclusion. An example of deductive reasoning can be seen in this set of statements: Every day, I leave for work in my car at eight o’clock. Every day, the drive to work takes 45 minutes I arrive to work on time. Therefore, if I leave for work at eight o’clock today, I will be on time. The deductive statement above is a perfect logical statement, but it does rely on the initial premise being correct. Perhaps today there is construction on the way to work and you will end up being late. This is why any hypothesis can never be completely proved, because there is always the possibility for the initial premise to be wrong.…

    • 1835 Words
    • 53 Pages
    Good Essays
  • Better Essays

    C LANGUAGE

    • 4276 Words
    • 18 Pages

    Introduction to the C Programming Language Science & Technology Support High Performance Computing Ohio Supercomputer Center 1224 Kinnear Road Columbus, OH 43212-1163 Table of Contents • • • • • • • • • Introduction C Program Structure Variables, Expressions, & Operators Input and Output Program Looping Decision Making Statements Array Variables Strings Math Library Functions • • • • • • • • • User-defined Functions Formatted Input and Output Pointers Structures Unions File Input and Output Dynamic Memory Allocation Command Line Arguments Operator Precedence Table 2 C Programming Introduction • Why Learn C? 3 C Programming Why Learn C? • • • • • • • • •…

    • 4276 Words
    • 18 Pages
    Better Essays
  • Powerful Essays

    Logic and Subject

    • 1542 Words
    • 7 Pages

    Logic- Greek word ‘logos’ which means thought, word, speech, science. Founded by Aristotle around 384-322 B.C. through his famous philosophical masterpiece “organon”…

    • 1542 Words
    • 7 Pages
    Powerful Essays