Free Essay

Modular Programming

In:

Submitted By phamastermason
Words 602
Pages 3
Introducing Algorithms Dedric D. Owens
PRG/211 – Algorithms and Logic for Computer Programming
October 28, 2013
John Rogers

Describe the Top-Down Approach to Algorithm Writing When developing a program, the top-down approach is more than not the preferred method. This is driven by what the program actually does; basically the function of the program. According to Penn State Lehigh Valley, “top-down design or stepwise refinement is an approach to designing an algorithm” and, there are four steps in this top-down design. These steps are as follows: You have to “understand the problem by thoroughly analyzing it.” Then, “formulate the algorithm by determining and writing the main tasks to be carried out as a sequence of general steps”. The third step is to “fill in more details by determining the sub-tasks, if any, for each main task. Lastly, “repeat step third step until you arrive at a precise algorithm expressed in terms of basic executable instructions.”
How is pseudo-code used to assist in writing an algorithm? Pseudo-code is defined as an outline of a program written in a form that can easily be converted into real programming statements. It is sometimes confused with an algorithm when developing a program. In reviewing Prelude to Programming: Concepts and Design, Fifth Edition, (para. 2.1, pg 72 an algorithm is “a step by step method for solving a problem or doing a task.” Pseudo-code uses short and easy to understand phrases in plain English language to describe the outline of a program. Being able to use pseudo-code for an algorithm will make writing the actual code that much easier.
Why is spaghetti code considered a problem? The use of the term spaghetti code leads to assumption that it is bad code. This is not necessarily the case. Spaghetti code is low-level code where everything is everywhere. What makes spaghetti code dangerous is that it, unlike other species of bad code, seems to be a common byproduct of software entropy. In a blog post by Timothy Boronczyk, he states that “The phrase "spaghetti code" is an all-too-common pejorative we programmers use to describe horrible code, whether it's difficult to understand, poorly organized, or just plain long-winded. And there-in lays the problem. What really constitutes spaghetti code is subjective; I've yet to hear a concrete definition or standard metric that measures it. Everyone has his or her own opinion as to what aspects would make them label it spaghetti.”
What are the three control structures that are the basis for writing a program?

The three control structures are the sequential (or sequence) structure, the decision (or selection) structure, and the loop (or repetition) structure. The following definitions of each structure are taken from Prelude to Programming: Concepts and Design (para 2.5, pg 99-). A “sequential structure consists of a series of consecutive statements, executed in the order in which they appear. A decision structure (also known as a selection structure) there is

a branch forward at some point, which causes a portion of the program to be skipped. A loop

structure (also known as a repetition structure) contains a branch back to a previous statement in

the program module, which results in a block of statements that can be executed many times.

References
Venit, S and Drake, E (2011). Prelude to Programming: Concepts and Design (5th ed.).
Cornut, C (2011). Timothy Boronczyk’s Blog: Spaghetti Code Considered Harmful. Retrieved from http://www.phpdeveloper.org/news/16367
Penn State Lehigh Valley. Algorithms. Retrieved from http://www2.lv.psu.edu/ojj/courses/cpp-lang/02algorithmsqa.html

Similar Documents

Free Essay

Hht Task 1

...A. Rounding and Truncation A1-A2. To determine if Student 1 will receive an A, we must first calculate the percentage. Divide the total points earned by the total points possible. THis gives us a solution of .895 or 89.5%. Next we round up to the nearest whole number. When rounding, we focus on the digit to the right of the digit we are trying to round. If it is 5 or greater, we round up by adding one. If it is less than 5, then we leave the digit alone. 89.5% rounds up to 90%. Student 1 will receive an A. If the teacher were truncate the grade, then the student would not receive an A. He/she would only have a 89% because we drop all digits to the right of the digit to be truncated. A3a. A taxpayer would hope for the tax rate to be truncated because they would owe less taxes. You are basically erasing everything behind the decimal with truncation. Thus the resulting number will always be smaller. This is ideal especially whenever dealing money owed. In this case the taxpayer would have a tax rate of 27%. A3b. The government obviously prefers taxpayers to round, due to the possibility of a higher tax rate. If the digit to the right of the digit to be rounded is 5 or greater, then we add a 1 when rounding. So in this example the tax rate would increase to 28%. Let’s say the taxpayer makes $80,000 a year. The government would be due an extra $800. Now if you multiply this by several taxpayers, and it’s evident how much more the government will benefit from simply rounding...

Words: 1016 - Pages: 5

Premium Essay

Bam 421 Operations Management Unit 4 Examination

...BAM 421 Operations Management Unit 4 Examination Follow Below Link to Download Tutorial https://homeworklance.com/downloads/bam-421-operations-management-unit-4-examination/ For More Information Visit Our Website ( https://homeworklance.com/ ) Email us At: Support@homeworklance.com or lancehomework@gmail.com BAM 421 Operations Management Unit 4 Exam 1. The aggregate plan gets input or feedback from which of the following areas? 2. engineering 3. finance, marketing and human resources 4. the master production schedule 5. procurement, production and general management 6. All of the above. 2. Which portion of the master production schedule is normally fixed, frozen or firm? 3. the entire schedule 4. only the aggregate schedule 5. only the middle of the schedule 6. only the near-term portion 7. only the far-term portion 3. In continuous (stock-to-forecast) operations, the master production schedule is usually expressed in terms of _______________. 4. end items 5. modules 6. kits 7. customer orders 8. warehouse orders 4. In job shop (make-to-order) operations, the master production schedule is usually expressed in _______________. 1. end items 2. modules 3. kits 4. customer orders 5. warehouse orders 5. A document calls for the production of 50 small garden tractors in week 1, 50 small garden tractors and 100 riding mowers in week 2, 100 riding mowers and 200 garden utility carts in week 3 and 100 riding mowers in week 4. This...

Words: 1260 - Pages: 6

Premium Essay

Effective Paragraph

...Characteristics of an Effective Paragraph • Direction: a strong topic sentence that states the main idea and sets the course of the paragraph. It answers the question, “What is your point?” • Unity: makes one main point and sticks to that point throughout the paragraph • Coherence: ideas in the paragraph are logically connected and easy to follow ------------------------------------------------- • Development: main idea is well supported with details, facts, examples, reasons, etc. Unity Unity refers to the extent to which all of the ideas contained within a given paragraph "hang together" in a way that is easy for the reader to understand. When the writer changes to a new idea -- one which is not consistent with the topic sentence of the paragraph -- the writer should begin a new paragraph. Unity is important because it aids the reader in following along with the writer's ideas. The reader can expect that a given paragraph will deal only with one main topic; when a new paragraph begins, this signals that the writer is moving on to a new topic. Consider the following example. Note that there are two main ideas presented in this paragraph. The topic sentence indicates that the paragraph will deal with the subject of "employees' attitudes," but the paragraph shifts unexpectedly to the topic of "management's attitudes." To achieve unity in this paragraph, the writer should begin a new paragraph when the switch is made from employees to managers. Example "Employees'...

Words: 1099 - Pages: 5

Premium Essay

Ppq Parts

...ABSTRACT Different software packages will be outlined with purpose. Extensive research about all packages needed is included. Each package detail with the systems pros and cons will be outlined and discussed in order to provide the appropriate software to meet our company’s needs. Introduction There are many software packages that are needed to properly operate businesses. In order to perform particular tasks, specific specialized software is needed. Material Requirements Planning Among the many operating software systems, one of the most important is the Material Requirements Planning (MRP) system. Material Requirements Planning is the system that manages the process of production planning and inventory. This system uses a technique of inventory, expected receipts, and bill of materials. This system also uses the Master Production Schedule (MPS) to determine the material requirements. There have been four main benefits of having a MRP system in your business. These benefits include, but are not limited to, better responses on customer orders, faster responses on market changes, improve utilization of facilities and labor, and reduced inventory levels (Heizer, J). Capacity Requirement Planning The Capacity Requirement Planning (CRP) is a method that many businesses use to determine the available production capacity. It will start off by assessing the schedule of production that the company has planned. It will then analyze...

Words: 689 - Pages: 3

Premium Essay

Cumberland Metal Industries: Engineered Products Division, 1980

...Cumberland Metal Industries: Engineered Products Division, 1980 • CMI was about to introduce a new product – curled metal cushion pads – an integral part of the process of driving piles • Curled metal cushion pads seemed to have more potential than any other product the company had every introduced • A successful introduction to the market could double the sales of the company as well as compensate for a decline of some existing product lines • The key factor was pricing of the new product which would have a significant impact on everything they do with it • Cushion pads prevented the shock of the hammer from damaging the hammer or pile. • Despite the importance of these pads to the pile-driving process, little attention had been paid to them by most of the industry. Hardwood blocks had been used and the performance of them was considered poor. Most of the industry had shifted to using asbestos pads, which performed adequately. • Cumberland Metal Industries (CMI) was one of the largest manufacturers of curled metal products in the country • Overtime, CMI evolved it’s philosophy from selling metal as a finished product to selling products that used it as a raw material • CMI purchased the wire from outside vendors and performed the flattening and curling operations in-house. The advantage gained in the manufacturing process was that any diameter pad could be produced. • CMI persuaded Colerick Foundation Company to try its pads on a project • Colerick first drove a number of pads...

Words: 397 - Pages: 2

Premium Essay

Business

...Cooper Industries Inc. Based on the given information in the case study regarding the acquisition of Nicholson File Company by Cooper Industries, there is no question that Cooper should try to gain control of Nicholson. This decision is based on an analysis of the bargaining positions of each group of Nicholson stockholders which have disparate goals and needs that need to be met. In addition, an appropriate payment method and specific dollar value based on a competitor's offer and Cooper financial data was decided. The remainder of this paper will provide the analysis and rationale for this determination. Should Cooper Industries Acquire Nicholson File Company? Cooper Industries has been expanding through diversification since 1996. Cooper's requirements to acquire a company has three major components. The target company must be: 1. In an industry in which Cooper could become a major player 2. In an industry that is fairly stable, with a broad market for the products and a product line of ‘small ticket' items; and 3. A leader in its market segment. When looking at the criteria that Cizik's company (Cooper Industries), set forth relative to acquisitions, the acquisition of Nicholson meets all three objectives plus has significant potential short and long-term potential. Cooper management feels that by eliminating redundancy and streamlining Nicholson's operations this potential can be realized. Currently, Nicholson's financial history boasts a 2% increase in profit annually...

Words: 284 - Pages: 2

Premium Essay

Quantitavi Methods

...1. Prove that fx=2x+5 is one-to-one function. 2. Let f: A→B, as given below. Is f a one-to-one function? Please explain why or why not. B A f 5 5 1 3 1 6 2 2 4 6 7 4 8 3 3. The modulo function (a mod n or a modulo n) maps every positive integer number to the remainder of the division of a/n. For example, the expression 22 mod 5 would evaluate to 2 since 22 divided by 5 is 4 with a remainder of 2. The expression 10 mod 5 would resolve to 0 since 10 is divisible by 5 and there is not a remainder. a. If n is fixed as 5, is this function one-to-one? b. List five numbers that have the exact same image. 4. Find limn→∞n2-1n3+n 5. Find limx→∞x1001-xx1000+x 6. Find limx→∞8x6+4x4-3x2x6+x5-7 7. Find lim2x99+x+1,000,000x100+2,000,000 as x→0 8. Prove that fx=x2+7 is a continuous function. 9. Find derivatives of the following functions using differentiation rules. (Do not use the definition of a derivative!) c. fx=2x+5 d. fx=2x5+x3-6x+100 e. fx=ex+2(4x-1) f. fx=7ex g. fx=x2(x-1) h. fx=3x2+7 i. fx=ex(2x+5) j. fx=ex+2+4x-1 10. Find the derivative of the following function at : fx=2x3+x2+9 11. Find the derivative of the following function fx=2x2-x using the definition of a derivative. (Hint:...

Words: 337 - Pages: 2

Free Essay

Paper

...september 16,200x Tellememer Insurace Company, 25 Main St, Suite R Albuquerque,nm 87122 Dear Sir or Madam, RE: Ron Emerson, I understand from Mr.Emerson that the insurace company feels that the changes for my sercice on July 30,200x,are excessive. Mr.Emerson was seen on an early sunday morning with a stab wound in the cheast, which had penetrated his lung producing an air leak into his chest wall. In addition, he had a laceration of his lung. After consulation and review of his x-rays, his laceration was repaired. He was observed in the hospital for 2 days, to be sure that he did not have continuing hemmorrhage or collapse of his lung. I feel, that the bill given to Mr.Emerson is a fair one.Wereceived on July 31,200x, a Tellememer Insurance Company check for $200: and feel that, your payment of $180 is unreasonable.It is doubtful,that one could get a plumber to come out early Sunday morning to fix a leaky pipe for $200; and Mr.Emerson's situation in my opinion,was much more serious then would be encountered by a plumber. We will bill Mr.Emerson for the remainder of the $680 balanceon his account but i want you to know,that we feel that your payment is insufficient.If he feels that the bill is excessive,we would be glad to submit to arbitration through the County Medical Society Fee Committee.If this fails,I suggest we seek help through the New Mexico Insurance Commission. Sincerely Yours, William A. Berry, Md rl Encolsed:...

Words: 275 - Pages: 2

Free Essay

Mrp, Erp, Cad/Cam

...1.0 MATERIAL REQUIREMENTS PLANNING (MRP) DEFINITION Material requirements planning (MRP) is a production planning and inventory control system used to manage manufacturing processes. It is the process that helps companies makes volume and timing calculation. Most of MRP is based on the software, sometime company use the existing software and make the new software based on the company wants. The objectives of MRP system are to: • Ensure materials are available for production and products are available for delivery to customers. • Maintain the lowest possible material and product levels in store. • Plan manufacturing activities, delivery schedules and purchasing activities. • Required goods are available when required at a right place and time. • Reduce storage and inventory holding cost and improve customer service. MRP system typically requires certain data records which the MRP programs checks and update. The chart below shows the information required to perform MRP and some of the output. Customer order record exactly what each customer has ordered, how many they ordered and when they required delivery. Forecast demand using historical data to predict future trends, cycle and seasonality is always difficult. This process is more to predict of the orders. Inventory record in MRP is to know how some of the required items already in stock. This stock may be in the progress or in raw of material. Bills of the material contains detailed...

Words: 1673 - Pages: 7

Premium Essay

Barilla Spa

...Barilla SpA (Written Case Report) By Imran Chaudhry Overview: Barilla SpA one of the world’s largest pasta producer has growing burden of demand fluctuations and venialities on its manufacturing and distribution system. Giorgio Maggiali as director of logistics trying to implement idea of JITD (Just-in Time Delivery) so that Barilla’s own logistics department could manage more effectively delivery quantities and meet end consumer’s needs and more evenly distribute the workload on its manufacturing and logistics systems. Giorgio Maggiali after couple of years of efforts to implement the idea has not been successful and could not make significant progress. Problems to implement JITD The problems and weaknesses Giorgio Maggiali has to implement the JITD are: • Barilla’s distributors unwilling to support the idea as they do not want to give up their authority to place and order and lose control over it • Distributors reluctant to provide sales data upon which Barilla could forecast demand and make decisions to improve delivery and manufacturing, as a result Barilla is relying on distributors demands, which is having bullwhip effect for Barilla. • Barilla’s own marketing and sale people resisting the idea. Bullwhip Effect: Bullwhip Effect is a phenomenon in supply chain where distorted information is passed through large variations and swings in demand Barilla’s Distribution system: Barilla has divided its product line into Dry which represents...

Words: 418 - Pages: 2

Free Essay

Maths

...STUDENT NOTES SERIES SMA6014 - Modern Algebra and Geometry Norashiqin Mohd Idrus Shahrizal Shamsuddin Department of Mathematics, Faculty of Science and Mathematics, Universiti Pendidikan Sultan Idris (Semester 1 Session 2014/2015) Contents 1 Fundamentals 1.1 History of Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.1 1.1.2 1.2 1.2.1 1.2.2 1.2.3 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4 1.5 1.4.1 1.5.1 1.5.2 1.5.3 1.5.4 1.6 1.6.1 1.6.2 1.6.3 Classical Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modern Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 1 1 1 2 3 6 7 7 8 8 9 9 Logic and Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Methods of Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Proof by Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . Basic Notion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Subsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Operations on Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . Power Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Cartesian Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Relations . . . . . . . . . . . . . . . . . . . . . . . . ....

Words: 6227 - Pages: 25

Free Essay

Case 1-1

...Case 1 Maria Hernandez & Associates In June 2001,Maria Hernandez found herself out of a job for the second time in six months. As she left the building that had housed her failed dot-com employer, carrying a small box of personal belongings, her mind was already embracing a plan that would have her start her own business. At least, in her own business she would control part of her own destiny instead of being subject to the decisions of others. Hernandez was a graduate of the Massachusetts College of Art. After working three years for an advertising agency where she specialized in advertising layout. she used part of her savings to take a technical course in webpage design. Her first job after completing her training was with a startup retail dot-com that ran through its initial cash and loans in less that one year. It took her only one week to find her latest employer, but in less than six months it had folded, too. She loved her work as a webpage designer, and she had confidence in her own abilities and skill. Her art training allowed her to blend design. color, and web-page layout in attractive and effective ways. But having been burned twice by startup dot-com employers, she was also reluctant to go to work for a third. Within days she had put together a simple business plan to create a webpage design consultancy to offer webpage designs to anyone. She would head the company and employ other designers as well to meet demand. There were plenty of potential customers...

Words: 965 - Pages: 4

Premium Essay

Cooper Industries Inc

...Cooper Industries Inc. Based on the given information in the case study regarding the acquisition of Nicholson File Company by Cooper Industries, there is no question that Cooper should try to gain control of Nicholson. This decision is based on an analysis of the bargaining positions of each group of Nicholson stockholders which have disparate goals and needs that need to be met. In addition, an appropriate payment method and specific dollar value based on a competitor's offer and Cooper financial data was decided. The remainder of this paper will provide the analysis and rationale for this determination. Should Cooper Industries Acquire Nicholson File Company? Cooper Industries has been expanding through diversification since 1996. Cooper's requirements to acquire a company has three major components. The target company must be: 1. In an industry in which Cooper could become a major player 2. In an industry that is fairly stable, with a broad market for the products and a product line of ‘small ticket' items; and 3. A leader in its market segment. When looking at the criteria that Cizik's company (Cooper Industries), set forth relative to acquisitions, the acquisition of Nicholson meets all three objectives plus has significant potential short and long-term potential. Cooper management feels that by eliminating redundancy and streamlining Nicholson's operations this potential can be realized. Currently, Nicholson's financial history boasts a 2% increase in profit...

Words: 270 - Pages: 2

Premium Essay

Integrated Information Management

...Check Point Integrated Information Management Holly Regan HSM/220 Melissa Lichau September 25, 2013 ------------------------------------------------- Integrated Information Management ------------------------------------------------- There are four external considerations and six internal considerations for developing an integrated information management system. The first external consideration is economic, this refers to what is needed and expected from funding sources, contributors, referral sources, and consumers in order for the organization to keep track of its income. The second external consideration is sociological and this refers to basic demographics of people living in the community such as age, ethnic group, or gender and this information is pertinent to knowing your target population. The third external consideration is political and this is where the data and information expectations from regulatory bodies, an accrediting organization, or a board of directors comes from and is necessary so everyone is aware of their job responsibilities. The fourth external consideration is technological. Having technological advancements ensure the agency will be able to remain current in the identification of developing technologies. ------------------------------------------------- The first of six internal considerations is organizational purpose and these refer to the need for factors and variables to be tracked. The second internal consideration is organizational...

Words: 358 - Pages: 2

Free Essay

Material Requirements Planning

...Material Requirements Planning Material requirements planning is used for production planning and inventory control.  There are 2 methods, one is using software the other is manually tracking all the moving parts. The three main objectives of MRP are: 1) Ensure all materials are available for production and products are available for delivery to customers. 2) Maintain optimal inventory levels 3) The planning of manufacturing activities, delivery schedules and purchasing activities. MRP was one of the first integrated info systems focused on improvements in the productivity for businesses. This was one of the first time managers would get meaningful data to analyze resulting in efficiency being greatly improved.  Manufacturing companies, for example, were now able to solve problems such as what items were required, how many were required and when they are required. This allowed companies to stop over spending and under producing. Over time the data and technology driving these systems became more advanced and was integrated with other parts of the manufacturing business. MRP also has a lot of the same downfalls as user input software. If the wrong bill of materials, scheduling, inventory item, etc. is not put in correctly the downstream impact can be very large.   In 2011 a new type of MRP called Demand Driven MRP was introduced.  It was made up of 5 distinct components: 1) Strategic Inventory Planning 2) Buffer Profiles and Level 3)...

Words: 270 - Pages: 2