C Programming Laboratory

Size: px
Start display at page:

Download "C Programming Laboratory"

Transcription

1 Sheet 1 of 14 LAB 1: Introduction to C Environment Objective: In this laboratory session you will learn: 1. How to create C programs 2. How C programs are organised 3. How to write a basic program to display text on the screen The C Environment: What is C? C is a `programming language'. That is, it is a language that allows you to specify exactly what you want your computer to do and explain clearly for other people what you are doing. C is a high level multi-purpose programming language that can be run across a number of different platforms. For example, it can run on: MS DOS WINDOWS UNIX A high level programming language uses keywords and symbols that humans are familiar with. High level programming languages were developed to make it easier for humans to program computers. Remember all the information inside a computer is in binary form, including the program instructions. It would be tedious for humans to enter this so-called low-level code, so different high level programming languages were developed, for example PASCAL and C. A high level language can not run directly on your computer, it must be compiled (converted) into a set of simple instructions that a computer can use. Each instruction is used to instruct the computer to perform a specific operation. C programming environment: C is a programming language of many different dialects because there are so many compilers. Each compiler is a little different. The library functions of one will have all of ANSI C, the standard, but will also contain additional functions. The version used on this course is Borland C version 2. To start it type tc2 at the F: prompt. This will take you into the C programming environment, which contains the following functions. AN EDITOR: this is a basic text editor, which allows the user to write C code any text editor can be used. The C program is called to C source code and is saved as a source file (*.c). A COMPILER: C is a high level language and in order for it to run on a PC, a C program must be broken down in to a set of machine code instructions which can be processed. This is the first part of the process of making an executable program. It takes in a source file (*.c) and it produces object code which is stored in an object file (*.obj). A LINK EDITOR: As part of writing a program, code that has been written by other developers can be inserted into a program that is being developed. A simple example of this is the stdio.h file which contains input and output functions like printf() and scanf(), that are used to print text to the computer monitor or received input typed from the keyboard. The output of the link editor is an executable file (*.exe). A DEBUGGER: This is used to debug problems in the code that has been written.

2 Sheet 2 of 14 Edit: create/modify source code Compile: generates machine instructions yes Error? No Link: Link library files yes Error? No Execute: Run the program source file (myprog.c) object file (myprog.obj) executable file (myprog.exe) yes Error? No Success! The C Environment Structure of a C Program A C program would typically consist of the following sections: 1. The Pre-Processor Directives 2. Programmer s Block descriptive comments by the programmers 3. Main Function containing various types of C statements 4. Other Functions Example: Hello World Program: C Program Code /**************************************/ /* Sample Program */ /**************************************/ /* Developed by: A Programmer */ /* Date: Nov. 1, 1999 */ /**************************************/ /* This program prints the text */ /* HELLO WORLD on the PC monitor */ /**************************************/ main() printf( HELLO WORLD \n ); /* C statements end with ; */ /* printf is a function in */ /* stdio.h that allows data */ /* to be printed on the */ /* screen (stdout) */ /* end of function main */ Description 1. Pre-Processor Directives - used to tell the compiler of header files that have to be included, and to declare constants and global variables. These will be covered later 2. Programmer s Block /* and */ are used to enclose pieces of text which describe what the program does. This text is called a comment 3. main() is the start of the function main. The body of the function is enclosed between the curly brackets. 4. printf() is a function used to display a string of text on the screen

3 Sheet 3 of 14 What did it all mean? In C, programs are organised into blocks, called `functions'. A C function is similar to a mathematical function: it typically takes arguments; it performs an operation on these, and typically returns a result. For example, the addition of two numbers, a computer takes two numbers and performs the addition operation on them and then returns the result of the operation. In C, the function called `main' is where the program execution starts. In the case of a very simple program, the lines which make a `main function' look like: main() However, this function doesn't do anything until instructions are put inside the squiggly brackets. In the example program above, there is one instruction inside: printf( HELLO WORLD \n ); This is in fact an invocation of another function, `printf'. The `printf' function is provided with the compiler or operating system. In this example, it takes a single operand, which is a `quoted string' ( HELLO WORLD \n ) and displays this on the PC monitor. Now look at the first line of code: The # indicates that this is a pre-processor directive, which is an instruction to the comipler to do something before compiling the source code. If the main function is to call another function, in this case `printf', the preprocessor directive should instruct the compiler to include in the program the file stdio.h. This file is called a header file, because it is usually included at the head of a program. It defines information about functions provided by a standard C library. The stdio.h header file contains declarations for the standard input and output functions available and must be included in the program to allow the use of the printf() function. Creating and Editing a Basic Program Exercise 1: Example C Program 1. Create a directory on your F drive to store your C programs: C:\TURBOC\MYLABS\ 2. Start the C programming environment. 3. Type in the following program code exactly as written below: /* exercise 1.1 Hello World */ /* This program prints the text */ /* HELLO WORLD on the PC monitor */ main() printf( HELLO WORLD \n ); 1. Save the file as lab1ex1.c 2. Compile the file using the Compile/compile to obj option 3. Link the code using the Compile/Link exe option 4. Execute the file using the Run/R option 5. From the OS shell print out all files in your C:\TURBOC\MYLABS\ directory There should now be 3 files called lab1ex1: lab1ex1.c, lab1ex1.obj, lab1ex1.exe

4 Sheet 4 of 14 Exercise 2: Modify the example Open the file lab1ex1.c Add the following line after the printf statement printf( \\n means New Line \t ); printf( \\t means Tab \n ); Save the file (lab1ex2.c) Compile, Link and Run the file What is displayed on the DOS screen? Exercise 3: Create a new file called lab1ex3.c which prints the following text on the PC monitor: Hello World My name is Joe Bloggs Goodbye World Save, Compile, Link and Run the file LAB 2: Fundamentals of C Objective: In this laboratory session you will learn: 4. The fundamental elements required to write a C programs 5. What is meant by a token in C. 6. What are the major data types used in C 7. What is meant by a keyword. 8. How to write a basic program to display different data types on the screen Declaring Variables A variable is a specific memory location set aside for a specific type of data and given a name for easy reference. The value stored in this memory location is variable, i.e. it can be changed. For example, if you are calculating the voltage across a fixed value of resistance as the current changes, the voltage variable would have a different value each time the current changed. Data Store resistance current voltage C statement to declare a memory location to store resistance values, where the value will be an integer (whole number), is as follows: int resistance; C statement to declare a memory location to store current values, where the value will be a real number, is as follows: float current; C statement to assign a value 200 to the variable called resistance is as follows: resistance = 200; C statement to assign a value 0.1 to the variable called current is as follows: current = 0.1; In C, all variables MUST be declared before they can be used in a program. To declare a variable, you must declare its type and identifier.

5 Sheet 5 of 14 Data Type Ranges C recognises the data types shown in the table below. NAME SIZE DETAILS COVERAGE int * signed integer System dependent unsigned int * unsigned System dependent char 1 signed char 128 to 127 unsigned char 1 none 0 to 255 short 2 signed short int 32,768 to 32,767 unsigned short 2 unsigned short int 0 to 65,535 long 4 signed long int 2,147,483,648 to 2,147,483,647 unsigned long 4 unsigned long int 0 to 4,294,967,295 enum * None Same as int float 4 None 3.4E +/- 38 (7 digits) double 8 None 1.7E +/- 308 (15 digits) long double 10 None 1.2E +/ (19 digits) The smallest location in memory which can be addressed is a byte, a byte consists of 8 bits, hence a byte can hold 256 possible numbers (2 8 ). An integer is normally 16 bits or 32 bits long. A float is normally 32 bits long. A char is 8 bits long Signed and unsigned are modifiers that can be used with any integral type. The char type is signed by default, but you can specify /J to make it unsigned by default. For example, a variable of data type integer can be declared as follows: int my_data; This piece of code creates an integer variable called my_data. To assign a value to this variable (load memory location) the C assignment operator (=) is used: my_data = 10; This line of code assigns the value 10 to the variable my_data. Note an integer variable can only store integer values. A float is used to declare a floating point variable. float more_data; /* declares a floating point variable called more_data */ more_data = 10.01; /* more_data now assigned a value of */ Example 2: Consider this piece of code. /******************************************************/ /* Add Two Numbers Program */ /******************************************************/ /* Developed by: A Programmer */ /* Date: Nov. 1, 1998 */ /******************************************************/ /* */ int number_1; /* first number */ int number_2; /* second number */ int result; /* result of addition */ /* */

6 Sheet 6 of 14 number_1 = 2; /* assign value 2 to number_1 */ number_2 = 5; /* assign value 5 to number_2 */ result = number_1 + number_2; printf( the first number is %d \n, number_1); printf( the second number is %d \n, number_2); printf( first number + second number = %d, result); Example 3: Consider this piece of code. /******************************************************/ /* Area of rectangleprogram */ /******************************************************/ /* Developed by: A Programmer */ /* Date: Nov. 1, 1998 */ /******************************************************/ main() float length; /* length of rectangle */ float width; /* width of rectangle */ float area; /* area of rectangle */ width =7.5; /* assign value 7.5 to width */ length = width; /* length assigned 11.4 longer width*/ area = length*width; /* multiplying to get area */ printf( the length is %f, and the width is %f \n, length, width ); printf( the area is %f \n,area); The %f and %d are called format specifications. They tell the printf function how the data should be printed. %d prints data as an integer %f prints data as a floating point number. There are many different format specifications which will be encountered as the course progresses. More Data Types: Some examples of data types were introduced: Integers can be declared using int, for example, int a,b,c; declares 3 integer variables called a,b and c. Floating Point numbers can be declared using float keyword. For example, float a,b,c; declares 3 float variables called a,b and c. Char data type. Another data type is the char, it is declared using the keyword char, for example: char a; /* declaration */ char a= a ; /* declaration and assignment */

7 Sheet 7 of 14 Double data type Double data type is a larger floating-point number (see the table in last weeks notes). It is declared using the keyword double. For example: double a; double a=10.05; printf Format Specifications Examples: Format Specifier Data Type Format Specifier Data Type %d Signed decimal integer %e Floating point exponential notation %f A floating point number. %o Unsigned octal integer %c A single character %u Unsigned decimal integer %s Text string %x Unsigned hexadecimal integer Exercises Exercise 4: Executing example 2 Start the TC environment and enter the code given above in example 2. Save the file as lab1ex4.c Save, Compile, Link and Run the file What is displayed on the DOS screen? Modify the values of number_1 and number_2 and recompile, link and execute: Did your program give the correct result? Exercise 5: Addition and Multiplication Modify the program is exercise 4 to do the following: Add number_1 and number_2 Multiply result by number_3 Print out the final result to your screen Save the file as lab1ex5.c, and compile, link and execute the program List the tests in your logbook you carried out to ensure your program was working correctly Exercise 6: Division Example Create a new file called lab1ex6.c to do the following: Assign the values 100 and 200 and 300 to three resistors R1 and R2 and R3. Calculate the resistance in series Rs = R1 + R2 + R3 Calculate the resistance in parallel Rp = 1/(1/R1 + 1/R2 + 1/R3) print out the resistance in series and resistance in parallel to your screen Save the file as lab1ex6.c, and compile, link and execute the program Draw a flow chart in your logbook for the program. Save the file as lab1ex6.c, and compile, link and execute the program Were the results as you expected? If not what modifications did you need to make to your program?

