Computer Science C++ Placement Exam

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

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

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

El Dorado Union High School District Educational Services

Chapter One Introduction to Programming

C++ Programming Language

13 Classes & Objects with Constructors/Destructors

I PUC - Computer Science. Practical s Syllabus. Contents

Simple C++ Programs. Engineering Problem Solving with C++, Etter/Ingber. Dev-C++ Dev-C++ Windows Friendly Exit. The C++ Programming Language

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

ECE 341 Coding Standard

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

Boolean Expressions, Conditions, Loops, and Enumerations. Precedence Rules (from highest to lowest priority)

Outline. Conditional Statements. Logical Data in C. Logical Expressions. Relational Examples. Relational Operators

Passing 1D arrays to functions.

The C Programming Language course syllabus associate level

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

NEW YORK CITY COLLEGE OF TECHNOLOGY/CUNY Computer Systems Technology Department. COURSE: CST2403 C++ Programming Part 1 ( 4 hours, 3 credits )

9 Control Statements. 9.1 Introduction. 9.2 Objectives. 9.3 Statements

VB.NET Programming Fundamentals

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE. CISY 105 Foundations of Computer Science

Education: P.h.D. Candidate (Santa Clara University, California) M.S. in Computer Engineering (Santa Clara University, California)

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

ALGORITHMS AND FLOWCHARTS

Comp151. Definitions & Declarations

QUIZ-II QUIZ-II. Chapter 5: Control Structures II (Repetition) Objectives. Objectives (cont d.) 20/11/2015. EEE 117 Computer Programming Fall

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

5 Arrays and Pointers

JavaScript: Control Statements I

C++FA 5.1 PRACTICE MID-TERM EXAM

Conditions & Boolean Expressions

arrays C Programming Language - Arrays

Informatica e Sistemi in Tempo Reale

PROGRAMMING IN C PROGRAMMING IN C CONTENT AT A GLANCE

While Loop. 6. Iteration

An Incomplete C++ Primer. University of Wyoming MA 5310

C PROGRAMMING FOR MATHEMATICAL COMPUTING

Course Title: Software Development

Introduction to Java

The University of Alabama in Huntsville Electrical and Computer Engineering CPE Test #4 November 20, True or False (2 points each)

Tutorial on C Language Programming

6. Control Structures

JAVA - QUICK GUIDE. Java SE is freely available from the link Download Java. So you download a version based on your operating system.

General Software Development Standards and Guidelines Version 3.5

CS1010 Programming Methodology A beginning in problem solving in Computer Science. Aaron Tan 20 July 2015

CS 241 Data Organization Coding Standards

C++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 3: Input/Output

Computer Programming Tutorial

Module 10. Coding and Testing. Version 2 CSE IIT, Kharagpur

Selection Statements

Decision Logic: if, if else, switch, Boolean conditions and variables

#820 Computer Programming 1A

Curriculum Map. Discipline: Computer Science Course: C++

Common Beginner C++ Programming Mistakes

Two-way selection. Branching and Looping

B.Sc.(Computer Science) and. B.Sc.(IT) Effective From July 2011

Example of a Java program

Object Oriented Software Design

Object Oriented Software Design II

EFFECTIVELY TEACHING C IN AN INTRODUCTORY EMBEDDED MICROCONTROLLER COURSE. Jeffrey J. Richardson ABSTRACT

Repetition Using the End of File Condition

ADVANCED SCHOOL OF SYSTEMS AND DATA STUDIES (ASSDAS) PROGRAM: CTech in Computer Science

Object Oriented Software Design

Operator Overloading. Lecture 8. Operator Overloading. Running Example: Complex Numbers. Syntax. What can be overloaded. Syntax -- First Example

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

El Dorado Union High School District Educational Services

AP Computer Science Java Subset

Chapter 5. Selection 5-1

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

Answers to Review Questions Chapter 7

How To Write Portable Programs In C

Sequential Program Execution

Calling the Function. Two Function Declarations Here is a function declared as pass by value. Why use Pass By Reference?

Lab 2 - CMPS 1043, Computer Science I Introduction to File Input/Output (I/O) Projects and Solutions (C++)

COWLEY COLLEGE & Area Vocational Technical School

C++ INTERVIEW QUESTIONS

Embedded C Programming, Linux, and Vxworks. Synopsis

Programming and Software Development (PSD)

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

C++ Language Tutorial

Section of DBMS Selection & Evaluation Questionnaire

Topics. Parts of a Java Program. Topics (2) CS 146. Introduction To Computers And Java Chapter Objectives To understand:

ECE 122. Engineering Problem Solving with Java

Semantic Analysis: Types and Type Checking

Management Information Systems 260 Web Programming Fall 2006 (CRN: 42459)

Conditional Statements Summer 2010 Margaret Reid-Miller

Install Java Development Kit (JDK) 1.8

Moving from CS 61A Scheme to CS 61B Java

Computer Programming I

Learning Computer Programming using e-learning as a tool. A Thesis. Submitted to the Department of Computer Science and Engineering.

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)

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

Computer Programming I

Lecture 3. Arrays. Name of array. c[0] c[1] c[2] c[3] c[4] c[5] c[6] c[7] c[8] c[9] c[10] c[11] Position number of the element within array c

AppendixA1A1. Java Language Coding Guidelines. A1.1 Introduction

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

IS0020 Program Design and Software Tools Midterm, Feb 24, Instruction

Transcription:

Computer Science C++ Placement Exam The Computer Science subdepartment now has available a placement exam for students who wish to demonstrate their competence in the material covered in the course CSCI C101 Computer Programming. Students who pass this exam at a high level may enroll in CSCI C201 Introduction to Computer Science without first completing C101. Such students may also have the course C101 placed on their transcript for 4 credit hours, provided they pay the required fees. Topics to Be Covered on the C++ Exam The placement exam is designed to test carefully whether a student has mastery of the topics covered in C101 so that the student can do the work in C201 without burdening the instructor with inappropriate questions. Mastery of all the following topics is required: 1. Use of the IDE (Integrated Development Environment) of Borland C++ for Windows 95. Students must demonstrate the ability to edit source code efficiently, to save a file, to compile source code into an executable program, to run a program, to use the debugger, and to print a source code file, all from the IDE. 2. Systematic program development. Students must demonstrate ability to organize a program into appropriate functions and to write pseudo-code for the algorithms used by the functions. 3. The elementary features of the C++ programming language. A complete checklist of all the required features is given father along in this document. 4. Good programming style. Students must demonstrate that they can a. use a clear and consistent indenting method to produce a logically formatted program; b. choose appropriate identifiers for variables; c. write complete, understandable documentation for a program and each of its functions, and also provide helpful line-by-line comments where these are appropriate. Format of the C++ Exam The exam will be in two parts. The first part will last one hour and will require the student to answer a number of written questions about C++ and program development. The second part will be conducted in a computer laboratory, where the student will be given four hours in which to write one or more complete C++ programs and/or fill in the missing parts of some incomplete programs. 1

A Warning about the Programming Part of the C++ Exam A student program that correctly exhibits the behavior prescribed in a programming problem will not be given a high grade unless the program is also well written. Simple correctness of behavior is not sufficient for a good grade. Thus, to give some examples, a program that's poorly formatted, or poorly documented, or that makes unnecessary tests of data, or that uses a poor algorithm will be given a low grade. A Checklist of C++ Features That Must Be Mastered 1. Structure of C++ programs: a. placement of "#include" directives; b. placement of the main function and other function declarations (prototypes) and definitions (code). 2. Basic syntax rules for a. identifiers; b. declarations and initializations of variables; c. control structures ("if", "if...else...", "switch", "while", "do...while", "for"). 3. Fundamental data types: a. int, char, float, long, double; understanding of the inexactness of stored floating point values; b. enumerated types. 4. Common operators and the value of an operator expression: a. assignment operators: =, +=, -=, *=, /=, %= ; b. arithmetic operators: +, ++, -, --, *, /, % ; c. relational operators: <, <=, >, >=, ==,!= ; d. logical operators: &&,,! ; e. the conditional operator (ternary):? : ; f. elementary precedence rules among these operators. 5. Elementary I/O (input/output) in C++ using the following operators and functions defined in the iostream.h header file: a. cout, cin, << and >> ; b. endl; c. cin.get(), cin.getline(); 6. Conditional statements using if... or if...else...; nested conditional statements. 2

7. Loops using while... or do...while... or for... 8. Functions and parameter passing. Difference between a value parameter and a reference parameter. Function declarations (prototypes) and function definitions (code). 9. These functions from the math.h header file: sqrt(); pow(); fabs(); 10. Elementary scope rules. 11. Arrays. The use of the qualifier "const" while passing an array to a function; Advice to C Programmers Most of the features of C++ listed in the "Checklist" above will be familiar to you from the C language. Here are the four principal differences between C and C++ that you will be expected to have mastered. (There are many other differences, and those will be covered in C201.) 1. In addition to C style commenting using "/*" and "*/", C++ has single-line comments starting with "//". 2. C++ allows declarations of constants that can, for example, be used to dimension arrays. Good C++ programmers avoid using the #define directive, since it does not allow for type checking of the defined quantities. 3. C++ allows passing variables to functions by reference, which avoids having to deal with pointers while passing elementary data objects. You will be required to avoid pointers and to use reference parameters whenever reference parameters are appropriate. 4. C++ has a simpler system of I/O (input/output) that uses the type-safe operators << and >> as well as several functions in the header file iostream.h. Things to Avoid in the C++ Programming Exam 1. Do not use "break;" to exit from a loop. Similarly, do not use any "goto" statements. 2. Do not use the C language I/O functions printf() and scanf(). Use only the functions and operators defined in the iostream.h header file and (if you like) the iomanip.h header file. 3. Do not use any "#define" directives in any program. 4. Do not use a global variable in any program. 3

Some Formatting Requirements for the C++ Programming Exam 1. Use all upper case letters for identifiers that denote constants. This is standard practice in C and C++ programming. 2. Use a consistent style for identifiers for variables. You may choose any one of the following styles, but then use only that one style you have chosen: location_of_2nd_target LocationOf2ndTarget Location_Of_2nd_Target Location_of_2nd_target locationof2ndtarget 3. Use exactly three spaces for each level of indenting. Correct: while (i < LIMIT) Incorrect: while (i < LIMIT) Incorrect: while (i < LIMIT) // Digits and lower case letters are used, with words // separated by the underscore character. // Each word of the identifier starts with an upper // case letter or a digit. Words are not separated. // Each word of the identifier starts with an upper // case letter or a digit, and words are separated. // First word starts with upper case letter. Lower // case is used elsewhere; words are separated. // Each word of the identifier except the first starts // with a digit or upper case letter. 4. Use any one of the following styles for placement of the braces in a compound statement in a C++ program. Whichever style you pick, use that style consistently throughout the program. Style 1: if (x < 0) { Style 2: if (x < 0) { 4

Style 3: if (x < 0) { 5. Place a blank on each side of every binary operator symbol. Correct: while (i < LIMIT) Incorrect: while (i<limit) if (a[i]>a[best]) best=i; The following three pages reproduce a "handout" distributed by Professor J. Russo to students in his programming classes at IUSB. They explain in detail the C++ programming style that he prefers. The pages contain a number of valuable suggestions that will help you write C++ code that is easily understood. 5