CS101 Notes final - CS101 Notes Final Programming Languages...

This preview shows page 1 - 3 out of 13 pages.

CS101 Notes Final Programming Languages o Created to solve some problem o Early languages designed for specific computers o First widely used language was Fortran in 1957 and available on several difference computers o Cobol was developed via DoD from work done by Grace Hopper 1959 o 1960s and 1970s interest in computing exploded o C, Ada, PL/1 developed o General purpose computers still expensive but sold most of them to government and businesses o Ada Lovelace- first computer programmer which was written by a woman o Program a series of electrical signals passing through logic gates o 1s and 0s called machine language o Executable- program computer can run. performs the operations called for by that instruction o Compiler languages- translate human readable code into machine language, store it, and then execute it at some later time o Interpreted language- translate human readable code into machine language one line/statement at a time while program is running Compiled languages o Error checking done ahead of time o Weed out syntax errors before running programs o Used for large application level code Interpreted language’s o Skip compiling step saving time o Program might have bugs we don’t find until run time o Smaller tasks Libraries o Add functionality to base language o Keeps base language small and then just add functions you need for task Common features of languages o Variables Symbol that holds some value Value that it represents is stored in memory In memory different kinds of values take different amounts of space Program needs to know what type a variable is in order to set aside correct amount of space Some languages like C++ are strongly types and require programmers must explicitly state type of a variable. Its an error not to or specify wrong type Python determine type by context- weakly typed Can hold any value, even another variable You can use variables just like you would use actual value String variables Collection of characters and it is stored in memory one character per memory location; each character typically 1 or 2 bytes Indicate its presence with quotation marks
Image of page 1

Subscribe to view the full document.

Most languages have built in functions to manipulate strings: get length, search for substrings, do substitutions o Logic-comparisons Typically want something to happen based on comparison Return either true or false; they are Boolean operations Use an if statement to execute logical operation Test is often comparison operator such as equal, less than, or greater than Logical operators are similar to gates Loops Doing a series of steps repeatedly While loop o Executes a series of steps while some condition is o The test returns either true or false o Loop continues until test returns false o Don’t know how many times we need to repeat the steps it relies on external conditions For loop- you know how many times you want to run the loop o
Image of page 2
Image of page 3

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern