00-Introduction Files ===================== C++Average.cpp -- C++ program to calculate an average JavaAverage.java -- Java ditto LOLCODE_Average.lol -- LOLCODE ditto PascalAverage.pas -- Pascal ditto PrologAverage.pl -- Prolog ditto PythonAverage.py -- Python ditto RubyAverage.rb -- Ruby ditto NOTE: if clicking any of the above files gives you a message asking you want to save the file or find a way to view it on-line, choose CANCEL. Then click the corresponding "2html" link -- C++Average.cpp2html, for example. That should show you the source code (perhaps with line numbers and links to the important parts of the code). These programs are examples of one task (finding the average of a list of numbers) described in five different languages. - The C++ and Pascal programs can be compiled into executable programs. - The LOLCODE, Prolog and Python programs can be loaded into suitable interpreters. - The Java and Ruby programs can be compiled into "bytecode" which can later be run using an appropriate emulator. Note that Java, Python, C++ and Pascal are all languages that have been used in CSCI 1226/7 over the years. The first three are all still languages you might be asked to use in a programming job. Ruby is a language we haven't used in this course, but is another language you might be asked to use in a job. LOLCODE is what's called an "esoteric" language. Somebody invented it just to amuse themselves and others. Nevertheless, it can be used for many simple computer programming tasks. Still, no one's going to pay you to program in that language. Prolog is a language that's very different from all the other languages above (including LOLCODE). The others all have the same basic controls -- conditionals, loops, methods/functions, variables and assignment statements. Prolog is a LOGIC-programming language. It uses clauses, unification and resolution to calculate -- and so the code looks very different from all the others. And while you can use Prolog for any computer programming task, it's not designed for the kind of programming the other languages are designed for. We wouldn't normally write the program this way in Prolog. GradeCalculatorApp.java -- App for calculating a course grade GradeCalculatorConsole.java -- console program for calculating a course grade The difference between these two programs is in how the user interacts with them. The App is a GUI -- a graphical user interface -- and so opens a window that has boxes for the user to type in and buttons to press. The console program needs to run in a terminal, and it prompts the user for each number, and the user must type them in as requested. The similarity between these two program is in what they do -- calculate the user's course grade based on their grades in the course components. TurtleGraphics.jar -- App for making line-drawings This program allows you to write little "programs" in a very simple language. The program draws lines on the little screen next to the window. For example, this program draws a square: Forward 100 Right 90 Forward 100 Right 90 Forward 100 Right 90 Forward 100 Right 90 See if you can figure out how to draw a triangle. How about a pentagon. A hexagon. Can you do a circle? In theory, you can just download this file and double-click it to get it to run. In practice you might need to change some settings to get it to work. Google "running jar files" to get more information.