Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 140 Computer Programming (I) Second semester- 2014-2015 (3 credits) Imam Mohammad bin Saud Islamic University College of Computer Science and Information.

Similar presentations


Presentation on theme: "CS 140 Computer Programming (I) Second semester- 2014-2015 (3 credits) Imam Mohammad bin Saud Islamic University College of Computer Science and Information."— Presentation transcript:

1 CS 140 Computer Programming (I) Second semester- 2014-2015 (3 credits) Imam Mohammad bin Saud Islamic University College of Computer Science and Information Computer Science Department 1 L. Dania Alomar

2 Instructor Lecturer Dania Alomar, College of Computer science and Information, My Email: cs.dania@yahoo.com Office: 3A 132. Office hours: ◦ Sun: 5 th and 6 th lectures. ◦ Tue: 5 th and 6 th lectures. ◦ Thurs: 5 th and 6 th lectures. Web site: http://daniacs.wordpress.com/http://daniacs.wordpress.com/ 2

3 Textbook Textbook : ◦ C++ How to Program,  by Deitel and Deitel, Pearson  7 th or 8 th Edition. References : C++ Programming: From Problem Analysis to Program Design,  by De D. S. Malik,  2006 3

4 Objectives Introduce fundamentals of structured programming, with emphasis on understanding functions, variables, and control structures. Introduce various tools used in programming, including editors, compilers, linkers, and loaders. Use the C++ language to implement the problem solving and algorithm design skills. Declare and use C++ class objects, their methods and attributes Understand the concept of a pointer variable and a dynamic data variable and be able to declare and use them in C++ programs. Learn how to write and use recursive functions Declare and manipulate different kinds of arrays 4

5 Topics Covered This course will cover the following topics: ◦ General introduction to C++ programming ◦ Complete C++ program ◦ Variables ◦ Functions ◦ Control Structures ◦ Arrays ◦ Pointers ◦ Introduction to OO programming 5

6 Grading 1 st midterm (15%) will be on the 7 th week of the semester. 11 March,2014,Tuesday 6 th lecture. 2 nd midterm (20%) will be on the 12 th week of the semester. 12 April,2014, Tuesday 6 th lecture. Quizzes(5%). Lab(20%). Final exam (40%). 6

7 Policies Handouts will be uploaded to the course web site. Any announcement will be posted on the course web site. It is your responsibility to check course website once in a while to keep yourself updated. It is necessary to attend the class and lab regularly to build a comprehensive foundation of the course. If you exceed the limit of absence (total of 15 hours) you will not be allowed to enter the final exam. Second time late class coming; student will be considered absent for 1 day. Absence from lab sessions is considered as part of your overall absence. No makeup quizzes for any reason. If you do not show up you will get a zero. No makeup midterm and final exams. If you have an approved circumstance, you will be allowed to enter a comprehensive exam at the end of this semester. The exam will include the whole curriculum. You should present your medical excuses, signed by the committee of excuses, no later than a week from your absence. Otherwise, it will not be accepted. Studying is from the book; correct answers are drawn from the text book. TAs are responsible for lab marks. Lecturers will not change the mark given by a TA. 7

8 Problem Solving Programming is a process of problem solving Problem solving techniques ◦ Analyze the problem ◦ Outline the problem requirements ◦ Design steps (algorithm) to solve the problem Algorithm: ◦ Step-by-step problem-solving process ◦ Solution achieved in finite amount of time 8

9 Representation of Algorithms A single algorithm can be represented in many ways: ◦ Formulas: F = (9/5)C + 32 ◦ Words: Multiply the Celsius by 9/5 and add 32. ◦ Flow Charts. ◦ Pseudo-code. In each case, the algorithm stays the same; the implementation differs! 9

10 Sequential - The next sequential instruction is executed(Default flow of execution) Conditional - An instruction is conditionally executed based upon a conditional expression being true. Iteration - A sequence of instructions are repeatedly executed for a specified number of iterations. 10

11 Exercises 1. Write an algorithm that asks the user to enter an integer number and prints the square of that number. 2. Write the algorithm that calculates the area of a circle that the user wants. (Area of a circle = 3.14 X radius X radius). 3. Write the algorithm that asks the user to enter two integer numbers and to choose to make either addition or subtraction of those two numbers. Finally, you have to print the result of the chosen operation. 11

12 Cont. Suppose that the cost of sending an international fax is calculated as follows: Service charges SR 3.00; SR 0.20 per page for the first 10 pages; and SR 0.10 for each additional page. Design an algorithm that asks the user to enter the number of pages to be faxed. The algorithm then uses the number of pages to be faxed to calculate the amount due. 12


Download ppt "CS 140 Computer Programming (I) Second semester- 2014-2015 (3 credits) Imam Mohammad bin Saud Islamic University College of Computer Science and Information."

Similar presentations


Ads by Google