Turing Exam Notes

2043 words - 9 pages

These notes helped me alot in my final exam for ICS3M.Computers Exam NotesTermsDeclaring a variable -setting aside some memory that will be used to store a valueIndentifier -The name of the variableConstants -Declared using: var name-of-constant : type-of-constant :=value. Constants are variables that you want to stay the same through the entire program, they are useful if it's a variable that you may wish to changeVariables -Must begin with a letterCan use digits or underscoresCan't use special characters like hyphens or spacesAre case sensitiveAssignment-Occurs when a variable is assigned a specific value (initialized)Condition/Comparison -Is used when comparing a value/variable to anot ...view middle of the document...

Eg. drawfillOval(200,300,100,50,blue)File I/OWhen a text file is read in and used in turingFile input -Open: filenum,filename, putFile OutputOpen: filenum, filename, getArraysArray -An array is a variable that holds an entire list of informationSelection Sort-The selection sort works by using 2 arrays: an unsorted list and a sorted list. The sorted list is empty to start. The sort works by selecting the smallest item from the unsorted list, copying it into the next empty spot in the sorted list, and then changing the element that was just copied to a very large # (larger than all the # that you are working with)Unsorted ListSorted listsmallestlocation9,3,7,2,10-- -- -- -- -- 249,3,7,999,102 -- -- -- -- 32Insertion SortThe insertion sort uses 2 arrays (just like the selection) but, instead of searching for the smallest in the original list, we simply begin with the first element in the unsorted list, and do the work of sorting when we insert into the new-sorted list. When we insert the sorted list, we maintain sorted order.IndexUnsortedLocation in insertSorted19,3,7,2,1019 - - - - -29,3,7,2,1013,9 - - -39,3,7,2,1023,7,9 - -49,3,7,2,1012,3,7,9 -59,3,7,2,1052,3,7,9,10Bubble SortThe bubble sort only uses 1 array. It works by comparing 2 elements at a time. If the 2 elements are incorrect order, it swaps them. This continues until the largest element is "bubbled" to the end and this whole process is repeated until the entire list is sorted.IndexSwap?List1no swapE M N A P Z O B D C2no swapE M N A P Z O B D C3swapE M A N P Z O B D C4no swapE M A N P Z O B D C5no swapE M A N P Z O B D C6swapE M A N P O Z B D C7swapE M A N P O B Z D C8swapE M A N P O B D Z C9swapE M A N P O B D C DDisplaying a loopFor i 1..30 listPut list(i)End forAssignment Statement vs Conditions• To assign a value to a variable, we use assignment statements Ex. var age: intage := 16After variables have been assigned values, we may want to compare those values using a comparison statement also called a conditionA condition/comparison will be true or false BOOLEAN= equalnot= not equal< less than= greater then or equal toMike is way gayer then Anders x10Complex Comparisons• we can connect comparison statement with the words and, orEx. var age: int := 16 Var myage : int :=15Put age >=16 and myage = 15 ~TRUE Put age >=16 and age = 17 ~FALSE Put age >=16 or age = 17 ~TRUEStrina ComparisonsString can also be compared in TuringTuring does this by translating the strings into numbers by using ASCII codeIf StatementsIf statements are used when making a decision in a computer programThey use comparisons/conditions and evaluate those comparisons/conditions to one of two possible values: TRUE or FALSEAn if statement follows the balls structure below:If condition then(in this space code is written which will run only if condition = true) elsif condition2 then(in this space code is written that will run only if conditon2 = false) else(in this space code is written that will ...

RELATED

Literary Analysis - Hills like White Elephants - WR 303 - Literary Analysis

1555 words - 7 pages 1 Madison Evans Jake Sauvageau WR 303 Literary Analysis 8/30/18 Ernest Hemingway’s Hills like White Elephants The short story Hills like White Elephants by Ernest Hemingway is a story about a man and woman who are sitting at a bar at a small train station somewhere in Spain. They seem to be having a heated conversation about a mysterious “operation”. The author never explicitly says what the issue is between the man and woman, but it can be

An Analysis of Walter Freeman, Father of the Lobotomy - NKU HNR 151H - Essay

1433 words - 6 pages 1 Brandell Hannah Brandell Prof. Tamara O’Callaghan ENG151H-007 5 May 2017 Walter Freeman and the Invention of the Lobotomy In Steely Library’s digital archives, one of the postcards from the Gilliam family collection is entitled Western Kentucky Asylum for the Insane, Hopkinsville, KY. The postcard dates back to 1915 and portrays a beautiful building, complete with red bricks and white columns. Many of the insane asylums around this time were

Lost Treasure, A story about a psychopathic father - Amity college 11BB - Creative Story

1130 words - 5 pages Lost Treasure When I was a child, my late father and I would spend every moment of the summer season on the sparkling white sand of the beach near our home. We would dance, kicking up the shiny surface so that the droplets glimmered like diamonds in the sunlight. We would lie on our backs and stare at the sky, until the swirling clouds began to take on our imaginative shapes mingled together by our fantastical minds. We would grip imaginary

robotics revolution represent for human employment in New Zealand in the next 30 years - massey university - management

1357 words - 6 pages Rebecca Hastie 11256694 How much of a threat does the robotics revolution represent for human employment in New Zealand in the next 30 years? In order to understand the threats that robotics may pose to human employment in the future, it is important to examine the ways in which robots and computerization are already influencing different employment industries today, and how they have changed our labor practices in the past. If this information

A review of “Indigenous remain ‘asset rich, dirt poor’ 25 years after Mabo”. - ANU - literature review

1115 words - 5 pages Free A review of “Indigenous remain ‘asset rich, dirt poor’ 25 years after Mabo”. In the article “Indigenous remain ‘asset rich, dirt poor’ 25 years after Mabo”, Indigenous affairs editor, Fitzpatrick (2017) presents the socioeconomic situation of the Aboriginal people, using the views of the former prime minister’s advisor, Josephine Cashman. Miss Cashman pointed out that the promises made to the indigenous people, presented in the Mabo case, had not

Comparison of Tom and Jay from Great Gatsby - English - Essay

749 words - 3 pages Annie Shepherd-Barron, Luxmoore Comparison Between the Portrayal of Tom Buchanan and Jay Gatsby in Chapters 1 to 6 Fitzgerald purposefully portrays Jay Gatsby and Tom Buchanan in contrasting ways to emphasise the variety of money within the American market, during the era in which the novel is set. A major difference between the two men is ‘new money’ and ‘old money’, where Gatsby represents ‘new money’, but Daisy and Tom represent ‘old money

term project of marketing strategy - global business management 1 st semester - essay

405 words - 2 pages Boston Pizza Boston Pizza is a Canadian fast food restaurant, which began in Edmonton, Alberta, on August 12, 1964. The restaurant had begun operations on 17 different locations in western Canada by 1970. In 1968 a royal Canadian mounted police officer Jim treliving noticed the growing popularity of Boston pizza and he bought the rights to start a restaurant in British Colombia. He was the first franchisees of Boston pizza. At present, Boston

The advantages and disadvantages of social media - Bucks County Community College - essay

830 words - 4 pages Sioe Liang Ngeow ( Caden ) Alan Rubin COMP110.N12 15 June 2017 Wisely Use Of Social Media In the era of modernity, the application of technology is already inevitable, especially the use of social media. Social media such as Facebook, Twitter and YouTube have come into widespread use globally. As we all know, Mark Zuckerberg, as the chairman and chief executive officer of Facebook is ranked as one of the top ten wealthiest people in the world

Pet Peeves Public Speaking Speech - Public Speaking - Speech