8 Sheet 8 of 14 LAB 3: Fundamentals of C: USER INPUT The scanf() function. The function scanf in stdio.h allows user data to be entered as the program is executing. It has the following form scanf( %f,&a); This will write floating-point data to the memory address where the variable is stored. Whenever & is placed in front of a variable it refers to the address where the data is stored. Example 1: scanf function. /* Getting user input. */ float value; /* A number inputted by the program user. */ printf("input a number => "); scanf("%f", &value); printf("the value is => %f", value); Example 2 /* Ohms Law */ float voltage; /* Value of the voltage. */ float current; /* Value of the current. */ float resistance; /* Value of the resistance. */ printf("input the current in amps => "); scanf("%f", &current); printf("input the resistance in ohms => "); scanf("%f", &resistance); voltage = current * resistance; /* Compute the voltage. */ printf("the value of the voltage is %f volts", voltage);

9 Sheet 9 of 14 Example 3 This example also illustrates another function for writing text to the screen: puts( the text you want ) It automatically places a new line at the end of the text. float fahrenheit_temp; float centigrade_temp; /* Explain program to user. */ puts(""); puts("this program will convert a temperature reading in"); puts("degrees Fahrenheit to its equivalent temperature in"); puts("degrees centigrade."); puts(""); puts("you only need to enter the temperature in Fahrenheit"); puts("and the program will do the rest."); /* Get Fahrenheit value from user. */ puts(""); printf("enter temperature value in Fahrenheit => "); scanf("%f", &fahrenheit_temp); /* Do computations. */ centigrade_temp = 5/9 * (fahrenheit_temp - 32); /* Display the answer. */ /* insert the final statement here */

10 Sheet 10 of 14 More on assigning values to variables. To assign a value to a variable (i.e. load value to a memory location) the C assignment operator (=) is used: The format is as follows variable_1 =10; This assigns the value 10 on the right of the = sign to variable variable_1 on the left of the = sign. The assignment statement can be combined with the declaration statement as follows: int variable_1 =10; This declares variable_1 as an integer and then assigns the value 10 to the variable. a=a+5; /* Assigns to the variable a value of +5, so if a was 10, it is now 15. */ In C this can also be written in shorthand as a+=5; Example 4; Examples of += -= and /=; int number = 10; /* Value of number for example. */ number += 5; printf("value of number += 5 is %d\n",number); number -= 3; printf("value of number -= 3 is %d\n",number); number *= 3; printf("value of number *= 3 is %d\n",number); number /= 5; printf("value of number /= 5 is %d\n",number); number %= 3; printf("value of number %%= 3 is %d\n",number);

11 Sheet 11 of 14 Exercises: Complete the following exercises, making sure that each program is saved on completion of each exercise. Ex1: Data Types Create a new program called program4.c as follows: char a_character; /* This declares a character. */ int an_integer; /* This declares an integer. */ float floating_point; /* This declares a floating point.*/ a_character = 'a'; an_integer = 15; floating_point = 27.62; printf("%c is the character.\n",a_character); printf("%d is the integer.\n",an_integer); printf("%f is the floating point.\n",floating_point); Modify the above program so the declaration and assignment statements are combined Save, Compile, Link and Run the file to confirm it works Save your working program as C:\TURBOC\MYLABS\lab3ex1.c Ex2: User Input of data Create a new program called lab3ex2.c Modify the program in exercise 1 so the program asks the user to input An integer number A floating point number A character Print out the three data types to your monitor as in exercise 1. Save, Compile, Link and Run the file to confirm it works Save your working program as C:\TURBOC\MYLABS\lab3ex2.c Ex3: Variable Assignments Create a new program called lab3ex3.c to do the following: 1. Assign value of 10 to a variable called var_1 2. Add 5 to the number and save result in var_1 3. Subtract 3 from the number and save result in var_1 4. Multiply number by 3 and save result in var_1 5. Divide number by 5 and save result in var_1 6. Print out the resulting number and save result in var_1 Save, Compile, Link and Run the file to confirm it works Save your working program as C:\TURBOC\MYLABS\lab3ex3.c

12 Sheet 12 of 14 Block Structured Programs LAB 4 In this section we will look at examples of programs and comment on their structure. A badly structured program may perform its function correctly, however, if the program is not easy to read and understand it will be very difficult to debug and modify. GOOD STRUCTURE => EASY TO READ, UNDERSTAND, DEBUG AND MODIFY Program Flow The programs we have seen so far are very simple, they runs straight through from the first statement to the last, and then stop. Often you will come across situations where your program must change what it does according to the data which is given to it. Basically there are three types of program flow : straight line ( Sequential Blocks ) chosen depending on a given condition (Branch Block) repeated according to a given condition (Loop Block) Every program ever written is composed of the three elements above, and very little else! You can use this to good effect when designing an overall view of how your program is going to work. FUNCTIONS C FUNCTION is an independent collection of source code designed to perform a specific task. Functions are identified by name and can return a single value. They act on parameters, which are used to pass information into them. We need to tell the compiler the name of our function, what parameters it has, and the type of information it returns. All programs have at least one function called main. We have seen examples of functions in the C Library, such as printf and scanf. These functions were called from the main function whenever data was to be displayed on the monitor or data input from the keyboard. Make your own simple functions We can also write our own functions to perform a particular task. For example, consider the follow program which calls a function called draw_line to display a line on the monitor. Example 1 using a function to perform a simple task /* Function prototype. */ void draw_line(void); /* This is the function we will use in our program*/ printf( This program calls a function to draw a single line\n\n ); draw_line(); /* call function to draw a line*/ printf( End of program\n ); /* Function Definition */ void draw_line(void) printf( ***********************\n );

13 Sheet 13 of 14 Example 2 using a function to perform a simple task #include <conio.h> /* Function prototype. */ void beeper(void); printf("press any key to continue program \n"); getch(); /* waits to get key input from keyboard */ beeper(); /* call function make a beep*/ /* Function Definition */ void beeper(void) printf("beep!!\a \n"); 1. Declaring a function: The FUNCTION PROTOTYPE is used to declare a function, i.e. tell the compiler the name of our function, what parameters it has, and the type of information it returns. void draw_line(void); void draw_line (void) tells us that the function does not return any data to main is the name of the function which we use in main to call the function tells us that no data is passed to the function 2. Defining a function: The FUNCTION DEFINITION describes exactly what action the function is to take. The first line of the function definition is similar in format to the function prototype but it does NOT require a semicolon. void draw_line(void) printf( ********************\n ); 3. Calling a Function The function is called using the function name, for example: draw_line(); will tell the program flow to go to the draw_line() function. The draw_line() code is then executed and on completion the program execution returns to the NEXT line of the calling function. Thus the above example has the following program execution flow: 1) printf( This program calls a function to draw a single line\n\n ); 2) printf( ********************\n ); 3) printf( End of program\n );

