STARTING OUT W/PROGRAM.LOGIC...-TEXT
5th Edition
ISBN: 2810022369454
Author: GADDIS
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 11, Problem 4AW
Look for ways to modularize the
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Instructions for Questions 1 through 6. For each piece of pseudocode, give the
runtime in terms of N. Your answer should give an exact value for the number of times
the inner loop runs (i.e. the final value of count), and it should also give the order of
growth of the runtimes using big-Oh notation. You can assume that N "comes out nicely"
with respect to loops. For example, if the loop counts by 2, you can assume it is an even
number, and if it multiplies or divides by 2 each time, you can assume it is a power of 2.
Note: log(N!) is 0(NlogN).
Once you have a list of all the mathematical operations, you may put them in a sensible order.
Let’s say you have a 5-digit number, 23456. You are supposed to write a code that prints numbers in the ones, tens, hundreds, thousands, and ten thousands places of this number. In the text box below, write the steps you will follow to write the code. Share it on the discussion forum. Here, you only need to write the approach in a step-by-step manner, just like you did with algorithm design in the case of computational thinking.
Chapter 11 Solutions
STARTING OUT W/PROGRAM.LOGIC...-TEXT
Ch. 11.1 - What is a menu-driven program?Ch. 11.1 - The items displayed in a menu are often preceded...Ch. 11.1 - What type of structure do you use in a program to...Ch. 11.3 - Explain why most menu-driven programs use a loop...Ch. 11.3 - If a program uses a loop to display a menu...Ch. 11.4 - Prob. 11.6CPCh. 11.4 - Prob. 11.7CPCh. 11.4 - When a program has a lot of items for the user to...Ch. 11 - Prob. 1MCCh. 11 - Prob. 2MC
Ch. 11 - If a menu-driven program uses a loop to redisplay...Ch. 11 - A program that uses a multiple-level menu displays...Ch. 11 - Prob. 5MCCh. 11 - When the user selects an operation from a...Ch. 11 - When the user selects an operation from a(n)...Ch. 11 - Prob. 1TFCh. 11 - It is not usually necessary to validate the user's...Ch. 11 - In most cases, a menu-driven program should be...Ch. 11 - If a menu-driven program does not use a loop to...Ch. 11 - In a single-level menu, the user might see a...Ch. 11 - What type of structure do you use in a program to...Ch. 11 - What ways for validating a users menu selection...Ch. 11 - How can you design a menu-driven program so that...Ch. 11 - When a program has a lot of items for the user to...Ch. 11 - Prob. 1AWCh. 11 - Design a case structure that can be used with the...Ch. 11 - Put the algorithms that you designed for questions...Ch. 11 - Look for ways to modularize the algorithm that you...Ch. 11 - Language Translator Design a program that displays...Ch. 11 - Prob. 2PECh. 11 - Prob. 3PECh. 11 - Astronomy Helper Create an application that...Ch. 11 - Golf Score Modification In Programming Exercise 6...Ch. 11 - Phone Book Program Design a program that you can...Ch. 11 - Prob. 7PE
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
What are the six common steps needed to access databases from a typical program?
Modern Database Management
Each repetition of a loop is known as a(n) a cycle ________. a. cycle b. revolution c. orbit d. iteration
Starting Out with Python (4th Edition)
What is an algorithm?
Starting Out With Visual Basic (8th Edition)
This optional Google account security feature sends you a message with a code that you must enter, in addition ...
SURVEY OF OPERATING SYSTEMS
software is generally feature complete, (supposedly) bug free and ready for use by the community.
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Suppose a manufacturer produces a computer chip and later discovers a flaw in its design. Suppose further that ...
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Using a random number generator, create a list of 500 integers using python. Perform a benchmark analysis using some of the sorting algorithms from this module. What is the difference in execution speed between the different sorting algorithms?arrow_forwardPersonal project Q5. This question is concerned with the design and analysis of recursive algorithms. You are given a problem statement as shown below. This problem is concerned with performing calculations on a sequence ? of real numbers. Whilst this could be done using a conventional loop-based approach, your answer must be developed using a recursive algorithm. No marks will be given if your answer uses loops. FindAverageAndProduct(a1, ...., an) such that n > 1 Input: A sequence of real values A = (a1, ..., an) Output:, A 2-tuple (average, product) containing the average (average) of all the values and the product (product) of all the values of the elements in A. Your recursive algorithm should use a single recursive structure to find the average and product values, and should not use two separate instances of a recursive design. You should not employ any global variables. (a) Produce a pseudo code design for a recursive algorithm to solve this problem. (b) Draw a call-stack…arrow_forwardPersonal project Q5. This question is concerned with the design and analysis of recursive algorithms. You are given a problem statement as shown below. This problem is concerned with performing calculations on a sequence A of real numbers. Whilst this could be done using a conventional loop-based approach, your answer must be developed using a recursive algorithm. No marks will be given if your answer uses loops. FindAverageAndProduct(a1, ...., an) such that n > 1 Input: A sequence of real values A = (a1, ...., an) Output:, A 2-tuple (average, product) containing the average (average) of all the values and the product (product) of all the values of the elements in A. Your recursive algorithm should use a single recursive structure to find the average and product values, and should not use two separate instances of a recursive design. You should not employ any global variables. (a) Produce a pseudo code design for a recursive algorithm to solve this problem. (b) Draw a call-stack…arrow_forward
- Two kinds of loops occur frequently in programming: counter-controlled loops and sentinel-controlled loops. Explain each kind of loop in terms of its implementation with your own examples. Q3.arrow_forwardUsing a random number generator, create a list of 500 integers in Python. Perform a benchmark analysis using some of the sorting algorithms from this module. What is the difference in execution speed between the different sorting algorithms and why? In your paper, be sure to provide a brief discussion of the sorting algorithms used in this activity. Your paper should be 2-3 pages in length (not including title and references pages) and conform to APA guidelinesarrow_forwardLook at both the iterative and recursive methods of solving problems, and see how they stack up against one another. When should you use recursion and when should you use iteration? As an alternative to relying on the examples provided in the presentation slides, explain why your point of view is correct.arrow_forward
- In what situation should you consider using arrays in your program? Explain why you should implement it.arrow_forwardSelf-Explanation Examine the factorial(num1) function (Step 1): Look at the while loop inside this function. Why do you think it is getting stuck in an infinite loop? Hint: What should happen to num1 during each loop iteration to eventually stop the loop? How can you modify the code to ensure num1 decreases in value each time through the loop? Write down your ideas. Explain the Fix: Once you’ve figured out how to stop the infinite loop, explain what line of code you would add to ensure that num1 eventually becomes 0, allowing the loop to terminate. What role does this line of code play in the overall function? Step 2: Explore the Modulo Operator Next, let's think about how you can implement the modulo operator in the next function. Look at the moduloPractice(num1) function (Step 2): The goal here is to return the remainder when num1 is divided by 9. If you’re unsure how the modulo operator works, revisit zyBooks to review it. How will you use the modulo operator to find the…arrow_forwardWhen an author produces an index for his or her book, the first step in this process is to decide which words should go into the index; the second is to produce a list of the pages where each word occurs. Instead of trying to choose words out of our heads, we decided to let the computer produce a list of all the unique words used in the manuscript and their frequency of occurrence. We could then go over the list and choose which words to put into the index. The main object in this problem is a "word" with associated frequency. The tentative definition of "word" here is a string of alphanumeric characters between markers where markers are white space and all punctuation marks; anything non-alphanumeric stops the reading. If we skip all un-allowed characters before getting the string, we should have exactly what we want. Ignoring words of fewer than three letters will remove from consideration such as "a", "is", "to", "do", and "by" that do not belong in an index. In this project, you…arrow_forward
- When an author produces an index for his or her book, the first step in this process is to decide which words should go into the index; the second is to produce a list of the pages where each word occurs. Instead of trying to choose words out of our heads, we decided to let the computer produce a list of all the unique words used in the manuscript and their frequency of occurrence. We could then go over the list and choose which words to put into the index. The main object in this problem is a "word" with associated frequency. The tentative definition of "word" here is a string of alphanumeric characters between markers where markers are white space and all punctuation marks; anything non-alphanumeric stops the reading. If we skip all un-allowed characters before getting the string, we should have exactly what we want. Ignoring words of fewer than three letters will remove from consideration such as "a", "is", "to", "do", and "by" that do not belong in an index. In this project, you…arrow_forwardhandwritten is needed. The process has to be how the images are: slide #59, 60, 61. The same process but with recursionprob(5).arrow_forwardIn the algorithmic world, the steps are very similar, but we can use simple loops to dowhat we are doing manually.This would translate to a set of steps as below:Step 1: Open a new spreadsheetStep 2: Create the header row in every worksheetStep 3: For each workbook from a storeFor each worksheet in the workbookRead rows 2 to last row that contains dataMove this row to the current rowAdvance to next rowNext worksheetNext workbookStep 4: Save workbook Write code for given algrithm.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Graphical User Interfaces: Crash Course Computer Science #26; Author: CrashCourse;https://www.youtube.com/watch?v=XIGSJshYb90;License: Standard YouTube License, CC-BY
Python GUI | How To Make A GUI In Python | Best GUI Framework In Python | Edureka; Author: edureka!;https://www.youtube.com/watch?v=_PHJvjQJa3w;License: Standard Youtube License