506 words - 3 pages ​I’m​ ​not​ ​usually​ ​the​ ​kind​ ​of​ ​person​ ​to​ ​express​ ​when​ ​things​ ​annoy​ ​me--other​ ​than​ ​rolling​ ​my​ ​eyes,​ ​but​ ​there are​ ​actually​ ​quite​ ​a​ ​lot​ ​of​ ​things​ ​I​ ​don’t​ ​like.​ ​I​ ​can’t​ ​say​ ​I’m​ ​not​ ​guilty​ ​for​ ​some​ ​major​ ​pet​ ​peeves,​ ​like​ ​always​ ​being late,​ ​but​ ​here​ ​are​ ​my​ ​pet​ ​peeves​ ​that​ ​people​ ​should​ ​really​ ​work​ ​on. This​ ​one​ ​goes​ ​out​ ​to​ ​my​ ​mom…​ ​Yes

math Algebra Define Variable 1 Math - Algebra 1 - Algebra 1

868 words - 4 pages Evaluate each expression when y = 6. 1. 7 – y = 2. y – 3 = 3. 6 + y = 4. y + 2 = 5. y – 2 = 6. y – 1 = 7. 7 + y = 8. y + 8 = 9. 3 + y = 10. y + 4 = Evaluate each expression when y = 4. 11. y + 5 = 12. y – 7 = 13. 2 – y = 14. 7 – y = 15. 9 – y = 16. y + 6 = 17. 6 – y = 18. y – 5 = 19. y + 4 = 20. y + 9 = Evaluate each expression when y = 8. 21. y + 5 = 22. y – 8 = 23. 2 – y = 24. 6 – y = 25. y – 1 = 26. y – 9 = 27. 4 + y = 28. 1 + y = 29. 9 – y

home automation haow its work in the society - speech comunication - home automation

1618 words - 7 pages Free Introduccion A home automation system typically connects controlled devices to a central hub or "gateway". The user interface for control of the system uses either wall-mounted terminals, tablet or desktop computers, a mobile phone application, or a Web interface, that may also be accessible off-site through the Internet. Also it will control lighting, climate, entertainment systems, and appliances. It may also include home security such as

Intercultural essay on my culture - mesa high - essay

599 words - 3 pages Lopez 1 Lopez 4 Danielle Lopez Michelle Young COM 263: 18FA5689 9 September 2018 My Personal Culture The Hispanic culture has different values, beliefs, and traditions. Family is highly value. Family is a close-knit group and the most important social group to gather in any events or special days. The Hispanic “family unit” includes not only parents and children but also grandparents and extended family. Individuals within the family have moral

History Paper for Us History Class - US History , Hudson County Community College - Essau

2229 words - 9 pages Ramos7 Johanna Ramos History Research Paper November 30, 2017 US History II 106-01 How 9/11 Impacted Our Population History is the study of past events. Within history many major events have occurred that has change the equilibrium we know of today. If we look back as recent as the events of September 11, 2001 we can speculate that many bodies of government, personal ethical issues and dynamic peace we lost within our economy and everyday lives

Be your true self no matter what people think of you. - Trevor Highschool english 5 - essay

450 words - 2 pages Lopez Jose Lopez Mrs. karen 14 september 2017 Be your true self Fredrich Nietzche once said “The individual has always struggle to keep from being overwhelmed by the tribe. If you try it, you will often, and sometimes frightened. But no price is too high to pay for the the privilege of owning yourself.” In my opinion, I believe this quote is true. Many people feel like they have to be a certain way for society to like them. When in reality, they

Brown v.s Board of Education Background Information - English9 - Expository Essay

668 words - 3 pages Greifzu Brown Vs The Board of Education Background Information Expository Essay The Plessy v Ferguson, the Supreme Court Case that stated although colored and white people were separated, as long ad the facilities were equal, it was constitutional. Now, people know that isnt the true because a lot of the colored facilities weren’t equal. Over 50 Years later a new cases, which consisted of five separate cases that were combined into one that is