14 Sheet 14 of 14 Exercises: Simple Functions Exercises 1 Create complete programs to utilise the above examples 1. Compile and run the programs in step mode using Turbo C compiler. Save the programs in your area as C:\TurboC\mylabs\lab4ex1.c Exercises 2 Create complete programs to utilise the above examples 2. Compile and run the programs in step mode using Turbo C compiler. Look up conio.h under help and explain what the getch and getche function is used for. Save the programs in your area as C:\TurboC\mylabs\lab4ex2.c Exercises 3 Modify the program in exercise 1, so that the program displays a rectangle as follows: *********************** *********************** *********************** *********************** Use two functions: draw_rectangle and draw_line in thus program, where main calls the draw_rectangle function and draw_rectangle calls the draw_line function. Save the program in your area as F:\ clabs\lab4ex3.c Exercises 4 Create a program using the functions from exercise 2 and 3 can be used to display a rectangle, then beep and ask the user to hit enter to display the rectangle again. (hint: use getch function to wait for user to enter any character on keyboard before the program continues) Save the program in your area as F:\ clabs\lab4ex4.c Exercise 5 Create a program using a simple function to display a Christmas tree composed of stars. Save the program in your area as F:\ clabs\lab4ex5.c

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T) Unit- I Introduction to c Language: C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating

More information

The programming language C. sws1 1

The programming language C. sws1 1 The programming language C sws1 1 The programming language C invented by Dennis Ritchie in early 1970s who used it to write the first Hello World program C was used to write UNIX Standardised as K&C (Kernighan

More information

Informatica e Sistemi in Tempo Reale

Informatica e Sistemi in Tempo Reale Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)

More information

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection

More information

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program. Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

More information

Sources: On the Web: Slides will be available on:

Sources: On the Web: Slides will be available on: C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,

More information

LC-3 Assembly Language

LC-3 Assembly Language LC-3 Assembly Language Programming and tips Textbook Chapter 7 CMPE12 Summer 2008 Assembly and Assembler Machine language - binary Assembly language - symbolic 0001110010000110 An assembler is a program

More information

PROGRAMMING IN C PROGRAMMING IN C CONTENT AT A GLANCE

PROGRAMMING IN C PROGRAMMING IN C CONTENT AT A GLANCE PROGRAMMING IN C CONTENT AT A GLANCE 1 MODULE 1 Unit 1 : Basics of Programming Unit 2 : Fundamentals Unit 3 : C Operators MODULE 2 unit 1 : Input Output Statements unit 2 : Control Structures unit 3 :

More information

Introduction to Python

Introduction to Python WEEK ONE Introduction to Python Python is such a simple language to learn that we can throw away the manual and start with an example. Traditionally, the first program to write in any programming language

More information

So far we have considered only numeric processing, i.e. processing of numeric data represented

So far we have considered only numeric processing, i.e. processing of numeric data represented Chapter 4 Processing Character Data So far we have considered only numeric processing, i.e. processing of numeric data represented as integer and oating point types. Humans also use computers to manipulate

More information

First Bytes Programming Lab 2

First Bytes Programming Lab 2 First Bytes Programming Lab 2 This lab is available online at www.cs.utexas.edu/users/scottm/firstbytes. Introduction: In this lab you will investigate the properties of colors and how they are displayed

More information

About The Tutorial. Audience. Prerequisites. Copyright & Disclaimer

About The Tutorial. Audience. Prerequisites. Copyright & Disclaimer About The Tutorial C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system.

More information

Keywords are identifiers having predefined meanings in C programming language. The list of keywords used in standard C are : unsigned void

Keywords are identifiers having predefined meanings in C programming language. The list of keywords used in standard C are : unsigned void 1. Explain C tokens Tokens are basic building blocks of a C program. A token is the smallest element of a C program that is meaningful to the compiler. The C compiler recognizes the following kinds of

More information

CP Lab 2: Writing programs for simple arithmetic problems

CP Lab 2: Writing programs for simple arithmetic problems Computer Programming (CP) Lab 2, 2015/16 1 CP Lab 2: Writing programs for simple arithmetic problems Instructions The purpose of this Lab is to guide you through a series of simple programming problems,

More information

C PROGRAMMING FOR MATHEMATICAL COMPUTING

C PROGRAMMING FOR MATHEMATICAL COMPUTING UNIVERSITY OF CALICUT SCHOOL OF DISTANCE EDUCATION BSc MATHEMATICS (2011 Admission Onwards) VI Semester Elective Course C PROGRAMMING FOR MATHEMATICAL COMPUTING QUESTION BANK Multiple Choice Questions

More information

The C Programming Language course syllabus associate level

The C Programming Language course syllabus associate level TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming

More information

Pemrograman Dasar. Basic Elements Of Java

Pemrograman Dasar. Basic Elements Of Java Pemrograman Dasar Basic Elements Of Java Compiling and Running a Java Application 2 Portable Java Application 3 Java Platform Platform: hardware or software environment in which a program runs. Oracle

More information

Base Conversion written by Cathy Saxton

Base Conversion written by Cathy Saxton Base Conversion written by Cathy Saxton 1. Base 10 In base 10, the digits, from right to left, specify the 1 s, 10 s, 100 s, 1000 s, etc. These are powers of 10 (10 x ): 10 0 = 1, 10 1 = 10, 10 2 = 100,

