...Programming Logic and Design, 6th Edition Chapter 6 Exercises 1. a. Design the logic for a program that allows a user to enter 10 numbers, then displays them in the reverse order of their entry. Answer: A sample solution follows Flowchart: Pseudocode: start Declarations num index num SIZE = 10 num numbers[SIZE] = 0,0,0,0,0,0,0,0,0,0 getReady() while index < SIZE getNumbers() endwhile finishUp() stop getReady() index = 0 return getNumbers() output “Enter a number for position ”, index input numbers[index] index = index + 1 return finishUp() output “The numbers in reverse order are: ” while index > 0 index = index – 1 output numbers[index] endwhile return b. Modify the reverse-display program so that the user can enter up to 10 numbers until a sentinel value is entered. Answer: A sample solution follows Flowchart: Pseudocode: start Declarations num index num SIZE = 10 num numbers[SIZE] = 0,0,0,0,0,0,0,0,0,0 string CONTINUE = “Y” string moreNumbers = CONTINUE getReady() while index < SIZE AND moreNumbers equal to CONTINUE getNumbers() endwhile finishUp() stop getReady() index = 0 output “Do you want to enter a number? (Y/N)” input moreNumbers return getNumbers() output “Enter a number for position ”, index input numbers[index] index = index...
Words: 4366 - Pages: 18
...4.1. Структура компьютера — это: * ------------------------------------------------- 1) комплекс электронных устройств, осуществляющих обработку информации * ------------------------------------------------- 2) некоторая модель, устанавливающая состав, по- рядок и принципы взаимодействия входящих в нее компонентов * ------------------------------------------------- 3) комплекс программных и аппаратных средств. 4.2. Основная функция ЭВМ: * ------------------------------------------------- 1) общение человека и машины * ------------------------------------------------- 2) разработка задач * 3) принцип программного управления. 4.3. Персональный компьютер состоит из: * ------------------------------------------------- 1) системного блока * ------------------------------------------------- 2) монитора * ------------------------------------------------- 3) клавиатуры * ------------------------------------------------- 4) дополнительных устройств * 5) комплекса мультимедиа. 4.4. Системный блок включает в себя: * ------------------------------------------------- 1) системную плату * ------------------------------------------------- 2) блок питания * ------------------------------------------------- 3) модулятор-демодулятор * ------------------------------------------------- 4) накопители на дисках * ------------------------------------------------- 5) платы расширений * 6) средства связи и коммуникаций...
Words: 3164 - Pages: 13
...Austin Jones Ch. 2 Multiple Choice 1. A 2. A 3. D 4. B 5. A 6. C 7. C 8. A 9. B 10. D 11. B 12. A 13. C 14. A 15. D 16. B 17. B 18. C 19. D 20. A True or False 1. FALSE 2. TRUE 3. FALSE 4. TRUE 5. FALSE 6. TRUE 7. TRUE 8. TRUE 9. FALSE 10. FALSE Short Answer 1. Figure out what the user wants and how it can be mathematically solved. 2. pseudocode is "fake" code, or code without syntax 3. Sequence, Decision and Iteration 4. The program is easy for the user to navigate through and use. 5. the name and what kind of data type it will hold 6. nothing. Algorithim Workbench 1. Display “Height” Input Height Display “here is the height that you entered:” , height 2. Display “Favorite color” Input favorite color Display “Here is your favorite color you entered:” , color 3. b = a + 2 a = b * 4 b = a/3.14 a = b - 8 4. a. Set result = x + y b. Set result = z * 2 c. Set result = y / x d. Set result = y – z result = x++ - y; Answer -4 result = 4 – 8 = -4 result = ++w + y; Answer w = w + 1 = 5 + 1 = 6 result = 6 + 8 = 14 5. Declare Real price= 0.00 Display "the original price." Input item original price Display "price" 6. Declare Real price= 0.00 Display "the original price." Input item original price Display "price" 7. count := 27...
Words: 253 - Pages: 2
...12/11/2013 Digital Logic Design CSE-241 Unit 21 4-bit Asynchronous Counter: 2 Muhammad Usman Arif 12/11/2013 1 12/11/2013 MODULUS OF A COUNTER: The modulus of a counter is the number of unique states that the counter will sequence through. The maximum possible number of states (maximum modulus) of a counter is 2n. Where n is the number of flip-flops in the counter. TRUNCATED SEQUENCES: Counters can also be designed that have a number of states in their sequence that is less than the maximum of 2n.the resulting sequence is called a truncated sequence. Muhammad Usman Arif 3 12/11/2013 ASYNCHRONOUS DECADE COUNTER: To obtain a truncated sequence, it is necessary to force the counter to recycle before going through all of its possible states. For example, the BCD decade counter must recycle back to the 0000 state after the 1001 state. One way to make the counter recycle after the count of nine (1001) is to decode count ten (1010) with a NAND gate and connect the output the clear (CLR) input. 4 Muhammad Usman Arif 12/11/2013 2 12/11/2013 ASYNCHRONOUS DECADE COUNTER: 5 Muhammad Usman Arif 12/11/2013 PARTIAL DECODING: Notice in the figure that only Q1 and Q3 are connected to the NAND gate inputs. This arrangement is an example of partial decoding; in which the two unique states (Q1 = 1 and Q3 =1 ) are sufficient to decode the count of ten because none of the other states (zero through nine) have...
Words: 492 - Pages: 2
...Discussion Responses: My Teaching Philosophy My teaching philosophy is to make sure that each child gets a quality education. To what end: My objective as a teacher is to make sure that all students are focus and on task, so that they can learn. Also, it is important to instill in them the importance of getting an education. I would like to teach them their academic and much more. By what mean: In order to teach someone you have to be taught, I do not know of anyone that was born knowing everything. Therefore, my goal is to teach them to the best of my ability and know my job and know what I am doing. To what degree: After teaching an individual there will come a time that they will have to show what they know. A good way to find out that they are learning is to give an assessment or a test. In that instance I will start evaluating them by grading. Once I am done with the grading process, I will then know where I stand as their teacher and know where they stand as the student. Why: I feel that there need to be quality and educated trained teachers to work hard and get the job done. I have worked in the school system now for three years and I know it takes a good hearted person to be a teacher. Also, I feel that one should have love and compassion for which they are reliable for. When I do become a teacher I plan to make a difference in the education world. Zero Tolerance Policy The zero tolerance policy is definitely a great thing to have. I feel that...
Words: 388 - Pages: 2
...Programming Logic and Design, 6th Edition Chapter 2 Exercises 1. Explain why each of the following names does or does not seem like a good variable name to you. Answer: Answers will vary. A possible solution: a. | c | – | Valid, but probably too short to be descriptive | b. | cost | – | Good | c. | costAmount | – | Good, but redundant | d. | cost amount | – | Invalid, spaces aren’t allowed | e. | cstofdngbsns | – | Valid, but difficult to read | f. | costOfDoingBusinessThisFiscalYear | – | Valid, but long and awkward | g. | costYear2012 | – | Good | h. | 2012YearCost | – | Invalid, cannot start with a digit | 17 2. If myAge and yourRate are numeric variables, and departmentName is a string variable, which of the following statements are valid assignments? If a statement is not valid, explain why not. Answer: a. | myAge = 23 | – | Valid | b. | myAge = yourRate | – | Valid | c. | myAge = departmentName | – | Invalid, cannot assign string to numeric | d. | myAge = “departmentName” | – | Invalid, cannot assign string to numeric | e. | 42 = myAge | – | Invalid, cannot assign a value to a literal constant | f. | yourRate = 3.5 | – | Valid | g. | yourRate = myAge | – | Valid | h. | yourRate = departmentName | – | Invalid, cannot assign string to numeric | i. | 6.91 = yourRate | – | Invalid, cannot assign a value to a literal...
Words: 1719 - Pages: 7
...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 Flowchart: Pseudocode: start Declarations num number housekeeping() number = 1 while number 99999 output “Please enter a valid zip code” input custZip endwhile return validateCustAge() while custAge < 10 OR custAge > 110 output “Please enter a valid customer age” input custAge endwhile return validateNumItems() Declarations num attempts = 0 num LIMIT = 2 validNumItems = 1 while (numItems < 1 OR numItems > 12) AND attempts < LIMIT output “Please reenter the number of items” input numItems attempts = attempts + 1 endwhile if attempts = 2 AND numItems < 0 then output “An invalid number of items was entered” output “This order will not be counted” validNumItems = 0 endif return housekeeping() output ZIP_PROMPT input custZip return detailLoop() output AGE_PROMPT input custAge output ITEM_PROMPT input numItems validateZipCode() validateCustAge() validateNumItems() ...
Words: 1493 - Pages: 6
...PT1420 Wk 3 Unit 3 James W. Norris, II April 14, 2013 What is reverse engineering? Ans: Reverse Engineering is taking apart an abject to see how it works in order to duplicate or enhance the object. This practice is frequently used on computer hardware and software. What are the advantages and disadvantages of using reverse engineering to discover the logics of a software program? Ans: Software reverse engineering is done to retrieve the source code of a program because the source code was lost, to study how the program performs certain operations, to improve the performance of a program, to fix a “bug” or error in the program.Hardware reverse engineering involves taking apart a device to see how it works. If a processor manufacturer wants to see how a competitor’s processor works, they can purchase a competitor’s processor, disassemble it, and then make a processor similar to it. Find any one tool available to perform reverse engineering of software programs. What are at least five features of that tool? Ans: One tool used is a hexadecimal dumper, which prints and displays the binary numbers of a program in hexadecimal format(which is easier to read than a binary format. Short Answer Questions: 5. What two things must you normally specify in a variable declaration? Ans: The variable’s name and the variable’s data type 6. What value is stored in uninitialized variables? Ans: zero Algorithm Workbench 3. Write assignment statements...
Words: 266 - Pages: 2
...Purpose: Calculate the result of a number raised to the power of another number input by the user using iterative logic without overflow of 32-bit integers## //Program start// START //declare variables // declare unsigned int base, exp, answer, errorInput, errorOutput Declare var string exit Global var constant int multiply = 1, maxValue = 2147483647 Set answer = 1 Set base = 1 Set exp = 1 // determine if input fits in unsigned 32 bit int and set exit sentinel // //welcome message// Display “This program will determine the value of an integer (X) raised to the power of a second integer (N).” WHILE exit !=n //set repeat of input if error message is flagged and reset error flags// DO SET errorInput = 0 Set errorOutput = 0 //user input prompts// Display “Please Enter first integer: “ Input base Display “Please enter second integer: ” Input exp IF (base,exp) >= maxValue THEN //error message// Display “ Error! Value exceeds maximum available input. Please enter a value less than 2147483647” SET errorInput = 1 END IF WHILE errorInput = 1 //perform calculation with iterative multiplication// //check for error outputs & unneccessary execution of loop// IF exp != 0 THEN FOR (errorOutput ! =1 && multiply maxValue THEN SET errorOutput = 1 END IF END FOR //end calculation and check for maximum value overflow...
Words: 266 - Pages: 2
...engineering as a method is not confined to any particular purpose, but is often an important part of the scientific method and technological development. The process of taking something apart and revealing the way in which it works is often an effective way to learn how to build a technology or make improvements to it. When reverse engineering software, researchers are able to examine the strength of systems and identify their weaknesses in terms of performance, security, and interoperability. The reverse engineering process allows researchers to understand both how a program works and also what aspects of the program contribute to its not working. • What are the advantages and disadvantages of using reverse engineering to discover the logics of a software program? Reverse engineering in software is reversing a program's machine code back into it's original source code. The advantages to using this technique is that one can repair certain bugs, see how a program operates, and improve the operation of the program. The disadvantage is that certain other bugs may be introduced during this process. • Find any one tool available to perform reverse engineering of software programs. What are at least five features of that tool? REC Studio 4 - Reverse Engineering Compiler Multihost: Rec Studio runs on Windows XP/Vista/7, Ubuntu Linux, Mac OS X. Symbolic information support using Dwarf 2 and partial recognition of Microsoft's PDB format. C++...
Words: 301 - Pages: 2
...BSA/375 07 Aug 2014 ARCHITECTURE DESIGN According to Joseph S. Valacich, (2012) the four basic parts of information systems software consists of four parts: presentation logic, data access logic, application logic and data. The basic components for hardware is servers, networking, and client computers. The primary objective of an architecture design is the description of how information systems hardware components and software work together. For Riordan Manufacturing Human Resources the recommended architecture is to switch to a cloud based solution. This would be an upgrade from Riordan’s current architecture. The cloud based solution will meet the functional and non-functional requirements and project constraints. SECURITY CONTROLS System security is necessary to protect information systems against threats from hackers, weather, and power outages. Security protects systems against interruption and data loss. The four parts of security controls are data protection, authentication, encryption, and authorization. Data protection consists of data loss recovery and encryption. Authorization allows users to interact with a certain resource. Authentication validates the identity of all users. Since Riordan’s HR system will be a cloud based solution there is some cause for concern. Cloud based solutions are managed by third party vendors which means that none of the data will be stored on site which will require data encryption. Riordan should also take extra step to...
Words: 370 - Pages: 2
...Removing Subjectivity: Wittgenstein, Carnap and Modernist Architecture. Peter Morton 1. Introduction In this paper I want to address the coincidence of two powerful cultural forces of the early 20th century: modernist design in architecture and the philosophy of logical empiricism. This coincidence is most dramatically represented in the connection between two groups, who have each had powerful cultural influence in this century: The Bauhaus (1919 - 1933: Weimar, Dessau, Berlin, Chicago) The “Vienna Circle” (1922 - 1938: Vienna, Amsterdam. The former became the premier school of modernist design, and contained as faculty many of the most influential artists, designers and architects of the century. The Vienna Circle was a group consisting mostly of non-philosophers, who met weekly for discussion of philosophical issues. These informal meetings brought about the birth of logical empiricism, a movement which set the agenda for philosophy in America after the second world war. Herbert Feigl, Otto Neurath and Rudolph Carnap, central participants in the Vienna Circle, gave public lectures at the Bauhaus beginning in summer of 1929, when the Bauhaus was in Dessau under the leadership in Hannes Meyer. Their influence was sufficiently strong that logical empiricist philosophy became part of the standard curriculum of the school. A second very clear connection between modernist architecture and logical empiricism is the work of Ludwig Wittgenstein...
Words: 3702 - Pages: 15
...prevent actual crime Describe the design of the study. * In Philadelphia, their resources consisted of 60 patrol locations; researchers identified the highest violent crime corners in the city, using data from 2006 to 2008. Police commanders designed 120 foot patrol areas around these corners, and stratified randomization was used to assign pairs of foot patrols with similar crime rates as either a comparison or a target area. * Officers generally patrolled in pairs with two pairs assigned to each foot patrol. They worked from Tuesday morning to Saturday night in two shifts (10am to 6pm, 6pm to 2am). Identify an operational definition used by the researchers. * An operational definition used by researchers is describing a foot patrol as a police officer working on foot throughout their beat or assigned area rather than utilizing a vehicle. Provide one example of inductive logic and one example of deductive logic presented in the results. * An example of inductive reasoning is foot patrol beats returned to their pre-experiment crime levels once the foot patrol experiment was concluded. Foot patrol is more likely to conduct pedestrian stops and deal with disorder and drug offenses while car patrol handled the vast majority of reported crime incidents is an example of deductive reasoning. Identify whether the research study is a quantitative or qualitative design. Explain your answer. * The research was qualitative design. The research conducted was analyzed...
Words: 512 - Pages: 3
...shift_register.ngr Top Level Output File Name : shift_register Output Format : NGC Optimization Goal : Speed Keep Hierarchy : NO Design Statistics # IOs : 8 Cell Usage : # BELS : 4 # INV : 1 # LUT3 : 3 # FlipFlops/Latches : 3 # FDC : 3 # Clock Buffers : 1 # BUFGP : 1 # IO Buffers : 7 # IBUF : 4 # OBUF : 3 ========================================================================= Device utilization summary: --------------------------- Selected Device : 2s15cs144-6 Number of Slices: 2 out of 192 1% Number of Slice Flip Flops: 3 out of 384 0% Number of 4 input LUTs: 4 out of 384 1% Number of IOs: 8 Number of bonded IOBs: 8 out of 86 9% Number of GCLKs: 1 out of 4 25% --------------------------- Partition Resource Summary: --------------------------- No Partitions were found in this design. --------------------------- ========================================================================= TIMING REPORT NOTE: THESE TIMING NUMBERS ARE ONLY A SYNTHESIS ESTIMATE. ...
Words: 542 - Pages: 3
...Compare the concept of God as a prime mover to the idea of him as a craftsman If we were to accept the concept of God as a prime mover we would then have to accept that while God created humanity, he really wants nothing to do with it. If we were to accept the contrasting view of him as a craftsman then we have to accept that God created us for a reason and wants to forma relationship with us, this has its negativites however. IF we accept that then we must accept that all atrocities that have occurred have happened and God has no qualms with it happening. The support for viewing God as a creator comes from the Book of Genesis. The mention of God in this book has led to the belief that God created the world “ex nihilo” or out of nothing. In Genesis it is also implied that God wants to have a relationship with his creation because he has given them a list of commands to follow (the Ten Commandments.) This draws a parallel with the Aristotelian idea of God as more of a prime mover. This would make God an external agent working with matter, nor is he an agent over against other agents. This two ideas contrast here because if God were to not be against other agents, he would not have banished Lucifer, as it is told in the bible. Another point of conflict between these two ideas of God lies in the problem of evil. If we accept the traditional idea of God as a master craftsman we must accept that he himself made all things in the world and therefore they must be perfect. This...
Words: 885 - Pages: 4