Using the previous workshop, solve these problems by using the pseudocode only not javascript code In the
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In the Programmer's Workshop, you study a business problem and develop an Algorithm for a solution as a programmer would approach it. For this problem, you use pseudocode as the programming tool. In future modules, you use other tools, including flowcharts and JavaScript. These problems help you put together what you've learned in the module, paying special attention to good programming style. Problem: Sunshine Books is a bookstore that's open every morning from 8:00 am to 12:00 pm. The manager wants information about the number of customers in the store at different times. A clerk, whose station is near the door, counts customers by making a mark on a piece of paper each time a customer enters. The paper is divided into four segments, one for each hour, and the clerk notes the time before making each mark. When the store closes at noon, the clerk wants to enter the numbers in the program, which then displays the total number of customers for the day and the average number of customers per hour. Your job, as the programmer, is to develop an algorithm by using pseudocode. If the manager likes your pseudocode proposal, you might be invited back to write the program in an actual computer language. Discussion: Use the IPO method to get started: What outputs are requested? Total Customers and average customers per hour What inputs are available? Number of customers for each hour What processing is required? Get input, add numbers for total, and divide by number of hours for average The next step is deciding what variables and constants you need. You need a variable for each item you want to keep track of (that is, each input and output) and sometimes a temporary variable for calculations. You should use a constant when you know ahead of time how many of something you have. Choose your variables and constants, giving them the following names and data types: Total Customers (numeric): totCust Average customers per hour (numeric): avgCust Count of customers each hour (numeric): count1, count2, count3, count4 Number of hours (numeric constant): NUM_HOURS 1. Open a new file in Notepad and save it as customerStats.txt 2. Start by entering your four documentation items, substituting your name for the author name and today's date for the date last modified: // Program Name: Customer Statistics //Purpose: Compute total and average number of customers over 4 hours // Author: Adrian Tillman // Date Last Modified: 01-13-2018 In the Programmer's Workshop, you study a business problem and develop an Algorithm for a solution as a programmer would approach it. For this problem, you use pseudocode as the programming tool. In future modules, you use other tools, including flowcharts and JavaScript. These problems help you put together what you've learned in the module, paying special attention to good programming style. Problem: Sunshine Books is a bookstore that's open every morning from 8:00 am to 12:00 pm. The manager wants information about the number of customers in the store at different times. A clerk, whose station is near the door, counts customers by making a mark on a piece of paper each time a customer enters. The paper is divided into four segments, one for each hour, and the clerk notes the time before making each mark. When the store closes at noon, the clerk wants to enter the numbers in the program, which then displays the total number of customers for the day and the average number of customers per hour. Your job, as the programmer, is to develop an algorithm by using pseudocode. If the manager likes your pseudocode proposal, you might be invited back to write the program in an actual computer language. Discussion: Use the IPO method to get started: What outputs are requested? Total Customers and average customers per hour What inputs are available? Number of customers for each hour What processing is required? Get input, add numbers for total, and divide by number of hours for average The next step is deciding what variables and constants you need. You need a variable for each item you want to keep track of (that is, each input and output) and sometimes a temporary variable for calculations. You should use a constant when you know ahead of time how many of something you have. Choose your variables and constants, giving them the following names and data types: Total Customers (numeric): totCust Average customers per hour (numeric): avgCust Count of customers each hour (numeric): count1, count2, count3, count4 Number of hours (numeric constant): NUM_HOURS 1. Open a new file in Notepad and save it as customerStats.txt 2. Start by entering your four documentation items, substituting your name for the author name and today's date for the date last modified: // Program Name: Customer Statistics //Purpose: Compute total and average number of customers over 4 hours // Author: Adrian Tillman // Date Last Modified: 01-13-2018
Expert Answer:
Answer rating: 100% (QA)
Program Name Recyclying Calculator Purpose Compute the amount of newspapers to bring per ... View the full answer
Related Book For
John E Freunds Mathematical Statistics with Applications
ISBN: 978-0134995373
8th edition
Authors: Irwin Miller, Marylees Miller
Posted Date:
Students also viewed these accounting questions
-
This spreadsheet can be used to calculate the amount of prepaid interest a buyer will need to pay at the closing. Write formulas for cells B9, B10, and B11. 1 Enter the loan amount. 3 Enter the...
-
Laboratory 7: List and String Review the related lecture note(s), and finish exercises below. 1. Write a Python program to create a list (named lab7.py): Create a list named myList and initialize it...
-
I want to write a java program to calculate the letter grades of each student in the class based on the scale shown on the course overview and the syllabus. Which type of decision structure would be...
-
In the OKR goal-setting framework, what is the difference between objectives and key results? Objectives deal with measurable aspects of a company's processes, while key results deal with...
-
China Petroleum & Chemical Corporation (known as Sinopec), introduced in Chapter 15, is an integrated energy and chemical company. The principal operations of Sinopec Corp. and its subsidiaries...
-
In Prob. 3.26, determine the perpendicular distance from point C to a line drawn through points A and B. Problem 3.26: A wooden board AB, which is used as a temporary prop to support a small roof,...
-
Dr. Walter Sullivan was one of several plastic surgeons in Las Vegas visited by Julie Jones. Jones, an exotic dancer, sought plastic surgery to improve her ability to make money in her profession....
-
Pearl Glaze adds direct materials at the beginning of its production process and adds conversion costs uniformly throughout the process. Given the following information from Pearls records for July...
-
At some point in the life of a company or firm, a decision of how to expand is necessary. This is especially important in for-profit firms as shareholders typically require larger and larger...
-
Determine the force in each member of the space truss and state if the members are in tension or compression. The support reaction at E acts along member EB. Why? 2 m. E Co B 5 m 3 m 3 m 4 m 6 KN
-
You are a venture capitalist considering a $1.5 million investment in Floating Line Electronics Apparatus, Inc. (FLEA) that is expected to require no additional capital through year 3. FLEA is...
-
Imagine you are Rip Van Winkle's daughter, Judith, writing a journal entry after her father reappears after 20 years. Try to get into the mind of Judith. Be imaginative and creative. Pretend you are...
-
What's the price of a $50 par value 7% preferred share if the required rate of return is 8%?
-
A bank offers to syndicate a Eurodollar loan for an MNC. The MNC has a credit risk rating of AA. Loan Type: Bullet Principal: USD 21 million Maturity: 4 years Upfront Syndication Fee: 1.95% Interest...
-
Answer the following prompts Your overall impression of book Choose two areas you felt reflected you. Explain why you were drawn to the sections. Please use examples within your discussion from text...
-
On January 1, 2023, Ryan Company paid the premium on a four-year insurance policy in the amount of $8,400. At that time, the full amount paid was recorded as prepaid insurance. After recording the...
-
A trust where property is placed in trust which must provide a distribution of a fixed percentage of not less than 5 percent of the fair market value of the trust property to a noncharitable income...
-
4. Jobe dy -Y 2 et by
-
It is desired to test whether the number of gamma rays emitted per second by a certain radioactive sub-stance is a random variable having the Poisson distribution with = 2.4. Use the following data...
-
When the xs are equally spaced, the calculation of and can be simplified by coding the xs by assigning them the values . . . ,- 3,- 2,- 1, 0, 1, 2, 3, . . . when n is odd, or the values . . . ,- 5,-...
-
Using the data of Exercise 14.99, In exercise (a) Create a new variable, x 2 2 . (b) Fit a surface of the form (c) Find the correlation matrix of the three independent variables. Is there evidence of...
-
Find a differential equation obeyed by geodesics in a plane using polar coordinates \(r, \theta\). Integrate the equation and show that the solutions are straight lines.
-
Find two first-order differential equations obeyed by geodesics in threedimensional Euclidean space, using spherical coordinates \(r, \theta, \varphi\).
-
Two-dimensional surfaces that can be made by rolling up a sheet of paper are called developable surfaces. Find the geodesic equations on the following developable surfaces and solve the equations....
Study smarter with the SolutionInn App