More information

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share.

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share. LING115 Lecture Note Session #4 Python (1) 1. Introduction As we have seen in previous sessions, we can use Linux shell commands to do simple text processing. We now know, for example, how to count words.

More information

Computer Science 281 Binary and Hexadecimal Review

Computer Science 281 Binary and Hexadecimal Review Computer Science 281 Binary and Hexadecimal Review 1 The Binary Number System Computers store everything, both instructions and data, by using many, many transistors, each of which can be in one of two

More information

First Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science

First Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science First Java Programs V. Paúl Pauca Department of Computer Science Wake Forest University CSC 111D Fall, 2015 Hello World revisited / 8/23/15 The f i r s t o b l i g a t o r y Java program @author Paul Pauca

More information

The Answer to the 14 Most Frequently Asked Modbus Questions

The Answer to the 14 Most Frequently Asked Modbus Questions Modbus Frequently Asked Questions WP-34-REV0-0609-1/7 The Answer to the 14 Most Frequently Asked Modbus Questions Exactly what is Modbus? Modbus is an open serial communications protocol widely used in

More information

VHDL Test Bench Tutorial

VHDL Test Bench Tutorial University of Pennsylvania Department of Electrical and Systems Engineering ESE171 - Digital Design Laboratory VHDL Test Bench Tutorial Purpose The goal of this tutorial is to demonstrate how to automate

More information

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

KITES TECHNOLOGY COURSE MODULE (C, C++, DS) KITES TECHNOLOGY 360 Degree Solution www.kitestechnology.com/academy.php info@kitestechnology.com technologykites@gmail.com Contact: - 8961334776 9433759247 9830639522.NET JAVA WEB DESIGN PHP SQL, PL/SQL

More information

Introduction to Java

Introduction to Java Introduction to Java The HelloWorld program Primitive data types Assignment and arithmetic operations User input Conditional statements Looping Arrays CSA0011 Matthew Xuereb 2008 1 Java Overview A high

More information

Secrets of printf. 1 Background. 2 Simple Printing. Professor Don Colton. Brigham Young University Hawaii. 2.1 Naturally Special Characters

Secrets of printf. 1 Background. 2 Simple Printing. Professor Don Colton. Brigham Young University Hawaii. 2.1 Naturally Special Characters Secrets of Professor Don Colton Brigham Young University Hawaii is the C language function to do formatted printing. The same function is also available in PERL. This paper explains how works, and how

More information

2 ASCII TABLE (DOS) 3 ASCII TABLE (Window)

2 ASCII TABLE (DOS) 3 ASCII TABLE (Window) 1 ASCII TABLE 2 ASCII TABLE (DOS) 3 ASCII TABLE (Window) 4 Keyboard Codes The Diagram below shows the codes that are returned when a key is pressed. For example, pressing a would return 0x61. If it is

More information

2010/9/19. Binary number system. Binary numbers. Outline. Binary to decimal

2010/9/19. Binary number system. Binary numbers. Outline. Binary to decimal 2/9/9 Binary number system Computer (electronic) systems prefer binary numbers Binary number: represent a number in base-2 Binary numbers 2 3 + 7 + 5 Some terminology Bit: a binary digit ( or ) Hexadecimal

More information

Computer Programming Tutorial

Computer Programming Tutorial Computer Programming Tutorial COMPUTER PROGRAMMING TUTORIAL by tutorialspoint.com tutorialspoint.com i ABOUT THE TUTORIAL Computer Prgramming Tutorial Computer programming is the act of writing computer

More information

Introduction to Python

Introduction to Python Caltech/LEAD Summer 2012 Computer Science Lecture 2: July 10, 2012 Introduction to Python The Python shell Outline Python as a calculator Arithmetic expressions Operator precedence Variables and assignment

More information

Chapter 3. Input and output. 3.1 The System class

Chapter 3. Input and output. 3.1 The System class Chapter 3 Input and output The programs we ve looked at so far just display messages, which doesn t involve a lot of real computation. This chapter will show you how to read input from the keyboard, use

More information

C++ Language Tutorial

C++ Language Tutorial cplusplus.com C++ Language Tutorial Written by: Juan Soulié Last revision: June, 2007 Available online at: http://www.cplusplus.com/doc/tutorial/ The online version is constantly revised and may contain

More information

Illustration 1: Diagram of program function and data flow

Illustration 1: Diagram of program function and data flow The contract called for creation of a random access database of plumbing shops within the near perimeter of FIU Engineering school. The database features a rating number from 1-10 to offer a guideline

More information

Number Representation

Number Representation Number Representation CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Topics to be Discussed How are numeric data

More information

MS ACCESS DATABASE DATA TYPES

MS ACCESS DATABASE DATA TYPES MS ACCESS DATABASE DATA TYPES Data Type Use For Size Text Memo Number Text or combinations of text and numbers, such as addresses. Also numbers that do not require calculations, such as phone numbers,

More information

Chapter One Introduction to Programming

Chapter One Introduction to Programming Chapter One Introduction to Programming 1-1 Algorithm and Flowchart Algorithm is a step-by-step procedure for calculation. More precisely, algorithm is an effective method expressed as a finite list of

More information

UIL Computer Science for Dummies by Jake Warren and works from Mr. Fleming

UIL Computer Science for Dummies by Jake Warren and works from Mr. Fleming UIL Computer Science for Dummies by Jake Warren and works from Mr. Fleming 1 2 Foreword First of all, this book isn t really for dummies. I wrote it for myself and other kids who are on the team. Everything

More information

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands C Programming for Embedded Microcontrollers Warwick A. Smith Elektor International Media BV Postbus 11 6114ZG Susteren The Netherlands 3 the Table of Contents Introduction 11 Target Audience 11 What is

More information

FEEG6002 - Applied Programming 5 - Tutorial Session

FEEG6002 - Applied Programming 5 - Tutorial Session FEEG6002 - Applied Programming 5 - Tutorial Session Sam Sinayoko 2015-10-30 1 / 38 Outline Objectives Two common bugs General comments on style String formatting Questions? Summary 2 / 38 Objectives Revise

