Engineering Programming A

Slides:



Advertisements
Similar presentations
An Introduction to Programming with C++ Fifth Edition Chapter 3 Completing the Problem-Solving Process and Getting Started with C++
Advertisements

Programming Basics Aims of Programming: –The aim of programming is to write programs to accomplish complex tasks Programming method: –functional decompositional.
CS 1400 Using Microsoft Visual Studio 2005 if you don’t have the appropriate appendix.
Computer Science 210 Computer Organization Introduction to C.
CS140: Intro to CS An Overview of Programming in C by Erin Chambers.
CS Tutorial 1 Getting Started with Visual Studio 2012 (Visual Studio 2010 are no longer available on MSDNAA, please choose Visual Studio 2012 which.
Computer Programming for Engineers Introduction to Programming in C Language on Visual C Platform Intro. Comp. Prog. C-Language1.
Jan. 29, 2008(c) Mike Barnoske Introduction to Runtime Debugging Using the Visual C++ IDE COP 4331: OO Processes for SW Development © Dr. David A. Workman.
Introduction In The Name Of Allah, The Beneficent, The Merciful.
ZONG Wen Department of Computer Science and Engineering The Chinese University of Hong Kong
Mohammadreza Asghari Oskoei University of Allameh 2012 Introduction to Visual Studio 2010.
How to start Visual Studio 2008 or 2010 (command-line program)
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
1 C Programming Week 2 Variables, flow control and the Debugger.
Programming with Visual Studio 2005.NET A short review of the process.
Using Microsoft Visual Studio C++ Express 2005 Name: Dr Ju Wang Ashwin Belle Course Resource:
Programming with Visual Studio.NET A short review of the process.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
1 Programming Environment and Tools VS.Net 2012 First project MSDN Library.
Using Visual Basic 2010 Express Version. Studio vs Express For most purposes irrespective the version of Visual Studio the express version is sufficient.
Cs423-cotter1 Windows Operating Environment. cs423-cotter2 Windows Operating Environment 32 bit operating environment – Windows XP Microsoft Visual Studio.net,.net2005,
Introducing with Microsoft visual C++ software development Environment Instructor: Professor Brian J. d'Auriol, Ph.D. TA: Rossi Kamal Course: Advanced.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
Open project in Microsoft Visual Studio → build program in “Release” mode.
Programming language – C++ Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University.
Exercise 1 #include int main() { printf(“Hello C Programming!\n”); return 0; } 1.Run your Visual Studio 2008 or Create a new “project” and add.
Introduction to C programming. History of C programming Invented and Developed by Dennis Ritchie and Brian Kernighan at Bell Laboratories in 1972 Predecessor.
NOTE: C programs consist of functions one of which must be main. C programs consist of functions one of which must be main. Every C program begins executing.
1 Visual Studio 2005 Options for Debug Mode: C++, Fortran, Linker December 8, 2009 Intel Compiler Version
Tutorial 1 Writing Your First C++ Program CSC1110C Introduction to Computer Programming By Paul Pun Acknowledgement: Special thanks to Dr. Michael Fung.
1 CS 192 Lecture 4 Winter 2003 December 8-9, 2003 Dr. Shafay Shamail.
Computer Science 210 Computer Organization
Tools of the Trade
CS1010 Programming Methodology
Introduction to C CSE 2031 Fall /3/ :33 AM.
Module 1: Getting Started
2008/11/10: Lecture 16 CMSC 104, Section 0101 John Y. Park
Quick Start Guide for Visual Studio 2010
מבוא כללי למדעי המחשב תרגול 2
Computer Science 210 Computer Organization
C Programming Lecture Series
Computer Programming Fall 2012 תרגול
Lab 1 Introduction to C++.
Computer Programming Summer 2017
הרצאה 08 פרמטרים ל- main קרן כליף.
מ- C++ ל- C קרן כליף.
Chapter 8 The Loops By: Mr. Baha Hanene.
1. Open Visual Studio 2008.
Functions, Part 2 of 3 Topics Functions That Return a Value
Introduction to Programming in C
Introduction to C Topics Compilation Using the gcc Compiler
A function with one argument
Lab 1 Introduction to C++.
Week 2 Variables, flow control and the Debugger
Our Environment We will exercise on Microsoft Visual C++ v.6
C PROGRAMMING LECTURE METHODS
Double click Microsoft Visual Studio 2010 on the Computer Desktop
Arrays I Handling lists of data.
Introduction to C Topics Compilation Using the gcc Compiler
C Programming Language
Visual Studio Tools for Unity 2.0 Preview
Computer Terms Review from what language did C++ originate?
Assignment Operators Topics Increment and Decrement Operators
Introduction to C Programming
Introduction to C CSE 2031 Fall /15/2019 8:26 AM.
Compile and run c files.
Functions, Part 2 of 3 Topics Functions That Return a Value
Microsoft Connect /14/ :11 AM
Presentation transcript:

Engineering Programming A תרגול 1 01.11.2011 Introduction to C - Fall 2010 - Amir Menczel

Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel מידע כללי אתר הקורס – http://web.bgu.ac.il/engn/cse/Academic/academics-courses-websites.htm שעות קבלה – יום ג' 16:00-18:00, בניין 37 חדר 112- כתובת דואר אלקטרוני – menczel@bgu.ac.il 6 עבודות תכנות – חובה, 30%. מבחן מסכם – 70%. Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel Introduction to C - Fall 2010 - Amir Menczel

Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel הכרת אתר הקורס Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel סביבת פיתוח - כללי במהלך הקורס נשתמש בסביבת העבודה Visual Studio 2010 המותקנת במעבדות. נתמקד רק בסביבת הפיתוח Visual C++ 2010. מרכיבים בסיסיים: עורך (Editor) משמש להכנת קבצי מקור של תכניות C . מהדר (Compiler) מתרגם את קבצי המקור שאתם כותבים בשפת C לשפת המכונה. כתוצאה מההידור נוצר קובץ .obj Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

סביבת פיתוח – כללי (המשך) קישור (Linker) מחבר את תכנית המקור (או כמה קבצי מקור) עם פונקציות מהספריות הסטנדרטיות לקובץ אחד שמהווה תכנית לביצוע (זהו קובץ ההרצה בעל סיומת exe שנוצר כתוצאה מהקישור(. בנייה (build) תהליך ביצוע הידור ולאחריו קישור. מנפה (Debugger) כלי עזר לגילוי מיקומן של טעויות לוגיות בתכנית. יילמד בתרגול 2. Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel סביבת פיתוח - הורדה ניתן להוריד גרסא חינמית לזמן מוגבל, Visual C++ 2010 Express לעבודה מהבית. קישור: http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel סביבת הפיתוח – הורדה Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

סביבת פיתוח – תוכנית ראשונה הפעלת הסביבה Start  All Programs  Microsoft Visual Studio 2010 Express  Microsoft Visual C++ 2010 Express ניצור פרוייקט חדש - הפרויקט הוא למעשה אוסף של קבצים ותיקיות שבאמצעותן מאפשרת לנו VS2010 להריץ תוכניות C . File New  Project Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

סביבת פיתוח – תוכנית ראשונה (המשך) Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

סביבת פיתוח – תוכנית ראשונה (המשך) Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

סביבת פיתוח – תוכנית ראשונה (המשך) הוספת קובץ חדש לפרוייקט Project  Add New Item Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

סביבת פיתוח – תוכנית ראשונה (המשך) שימו לב לסיומת Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

סביבת פיתוח – תוכנית ראשונה (המשך) העתיקו את השורות הבאות לחלון העריכה #include <stdio.h> void main(){ printf("Welcome to C Programming!\n"); } שמירת הקובץ לפרוייקט תתבצע על ידי File Save tir1_1.c Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

סביבת פיתוח – תוכנית ראשונה (המשך) פעולת הידור (קומפילציה) מתבצעת ע"י Ctrl+F7 או: פעולת קישור מתבצעת ע"י F7 או: BuildBuild Solution Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

סביבת פיתוח – תוכנית ראשונה (המשך) הרצת תוכנית מתבצעת ע"י: Ctrl + F5 Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

סביבת פיתוח – Redirection שנו את הקוד שכתבתם לקוד הבא: #include <stdio.h> void main(){ int num; printf("Hello! Please enter a integer number:\n"); scanf("%d", &num); printf("The number was %d.\n", num); } הריצו את התוכנית החדשה, הכניסו קלטים שונים ושימו לב לפלטים המתקבלים. Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

סביבת פיתוח – Redirection נשנה את הגדרות הפרוייקט כך שהתוכנית תכתוב לקובץ טקסט output.txtבמקום למסך. לחצו: Project  Properties Configuration Properties  Debugging Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

סביבת פיתוח – Redirection נריץ את התוכנית והפעם נשים לב כי בתיקיית הפרוייקט נוצר קובץ טקסט חדש output.txt המכיל את הפלטים של התוכנית שהרצנו. Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

סביבת פיתוח – Redirection נשנה את הגדרות הפרוייקט כך שהתוכנית תקבל את הקלטים ישירות מקובץ טקסט input.txt. לחצו: Project  Properties Configuration Properties  Debugging Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

סביבת פיתוח – Redirection טרם הרצת התוכנית, ניצור בתיקיית הפרוייקט קובץ טקסט חדש בשם input.txt ונרשום בו מספר שלם כרצוננו. נריץ את התוכנית ונקבל ישירות את כל הפלטים בהתאם לקלט שרשמנו בקובץ input.txt. Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

סביבת פיתוח – Redirection שימו לב כי ניתן לשלב בין הפקודות וכך התוכנית תעבוד אך ורק עם קובץ הקלט וקובץ הפלט. Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel שגיאות קומפילציה File  Close Solution סגרו את הפרוייקט הנוכחי, צרו פרוייקט חדש והקלידו את הקוד הבא: /* Program that calculates the average of x and y #include <stdio.h> void main() { int sum=0; x=4; y=10; sum=sum+x sum=sum+y; printf("The average of x and y is %d\n", sum/2); Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel

Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel שגיאות קומפילציה בצעו פעולת קומפילציה. הודעות של ה- Compiler מופיעות בחלק התחתון של המסך. תקן את שגיאות הקומפילציה בתכנית בהתאם להודעות השגיאה. שימו לב! מומלץ לתקן תמיד את השגיאה הראשונה ברשימת השגיאות ושוב לקמפל את התכנית. המשך בפעולות הנדרשות עד אשר לא תהיינה יותר שגיאות קומפילציה. Engineering Programming – Fall 2012 – Amihai Savir & Amir Menczel