...Introduction to Programming Logic Phillip M. Ragland June 20, 2016 Individual Projects Document Noura Abbas Individual Project 1 There are many steps and processes to consider when designing a website for a customer. Regardless if the customer is an individual or a large corporation, the steps and processes for designing a website are pretty much the same. Each website that is designed with similar specifications. However, when it comes to the design aspects of a website, it will differ greatly from customer to customer. Some of the cues that determine the design of the website are the intended purpose of the website, the intended audience of the website, and of course the desire of the customer it is being designed for. Here are some basic steps and processes for the design of a website: 1). Gathering information from the customer 2). Planning 3). Design 4). Development 5). Testing and delivery 6). Maintenance (iDesign Studios, 2016). The first step (phase) for designing a website is to gather information. When gathering information, you will need to ask a lot of questions. Question such as what id the purpose of the website? Who is the audience of the website? What is the intended accomplishment of the website? Many such questions as these will need to address. The next step (phase) is planning. During the planning step, you will use the information that was gathered during the 1st phase to begin to put...
Words: 1820 - Pages: 8
...Personal Learning Management University of Phoenix Algorithms and Logic for Computer Programming PRG 211 Professor Sam March 07, 2013 Personal Learning Management Being able to develop a management tool that would allow a user or student to review course material would be very beneficial. With a course such as programming that has so much information, it is important to be able to recall information in order to properly understand how programming works. I for example, do not have any prior knowledge of so I would have to continuously refresh the information that I have learn in the reading as well as in the class room environment. I will be discussing some topics that are important to the development of such a program. In order to properly develop an application, we must first address and analyze the problem that has caused this need. In this situation, we want to design an application that will allow students to be able to review reading assignments as well as task or anything that would be beneficial to retain. Some subjects are a harder to remember than others such as programming. Modular programming would be the best fit because we would want everyone to read the material in the same order. We would set up the program so everyone’s view is the same. If we allow people to “jump around” in the programming, some learning material is going to be skipped over and that would defeat the purpose of the development of this application. Submodules would be added...
Words: 480 - Pages: 2
...Programming Solution Part 3: Array Structure Proposal Wayne Murray Algorithms and Logic for Computer Programming (PRG 211) November 14, 2011 Professor Sprouse Array Structure Proposal In my proposal from week two I would want to find the total number of units per patient for each procedure code billed by the doctor. A parallel array consisting of a one-dimensional and a two-dimensional array in this case would be a good way to solve this problem in a simplified code format. An array would also allow all the data the user wants to input to be stored in the program for multiple queries to be run without having to re-input the data. So this module of the program will allow the user to input all the different procedure codes billed the provider and return a units-per-patient statistic for the searched procedure code. Assuming the data that the user will input is all for the same provider, the following variables will need to be declared: the procedure code, the number of patients, and the number of units billed. Two arrays will be declared as well, one for the procedure code and one for the number of patients and units. The procedure code variable and array must be setup with a string data type since there are some procedure codes that have alpha characters. The number of patients and the number of units variables, as well as their corresponding array will be setup as integer data types. Since both of those variables are of the same data type they can be combined into...
Words: 728 - Pages: 3
...Constraint Logic Programming in Prolog: Hanjie Puzzle Solver Lu´ Cleto and Jo˜o Marinheiro ıs a FEUP-PLOG, Turma 3MIEIC05, Group 23 {ei11077,ei11129}@fe.up.pt http://www.fe.up.pt Abstract. The purpose of this project was to use constraint logic programming in Prolog to implement a solver for the 2D puzzle, Hanjie. For this purpose we used the clp(FD) library provided by SICStus Prolog 4.2.3, specifically the sum/3 and automaton/3 combinatorial constraints. The program we developed is able to solve puzzles with dimensions up to 88x88, with only one possible solution, in less than one second. When there are multiple solutions, the execution time for the obtaining the first solution varies with the number of possible solutions. These results show that the execution time of the program is primarily affected by the amount of possible results. While larger grid dimensions do increase the execution time, the increase is linear if the number of possible solutions is maintained. On the other hand, increasing the number of possible solutions will lead to an exponential growth in execution time. 1 Introduction The goal of this project is to use constraint logic programming in Prolog to develop a logic program capable of solving a decision problem in the form of the 2D puzzle, Hanjie. This puzzle consists of a rectangular grid with ’clues’ on top of every column and to the left of every row that indicate the number and length of gray blocks in that column/row. To achieve this goal, first...
Words: 9959 - Pages: 40
...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
...Programmable Logic Controllers: Hardware and Programming Chapter 7 7.1 Introduction The majority of PLC manufacturers use the ladder logic diagram programming language to program their programmable logic controllers (PLCs). Some manufacturers prefer using logic gate circuits or Boolean expressions to program their PLCs. Therefore, it is beneficial to know how to convert one type of PLC programming language to the other. In this chapter, you will learn how to create logic gate circuits from ladder logic diagrams and vice versa. You will review the functions associated with the combinational logic gates. These gates are the NOT, AND, OR, NAND, NOR, XOR, and XNOR gates. You will learn how to create PLC ladder logic diagrams that emulate the functions of these gates. Programming Logic Gate Functions in PLCs Chapter Outline 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 7.10 7.11 7.12 7.13 7.14 Introduction Combinational and Sequential Logic Gate Circuits Boolean Expressions, Truth Tables, and Logic Gate Circuits NOT Gates or Inverters AND Gates OR Gates NAND Gates NOR Gates XOR (Exclusive OR) Gates XNOR (Exclusive NOR) Gates Simplifying Boolean Expressions Creating PLC Ladder Logic Diagrams from Logic Gate Circuits Creating PLC Ladder Logic Diagrams from Boolean Expressions Creating Logic Gate Circuits from PLC Ladder Logic Diagrams Technical Terms combinational logic gates sequential logic devices Boolean expression Boolean algebra true state logic high false state logic low truth...
Words: 9164 - Pages: 37
...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
...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
...we approach the world, its impacted the food we eat, security (for better and worse), scholarly pursuits, social networking, etc. its hard to imagine a world that doesn't have computers; without computers we wouldn't have all the inventions and services that have come about because of them. It was the work of four philosophers / logicians: Gottfried Leibniz, Gottlob Frege, Bertrand Russell, and Alan Turning. Leibniz invented the binary number system which allows all number to be expressed in terms of 0's and 1's. By expressing the numbers as 0's and 1's all you need is a register which has only has to process two options: on and off. But programming in bits is very slow and tedious: failing to get input the right bit in a code that consist of thousands of switches will cause the entire program to fail. Once more programming in machine language is very repetitious. When writing a program in macing language you would see that you reuse a lot of the same code over and over which creates more data for the programmer to work with....
Words: 7547 - Pages: 31
...Module Main() Declare userNum as Integer Display "Enter a number" input userNum call TimesTen(userNum) Display userNum End Function TimesTen(integer userNum) userNum = (userNum * 10) return userNum End Function Algorithm Workbench #1 - #7, pp. 115-6 (continued) – Write pseudocode (not Java) 2. def main(): showvalue() def showvalue(): print '12' main() 3. The value stored in ‘a’ will be: 3 The value stored in ‘b’ will be: 2 The value stored in ‘c’ will be: 1 4. Declare Integer age Declare Real income Declare String name Call Module1 (agem Real_Income, Name) 5. 6. 7. Debugging Exercises, p.117 (3 pts. Ea. / 12 pts. Total ) 1. 2. 3. 4. Programming Exercises, (#1 - p.117) (10 points total) #1. Kilometer Converter Design a modular program that asks the user to enter a distance in kilometers, and the converts that distance to miles. The conversion formula is as follows: Miles = Kilometers * 0.6214 Additional Instructions: 1. Design using pseudocode. 2. Use the following module names: getKilometers – read kilometers from user keyboard input and store in ‘kilometers’ variable showMiles – accepts ‘kilometers’ variable as input argument and displays the equivalent value in miles Module main () Declare...
Words: 645 - Pages: 3
...Lecture 1. Logic. Propositions. The rules of logic specify the precise meaning of mathematical statements. For instance, the rules give us the meaning of such statements as, “There exists an integer that is greater than 100 that is a power of 2”, and “For every integer n the sum of the positive integers not exceeding n is ”. Logic is the basis of all mathematical reasoning, and it has practical applications to the design of computing machines, to artificial intelligence, to computer programming, to programming languages, and to other areas of computer science. A proposition is a statement that is either true or false, but not both. Letters are used to denote propositions, just as letters are used to denote variables. The conventional letters used for this purpose are p, q, r, s, … The truth value of a proposition is true, denoted by T, if it is a true proposition and false, denoted by F, if it is a false proposition. We now turn our attention to methods for producing new propositions from those that we already have. Many mathematical statements are constructed by combining one or more propositions. New propositions, called compound propositions, are formed from existing propositions using logical operators. Let p be a proposition. The statement “It is not the case that p” is another proposition, called the negation of p. The negation of p is denoted by p. The proposition p is read “not p”. A truth table displays the relationships between the truth values of propositions. Table...
Words: 1725 - Pages: 7
...In logic, a logical connective (also called a logical operator) is a symbol or word used to connect two or more sentences (of either a formal or a natural language) in a grammatically valid way, such that the sense of the compound sentence produced depends only on the original sentences. The most common logical connectives are binary connectives (also called dyadic connectives) which join two sentences which can be thought of as the function's operands. Also commonly, negation is considered to be a unary connective. Logical connectives along with quantifiers are the two main types of logical constants used in formal systems such as propositional logic and predicate logic. Semantics of a logical connective is often, but not always, presented as a truth function. A logical connective is similar to but not equivalent to a conditional operator. [1] Contents [hide] 1 In language 1.1 Natural language 1.2 Formal languages 2 Common logical connectives 2.1 List of common logical connectives 2.2 History of notations 2.3 Redundancy 3 Properties 4 Order of precedence 5 Computer science 6 See also 7 Notes 8 References 9 Further reading 10 External links In language[edit] Natural language[edit] In the grammar of natural languages two sentences may be joined by a grammatical conjunction to form a grammatically compound sentence. Some but not all such grammatical conjunctions are truth functions. For example, consider the following sentences: A: Jack went up...
Words: 2282 - Pages: 10
...justice system, an officer is faced with decision every day. With his training, sometimes he has to make quick decision, especially in a crime situation. He has to look at the evidence based on reason, the facts, and it has to be reliable evidence, and he must use common sense. In my opinion, grounded would be more valid than the rest of them because it requires the truth and evidence, and being able to use good sense by having an explanation of research; the investigation to prove a phenomenon theory that may not even have any proof. Axiomatic This is a statement that could be accepted as the truth, or it could be an Idea, that cannot be proven; and sometimes it could be taken for granted. It could be a accepted rule, or principal, or logic Variables These are numbers that is likely to be different. It has mathematical value, but it has no fixed value. It can change at any time, and very unpredictable, yet you really can’t do anything like coding without variables. And it can’t start with a digit. Variables are used in...
Words: 361 - Pages: 2