More information

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. Exam Name MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 1) The JDK command to compile a class in the file Test.java is A) java Test.java B) java

More information

University of Hull Department of Computer Science. Wrestling with Python Week 01 Playing with Python

University of Hull Department of Computer Science. Wrestling with Python Week 01 Playing with Python Introduction Welcome to our Python sessions. University of Hull Department of Computer Science Wrestling with Python Week 01 Playing with Python Vsn. 1.0 Rob Miles 2013 Please follow the instructions carefully.

More information

2011, The McGraw-Hill Companies, Inc. Chapter 3

2011, The McGraw-Hill Companies, Inc. Chapter 3 Chapter 3 3.1 Decimal System The radix or base of a number system determines the total number of different symbols or digits used by that system. The decimal system has a base of 10 with the digits 0 through

More information

The C Programming Language

The C Programming Language Chapter 1 The C Programming Language In this chapter we will learn how to write simple computer programs using the C programming language; perform basic mathematical calculations; manage data stored in

More information

How To Write Portable Programs In C

How To Write Portable Programs In C Writing Portable Programs COS 217 1 Goals of Today s Class Writing portable programs in C Sources of heterogeneity Data types, evaluation order, byte order, char set, Reading period and final exam Important

More information

Module 816. File Management in C. M. Campbell 1993 Deakin University

Module 816. File Management in C. M. Campbell 1993 Deakin University M. Campbell 1993 Deakin University Aim Learning objectives Content After working through this module you should be able to create C programs that create an use both text and binary files. After working

More information

CS 241 Data Organization Coding Standards

CS 241 Data Organization Coding Standards CS 241 Data Organization Coding Standards Brooke Chenoweth University of New Mexico Spring 2016 CS-241 Coding Standards All projects and labs must follow the great and hallowed CS-241 coding standards.

More information

Comp151. Definitions & Declarations

Comp151. Definitions & Declarations Comp151 Definitions & Declarations Example: Definition /* reverse_printcpp */ #include #include using namespace std; int global_var = 23; // global variable definition void reverse_print(const

More information

arrays C Programming Language - Arrays

arrays C Programming Language - Arrays arrays So far, we have been using only scalar variables scalar meaning a variable with a single value But many things require a set of related values coordinates or vectors require 3 (or 2, or 4, or more)

More information

Fundamentals of Programming

Fundamentals of Programming Fundamentals of Programming Introduction to the C language Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa February 29, 2012 G. Lipari (Scuola Superiore Sant Anna) The C language

More information

Pseudo code Tutorial and Exercises Teacher s Version

Pseudo code Tutorial and Exercises Teacher s Version Pseudo code Tutorial and Exercises Teacher s Version Pseudo-code is an informal way to express the design of a computer program or an algorithm in 1.45. The aim is to get the idea quickly and also easy

More information

Keil C51 Cross Compiler

Keil C51 Cross Compiler Keil C51 Cross Compiler ANSI C Compiler Generates fast compact code for the 8051 and it s derivatives Advantages of C over Assembler Do not need to know the microcontroller instruction set Register allocation

More information

Phys4051: C Lecture 2 & 3. Comment Statements. C Data Types. Functions (Review) Comment Statements Variables & Operators Branching Instructions

Phys4051: C Lecture 2 & 3. Comment Statements. C Data Types. Functions (Review) Comment Statements Variables & Operators Branching Instructions Phys4051: C Lecture 2 & 3 Functions (Review) Comment Statements Variables & Operators Branching Instructions Comment Statements! Method 1: /* */! Method 2: // /* Single Line */ //Single Line /* This comment

More information

Object-Oriented Programming in Java

Object-Oriented Programming in Java CSCI/CMPE 3326 Object-Oriented Programming in Java Class, object, member field and method, final constant, format specifier, file I/O Dongchul Kim Department of Computer Science University of Texas Rio

More information

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint)

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint) TN203 Porting a Program to Dynamic C Introduction Dynamic C has a number of improvements and differences compared to many other C compiler systems. This application note gives instructions and suggestions

More information

PROG0101 Fundamentals of Programming PROG0101 FUNDAMENTALS OF PROGRAMMING. Chapter 3 Algorithms

PROG0101 Fundamentals of Programming PROG0101 FUNDAMENTALS OF PROGRAMMING. Chapter 3 Algorithms PROG0101 FUNDAMENTALS OF PROGRAMMING Chapter 3 1 Introduction to A sequence of instructions. A procedure or formula for solving a problem. It was created mathematician, Mohammed ibn-musa al-khwarizmi.

More information

Programming Languages CIS 443

Programming Languages CIS 443 Course Objectives Programming Languages CIS 443 0.1 Lexical analysis Syntax Semantics Functional programming Variable lifetime and scoping Parameter passing Object-oriented programming Continuations Exception

More information

qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq

qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq Introduction to Programming using Java wertyuiopasdfghjklzxcvbnmqwertyui

More information

Java CPD (I) Frans Coenen Department of Computer Science

Java CPD (I) Frans Coenen Department of Computer Science Java CPD (I) Frans Coenen Department of Computer Science Content Session 1, 12:45-14:30 (First Java Programme, Inheritance, Arithmetic) Session 2, 14:45-16:45 (Input and Programme Constructs) Materials

More information

Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is

Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is preceded by an equal sign d. its name has undereline 2. Associations

More information

As previously noted, a byte can contain a numeric value in the range 0-255. Computers don't understand Latin, Cyrillic, Hindi, Arabic character sets!

As previously noted, a byte can contain a numeric value in the range 0-255. Computers don't understand Latin, Cyrillic, Hindi, Arabic character sets! Encoding of alphanumeric and special characters As previously noted, a byte can contain a numeric value in the range 0-255. Computers don't understand Latin, Cyrillic, Hindi, Arabic character sets! Alphanumeric

More information

C++ Programming Language

C++ Programming Language C++ Programming Language Lecturer: Yuri Nefedov 7th and 8th semesters Lectures: 34 hours (7th semester); 32 hours (8th semester). Seminars: 34 hours (7th semester); 32 hours (8th semester). Course abstract

More information

C++ INTERVIEW QUESTIONS

C++ INTERVIEW QUESTIONS C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get

More information

ASCII Encoding. The char Type. Manipulating Characters. Manipulating Characters

ASCII Encoding. The char Type. Manipulating Characters. Manipulating Characters The char Type ASCII Encoding The C char type stores small integers. It is usually 8 bits. char variables guaranteed to be able to hold integers 0.. +127. char variables mostly used to store characters

More information

Chapter 7 Assembly Language

Chapter 7 Assembly Language Chapter 7 Assembly Language Human-Readable Machine Language Computers like ones and zeros 0001110010000110 Humans like symbols ADD R6,R2,R6 increment index reg. Assembler is a program that turns symbols

More information

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C 1 An essential part of any embedded system design Programming 2 Programming in Assembly or HLL Processor and memory-sensitive

More information

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013 Oct 4, 2013, p 1 Name: CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013 1. (max 18) 4. (max 16) 2. (max 12) 5. (max 12) 3. (max 24) 6. (max 18) Total: (max 100)

More information

Java Basics: Data Types, Variables, and Loops

Java Basics: Data Types, Variables, and Loops Java Basics: Data Types, Variables, and Loops If debugging is the process of removing software bugs, then programming must be the process of putting them in. - Edsger Dijkstra Plan for the Day Variables

More information

Lecture 5: Java Fundamentals III

Lecture 5: Java Fundamentals III Lecture 5: Java Fundamentals III School of Science and Technology The University of New England Trimester 2 2015 Lecture 5: Java Fundamentals III - Operators Reading: Finish reading Chapter 2 of the 2nd

More information

Useful Number Systems

Useful Number Systems Useful Number Systems Decimal Base = 10 Digit Set = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} Binary Base = 2 Digit Set = {0, 1} Octal Base = 8 = 2 3 Digit Set = {0, 1, 2, 3, 4, 5, 6, 7} Hexadecimal Base = 16 = 2

More information

Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems

Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems This assignment is designed to familiarize you with different numbering systems, specifically: binary, octal, hexadecimal (and decimal)

More information

I PUC - Computer Science. Practical s Syllabus. Contents

I PUC - Computer Science. Practical s Syllabus. Contents I PUC - Computer Science Practical s Syllabus Contents Topics 1 Overview Of a Computer 1.1 Introduction 1.2 Functional Components of a computer (Working of each unit) 1.3 Evolution Of Computers 1.4 Generations

More information

Chapter 2: Elements of Java

Chapter 2: Elements of Java Chapter 2: Elements of Java Basic components of a Java program Primitive data types Arithmetic expressions Type casting. The String type (introduction) Basic I/O statements Importing packages. 1 Introduction

More information

Programmierpraktikum

Programmierpraktikum Programmierpraktikum Claudius Gros, SS2012 Institut für theoretische Physik Goethe-University Frankfurt a.m. 1 of 21 10/16/2012 09:29 AM Java - A First Glance 2 of 21 10/16/2012 09:29 AM programming languages

More information

GBIL: Generic Binary Instrumentation Language. Andrew Calvano. September 24 th, 2015

GBIL: Generic Binary Instrumentation Language. Andrew Calvano. September 24 th, 2015 Introduction: GBIL: Generic Binary Instrumentation Language Andrew Calvano September 24 th, 2015 Analyzing machine-targeted, compiled code is a much more difficult task then analyzing software in which

More information

This is great when speed is important and relatively few words are necessary, but Max would be a terrible language for writing a text editor.

This is great when speed is important and relatively few words are necessary, but Max would be a terrible language for writing a text editor. Dealing With ASCII ASCII, of course, is the numeric representation of letters used in most computers. In ASCII, there is a number for each character in a message. Max does not use ACSII very much. In the

More information

An Introduction to Assembly Programming with the ARM 32-bit Processor Family

An Introduction to Assembly Programming with the ARM 32-bit Processor Family An Introduction to Assembly Programming with the ARM 32-bit Processor Family G. Agosta Politecnico di Milano December 3, 2011 Contents 1 Introduction 1 1.1 Prerequisites............................. 2

More information

C / C++ and Unix Programming. Materials adapted from Dan Hood and Dianna Xu

C / C++ and Unix Programming. Materials adapted from Dan Hood and Dianna Xu C / C++ and Unix Programming Materials adapted from Dan Hood and Dianna Xu 1 C and Unix Programming Today s goals ú History of C ú Basic types ú printf ú Arithmetic operations, types and casting ú Intro

More information

Introduction to Java Applications. 2005 Pearson Education, Inc. All rights reserved.

Introduction to Java Applications. 2005 Pearson Education, Inc. All rights reserved. 1 2 Introduction to Java Applications 2.2 First Program in Java: Printing a Line of Text 2 Application Executes when you use the java command to launch the Java Virtual Machine (JVM) Sample program Displays

More information

CS1020 Data Structures and Algorithms I Lecture Note #1. Introduction to Java

CS1020 Data Structures and Algorithms I Lecture Note #1. Introduction to Java CS1020 Data Structures and Algorithms I Lecture Note #1 Introduction to Java Objectives Java Basic Java features C Java Translate C programs in CS1010 into Java programs 2 References Chapter 1 Section

More information

Computer Science 2nd Year Solved Exercise. Programs 3/4/2013. Aumir Shabbir Pakistan School & College Muscat. Important. Chapter # 3.

Computer Science 2nd Year Solved Exercise. Programs 3/4/2013. Aumir Shabbir Pakistan School & College Muscat. Important. Chapter # 3. 2013 Computer Science 2nd Year Solved Exercise Chapter # 3 Programs Chapter # 4 Chapter # 5 Chapter # 6 Chapter # 7 Important Work Sheets Aumir Shabbir Pakistan School & College Muscat 3/4/2013 Chap #

More information

Lab Experience 17. Programming Language Translation

Lab Experience 17. Programming Language Translation Lab Experience 17 Programming Language Translation Objectives Gain insight into the translation process for converting one virtual machine to another See the process by which an assembler translates assembly

More information

csce4313 Programming Languages Scanner (pass/fail)

csce4313 Programming Languages Scanner (pass/fail) csce4313 Programming Languages Scanner (pass/fail) John C. Lusth Revision Date: January 18, 2005 This is your first pass/fail assignment. You may develop your code using any procedural language, but you

More information

Lecture 22: C Programming 4 Embedded Systems

Lecture 22: C Programming 4 Embedded Systems Lecture 22: C Programming 4 Embedded Systems Today s Goals Basic C programming process Variables and constants in C Pointers to access addresses Using a High Level Language High-level languages More human

More information

Chapter 13 - The Preprocessor

Chapter 13 - The Preprocessor Chapter 13 - The Preprocessor Outline 13.1 Introduction 13.2 The#include Preprocessor Directive 13.3 The#define Preprocessor Directive: Symbolic Constants 13.4 The#define Preprocessor Directive: Macros

More information

Scoping (Readings 7.1,7.4,7.6) Parameter passing methods (7.5) Building symbol tables (7.6)

Scoping (Readings 7.1,7.4,7.6) Parameter passing methods (7.5) Building symbol tables (7.6) Semantic Analysis Scoping (Readings 7.1,7.4,7.6) Static Dynamic Parameter passing methods (7.5) Building symbol tables (7.6) How to use them to find multiply-declared and undeclared variables Type checking

More information

- Hour 1 - Introducing Visual C++ 5

- Hour 1 - Introducing Visual C++ 5 - Hour 1 - Introducing Visual C++ 5 Welcome to Hour 1 of Teach Yourself Visual C++ 5 in 24 Hours! Visual C++ is an exciting subject, and this first hour gets you right into the basic features of the new

More information

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage Outline 1 Computer Architecture hardware components programming environments 2 Getting Started with Python installing Python executing Python code 3 Number Systems decimal and binary notations running

More information

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner.

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner. Handout 1 CS603 Object-Oriented Programming Fall 15 Page 1 of 11 Handout 1 Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner. Java

More information

Numbering Systems. InThisAppendix...

Numbering Systems. InThisAppendix... G InThisAppendix... Introduction Binary Numbering System Hexadecimal Numbering System Octal Numbering System Binary Coded Decimal (BCD) Numbering System Real (Floating Point) Numbering System BCD/Binary/Decimal/Hex/Octal

More information

Appendix K Introduction to Microsoft Visual C++ 6.0

Appendix K Introduction to Microsoft Visual C++ 6.0 Appendix K Introduction to Microsoft Visual C++ 6.0 This appendix serves as a quick reference for performing the following operations using the Microsoft Visual C++ integrated development environment (IDE):

More information

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012 CDA 3200 Digital Systems Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012 Outline Data Representation Binary Codes Why 6-3-1-1 and Excess-3? Data Representation (1/2) Each numbering

More information

Lexical Analysis and Scanning. Honors Compilers Feb 5 th 2001 Robert Dewar

Lexical Analysis and Scanning. Honors Compilers Feb 5 th 2001 Robert Dewar Lexical Analysis and Scanning Honors Compilers Feb 5 th 2001 Robert Dewar The Input Read string input Might be sequence of characters (Unix) Might be sequence of lines (VMS) Character set ASCII ISO Latin-1

More information

Building Applications Using Micro Focus COBOL

Building Applications Using Micro Focus COBOL Building Applications Using Micro Focus COBOL Abstract If you look through the Micro Focus COBOL documentation, you will see many different executable file types referenced: int, gnt, exe, dll and others.

More information

1 Description of The Simpletron

1 Description of The Simpletron Simulating The Simpletron Computer 50 points 1 Description of The Simpletron In this assignment you will write a program to simulate a fictional computer that we will call the Simpletron. As its name implies

More information

ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6)

ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6) ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6) 1 COMPUTER LANGUAGES In order for a computer to be able to execute a program, the program must first be present

More information

Data Storage: Each time you create a variable in memory, a certain amount of memory is allocated for that variable based on its data type (or class).

Data Storage: Each time you create a variable in memory, a certain amount of memory is allocated for that variable based on its data type (or class). Data Storage: Computers are made of many small parts, including transistors, capacitors, resistors, magnetic materials, etc. Somehow they have to store information in these materials both temporarily (RAM,

More information

Cobol. By: Steven Conner. COBOL, COmmon Business Oriented Language, one of the. oldest programming languages, was designed in the last six

Cobol. By: Steven Conner. COBOL, COmmon Business Oriented Language, one of the. oldest programming languages, was designed in the last six Cobol By: Steven Conner History: COBOL, COmmon Business Oriented Language, one of the oldest programming languages, was designed in the last six months of 1959 by the CODASYL Committee, COnference on DAta

More information

sqlite driver manual

sqlite driver manual sqlite driver manual A libdbi driver using the SQLite embedded database engine Markus Hoenicka mhoenicka@users.sourceforge.net sqlite driver manual: A libdbi driver using the SQLite embedded database engine

More information

Linux Driver Devices. Why, When, Which, How?

Linux Driver Devices. Why, When, Which, How? Bertrand Mermet Sylvain Ract Linux Driver Devices. Why, When, Which, How? Since its creation in the early 1990 s Linux has been installed on millions of computers or embedded systems. These systems may

More information

Sequential Program Execution

Sequential Program Execution Sequential Program Execution Quick Start Compile step once always g++ -o Realtor1 Realtor1.cpp mkdir labs cd labs Execute step mkdir 1 Realtor1 cd 1 cp../0/realtor.cpp Realtor1.cpp Submit step cp /samples/csc/155/labs/1/*.

More information