תרגילים ופתרונות בשפת C

Size: px
Start display at page:

Download "תרגילים ופתרונות בשפת C"

Transcription

1 תרגילים ופתרונות בשפת C הדפסה, קלט פלט משתנים כתב וערך: שייקה בילו תרגיל - 1 כתוב תוכנית המדפיסה את המשפט: * C * I Love כאשר לפניו שורת כוכביות ואחריו שורת כוכביות. int main() printf("************\n"); printf("* I Love C *\n"); printf("************\n"); return 0; תרגיל - 2 כתוב תוכנית המדפיסה את המספרים , 34, ו- 23 כאשר כל אחד יופיע בשורה נפרדת. int main() printf("34\n4535\n7899\n23\n"); return 0; 1

2 תרגיל - 3 כתוב תוכנית שתדפיס את המשפט: I love learning C בשורה אחת, כל מילה בשורה נפרדת, בתוך קופסת דולרים. viod main() printf("i love learning C\n"); printf("i\n love\n learning \n C \n"); printf("$$$$$$$$$$$$$$$$$$$$$\n"); printf("$ I love learning C $\n"); printf("$$$$$$$$$$$$$$$$$$$$$\n"); תרגיל - 4 כתוב תוכנית הקולטת שני מספרים ומדפיסה את תוצאת החיבור שלהם, את תוצאת החיסור ביניהם ואת מכפלתם. void main() int mis1, mis2; /* Get an input from the user */ printf("please enter two integers: "); scanf("%d%d", &mis1, &mis2); /* Output the results */ printf("%d + %d = %d\n", mis1, mis2, mis1+mis2); printf("%d - %d = %d\n", mis1, mis2, mis1-mis2); printf("%d * %d = %d\n", mis1, mis2, mis1*mis2); 2

3 תרגיל - 5 כתוב תוכנית הקולטת שלושה מספרים ומדפיסה את הממוצע שלהם. int main() int mis1, mis2, mis3; double average; /* Get an input from the user */ printf("please enter three integers: "); scanf("%d%d%d", &mis1, &mis2, &mis3); /* Calculate the average - pay attention to the 3.0! */ average = (mis1+mis2+mis3) / 3.0; /* Output the results */ printf("the average is %lf\n", average); return 0; int main() int x, y, z; x = (y = 4, z = 5); printf("%d\n", x); return 0; תרגיל - 6 לפניך תוכנית בשפת C מה יודפס בסיום התוכנית? תשובה: פלט התוכנית הוא 5. 3

4 int mis1,sum; mis1=3; sum=mis1+4; printf("mis1=%d\n",mis1); printf("sum=%d\n",sum); תרגיל 7 מה תדפיס התוכנית הבאה: התשובה: פלט התוכנית יהיה mis1=3 ו- sum=7 תרגיל - 8 כתוב תוכנית אשר הקלט שלה הוא מספר מסמרים והפלט שלה הוא מספר הקופסאות שניתן למלא במלואן על ידי המסמרים, כאשר תכולת קופסה היא 50 מסמרים. int main() int rails_number; printf("please enter number of nails: "); scanf("%d", &rails_number); printf("the number of full nail boxes is %d\n", rails_number/50); return 0; 4

5 int gil,shana; printf("how old are you\n"); scanf("%d",&gil); shana=2009-gil; printf("you have been borned in %d\n",shana); תרגיל 9 בדוק מהו הפלט של התוכנית ומה מבצעת התוכנית? התשובה: התוכנית קולטת את הגיל של המשתמש ומדפיסה באיזו שנה הוא נולד. כתוב תוכנית הקולטת 2 מספרים עשרוניים ותדפיס קודם את המספר השני ואחריו #include<stdio.h> float num1, num2; printf("enter the first number\n"); scanf("%f",&num1); printf("enter the second number\n"); scanf("%f",&num2); printf("the numbers are: %3.1f, %3.1f\n",num2,num1); תרגיל 10 את הראשון. 5

6 int mis1,sum1,sum2,sum3; תרגיל 11 כתוב תוכנית הקולטת מספר שלם ותבצע את הפעולות הבאות:.45 printf("enter the number\n"); scanf("%d",&mis1); sum1=mis1*3; sum2=mis1-10; sum3=mis1+45; printf("1) %d\n2) %d\n3) %d\n",sum1,sum2,sum3); כפול את המספר ב- 3, תחסיר מהמספר 10 ותחבר למספר תרגיל 12 כתוב תוכנית הקולטת שני מספרים עשרוניים ותדפיס: את התוצאה של חיבור שני המספרים, חיסור שני המספרים,מכפלתם וחילוק שני המספרים. float mis1,mis2; printf("enter the first Number:\n"); scanf("%f",&mis1); printf("enter the second Number:\n");scanf("%f",&mis2); printf("%3.0f + %3.0f = %3.0f\n",mis1,mis2,mis1+mis2); printf("%3.0f * %3.0f = %3.0f\n",mis1,mis2,mis2*mis2); printf("%3.0f - %3.0f = %3.0f\n",mis1,mis2,mis1-mis2); printf("%3.1f / %3.1f = %3.1f\n",mis1,mis2,mis1/mis2); 6

7 תרגיל 13 כתוב תוכנית הקולטת את האות Y או N, במידה והאות היא Y התוכנית תדפיס YES char c; printf("enter Y Or N\n"); scanf("%c",&c); switch(c) case 'Y': printf("yes!!!"); break; case 'N': printf("no!!!"); break; במידה והיא N התוכנית תדפיס.NO פתרון : 7

8 תרגיל 14 כתוב תוכנית הקולטת 3 זווית. התוכנית תדפיס אם ניתן ליצור משולש או לא ניתן int zavit1,zavit2,zavit3,sum; (זכרו - סכום זווית במשולש שווה ל 180 מעלות) printf("enter 3 numbers to create tringle - must be 180 degree\n"); scanf("%d %d %d",&zavit1,&zavit2,&zavit3); printf("%d+%d+%d=%d\n",zavit1,zavit2,zavit3,zavit1+zavit2+zavit3); sum=zavit1+zavit2+zavit3; if(sum>180) printf("you cannot Create tringle With these Values!!!"); else if(sum<180) printf("you cannot Create tringle With these Values!!!"); else if(sum==180) printf("you can create tringle with these values!!!"); 8

9 תרגיל 15 כתוב תוכנית הקולטת 3 מספרים. התוכנית תבצע את הפעולות הבאות: תדפיס את המספרים ותבדוק מהו המספר הגדול מבין ה- 3. int mis1,mis2,mis3; printf("enter first number\n"); scanf("%d",&mis1); printf("enter second number\n"); scanf("%d",&mis2); printf("enter third number\n"); scanf("%d",&mis3); printf("the numbers are:\t%d\t%d\t%d\n",mis1,mis2,mis3); if((mis1>mis2) && (mis1>mis3)) printf("the number %d is the highest number\n",mis1); else if((mis2>mis1) && (mis2>mis3)) printf("the number %d is the highest number\n",mis2); else if((mis3>mis1) && (mis3>mis2)) printf("the number %d is the highest number\n",mis3); 9

10 תרגיל - 16 לפנינו סדרת משתנים שבעזרתם ניתן לחשב נפח, שטח מעטפת ופני הגוף של גופים הנדסיים פשוטים. שטח מעטפת S בסיס גוף - B פני גוף T גובה גוף H נפח - V היקף - P רדיוס - r פני הגוף T=2B+PH T=2 +2r H פאי= שטח מעטפת S=PH 2r S=H צלע - a נפח V=BH V H= קו יוצר - שם הגוף קובייה מנסרה גליל פירמידה חרוט כדור =T כמו שטח מעטפת עליך לפתור את סדרת הבעיות הבאות באמצעות השימוש במשתנים הר"מ (בעלי שמות משמעותיים) ושילובם בתוכנית בשפת C אשר קולטת מהמשתמש את כל המשתנים הנדרשים ומחשבת בעזרתם את: נפח של כל הגופים בטבלה. שטח של כל אחד מהגופים בטבלה. שטח פני הגוף של כל אחד מהגופים בטבלה

11 תרגיל - 17 כתוב תוכנית הקולטת מספרים ומבצעת פעולה חשבונית פשוטה. #include<stdio.h> void main () int mis1,mis2,toztaa; printf ("\n please enter the first number:"); scanf ("%d",&mis1); printf ("\n please enter the second number:"); scanf ("%d",&mis2); toztaa=mis1*2+2*mis1*mis2; printf ("\n the result is %d\n", toztaa); תרגיל - 18 כתוב תוכנית המדפיסה את השורש של המספר 5. #include<stdio.h> #include<stdlib.h> #include<math.h> void main (void) int i=5; float result; result=sqrt((double) i ); printf ("the square root of 5 is:\n"); printf ("\n %f", result); התשובה שנקבל צריכה להיות:

12 int i=5; int result; result=sqrt( i ); printf ("\n %d", result); אולם אם היינו מבצעים את השינויים בקטע התוכנית וכותבים כך: מקבלים 2 בתשובה, והרי ידוע שזו תשובה לא מדויקת... מה עם כל מה שאחרי הנקודה..? תרגיל 19 כתוב תוכנית המקבלת שני קודקודים של משולש ישר זווית שקודקוד אחד שלו נמצא (0,0) ומדפיסה את שטח המשולש. int main() int x1, y1; int x2, y2; int len1, len2; scanf("%d%d%d%d", &x1, &y1, &x2, &y2); /* no need for power and sqrt, as one of the elements is zero as we assume */ len1 = x1+y1; len2 = x2+y2; printf("triangle area: %lf\n", (len1+len2)/2.0); return 0; 1

13 תרגיל 20 לפניך שתי תוכניות בשפת C מצא מהי השגיאה בכל אחת מהן והסבר אותן. void main() int num1,num2 = 0; printf("num1 /num2 = %d\n",num1 /num2); פתרון: שגיאה בזמן ריצה כיוון שמחלקים ב- 0. void main() int mispar1,mispar2; printf("%d + %d = %d\n", mispar1, mispar2, mispar1+mispar2); פתרון: שגיאה בזמן ריצה כי ניגשים למשתנים שמעולם לא אותחלו בערך משמעותי. תרגיל 21 כתוב תוכנית אשר מקבלת מהמשתמש מרחק בקילומטרים ומהירות בקמ"ש ומחשבת את זמן ההגעה בדקות ובשעות אל היעד. void main() int road_distance; int speed; printf("please enter the road distance (in km): "); scanf("%d", &road_distance); printf("please enter the driving speed (km/h): "); scanf("%d", &speed); printf("it will take you %d hours and %d minutes to arrive to your target.\n", road_distance/speed, ( road_distance % speed) * 60 / speed ); 1

14 int main(void) char a,b,s,r,p; תרגיל - 22 בנה משחק אבן נייר ומספריים כאשר: r=rock, s=scissors, p=paper printf("rock, Papper and Scissors.\n\n"); printf("made by CreativeSight for FXP forums\n"); printf("instruction:\n"); printf("each player will chose his move, one by one.\n"); printf("***for rock press 'r', for paper press 'p', for scissors press 's'***.\n\n"); printf("player 1 - Make your choise:\n"); scanf("%c\n",&a); printf("player 2 - Make your choise:\n"); scanf("%c\n",&b); if((a=='r') && (b=='r')) //if both rock. printf("none Won, Both players choose Rock.\n"); if((a=='s') && (b=='s')) //if both sccisors. printf("none Won, Both players choose Sccisors.\n"); if((a=='p') && (b=='p')) //if both paper. printf("none Won, Both players choose Paper.\n"); if((a=='p') && (b=='r')) //if P,R. 1

15 printf("player 2 Wins!\n"); if((a=='p') && (b=='s')) printf("player 1 Wins!\n"); if((a=='r') && (b=='p')) printf("player 2 Wins!\n"); if((a=='r') && (b=='s')) printf("player 1 Wins!\n"); if((a=='s') && (b=='p')) printf("player 1 Wins!\n"); if((a=='s') && (b=='r')) printf("player 2 Wins!\n"); //if P,S. //if R,P. //if R,S. //if S,P. //if S,R. 1

תרגילים ופתרונות בשפת - C הסתעפויות

תרגילים ופתרונות בשפת - C הסתעפויות תרגילים ופתרונות בשפת - C הסתעפויות כתב וערך: שייקה בילו תרגיל - 1 כתוב תוכנית שתקבל מהמשתמש שלושה מספרים, ותציג את הגדול מביניהם על המסך. #include void main() int mis1, mis2, mis3, max; printf("please

More information

חוברת תרגילים לתרגול יסודות התכנות

חוברת תרגילים לתרגול יסודות התכנות פעולות קלט ופלט חוברת תרגילים לתרגול יסודות התכנות קלוט 3 מספרים. סכם אותם, הצג את שלושתם ואת תוצאת הסיכום. int num1, num2, num3,sum; Console.WriteLine("please enter 3 numbers"); num1 = int.parse(console.readline());

More information

מבוא לתכנות ב- JAVA תרגול 7

מבוא לתכנות ב- JAVA תרגול 7 מבוא לתכנות ב- JAVA תרגול 7 רקורסיה - הקדמה הגדרה רקורסיבית: חדר הוא מסודר אם צד שמאל שלו מסודר שלו מסודר. וצד ימין שיטת פתרון רקורסיבית: פתרון מופעים פשוטים יותר של בעיה בכדי לפתור את הבעיה המקורית רקורסיה

More information

משתנים שעור מס. 2 כל הזכויות שמורות דר ' דרור טובי המרכז האוניברסיטאי אריאל 1

משתנים שעור מס. 2 כל הזכויות שמורות דר ' דרור טובי המרכז האוניברסיטאי אריאל 1 משתנים שעור מס. 2 דרור טובי דר' כל הזכויות שמורות דר ' דרור טובי המרכז האוניברסיטאי אריאל 1 תפקיד המשתנים הצהרה על משתנה השמת ערך במשתנה int a, b, c; a = 1234; b = 99; c = a + b; משתנים מאפשרים לנו לשמור

More information

פתרון מוצע לבחינת מה"ט ב_שפת c מועד אביב תשע"ח, פברואר 8102 מחבר: מר שייקה בילו, מכללת אורט רחובות

פתרון מוצע לבחינת מהט ב_שפת c מועד אביב תשעח, פברואר 8102 מחבר: מר שייקה בילו, מכללת אורט רחובות פתרון מוצע לבחינת מה"ט ב_שפת c מועד אביב תשע"ח, פברואר 8102 מחבר: מר שייקה בילו, מכללת אורט רחובות שאלה מספר 1 התוכנית מגדירה חמישה משתנים שלמים: השלושה הראשונים הם שלושה מצביעים - *s *t,i. j ושלושה נוספים

More information

לתיכנות עם MATLAB Lecture 5: Boolean logic and Boolean expressions

לתיכנות עם MATLAB Lecture 5: Boolean logic and Boolean expressions מבוא לתיכנות עם MATLAB 234127 Lecture 5: Boolean logic and Boolean expressions Written by Prof. Reuven Bar-Yehuda, Technion 2013 Based on slides of Dr. Eran Eden, Weizmann 2008 1 >>g = [89 91 80 98]; >>p

More information

לתיכנות עם MATLAB Lecture 5: Boolean logic and Boolean expressions

לתיכנות עם MATLAB Lecture 5: Boolean logic and Boolean expressions מבוא לתיכנות עם MATLAB 23427 Lecture 5: Boolean logic and Boolean expressions Written by Prof. Reuven Bar-Yehuda, Technion 203 Based on slides of Dr. Eran Eden, Weizmann 2008 ביטויים לוגיים דוגמא: תקינות

More information

מבוא לתכנות ב- JAVA מעבדה 2

מבוא לתכנות ב- JAVA מעבדה 2 מבוא לתכנות ב- JAVA מעבדה 2 מה בתרגול טיפוסים פרימיטיביים המרות טיפוסים אופרטורים יחסיים ולוגיים משפט if-else בתרגול הקודם טיפוסים פרימיטביים לייצוג מספרים שלמים וממשיים ואופרטורים לפעולות בין מספרים.1

More information

קורס תכנות שיעור שני: שימוש במשתנים,

קורס תכנות שיעור שני: שימוש במשתנים, קורס תכנות שיעור שני: שימוש במשתנים, בקרת זרימה, לולאות 1 נושאי השיעור היום משתנים )variables( טיפוסי משתנים בשפת C הגדרת משתנים השמה למשתנים פעולות על משתנים קליטת ערכים מהמשתמש הדפסה משתנים בקרת זרימה

More information

מבוא למדעי המחשב תירגול 2: מבוא למדעי המחשב מ' - תירגול 2

מבוא למדעי המחשב תירגול 2: מבוא למדעי המחשב מ' - תירגול 2 מבוא למדעי המחשב תירגול 2: לולאות, קלט, וטיפוסים 1 תוכנייה לולאת while קלט טיפוסי משתנים המרת טיפוסים טיפוס char 2 לולאת while 3 לולאת while קטע קוד מתבצע שוב ושוב כל עוד תנאי מתקיים int number = 40; while(number>0)

More information

מבוא למדעי המחשב תירגול 3:

מבוא למדעי המחשב תירגול 3: מבוא למדעי המחשב תירגול 3: לולאות, קלט, וטיפוסים תוכנייה לולאת while קלט טיפוסי משתנים המרת טיפוסים טיפוס char מבוא למדעי המחשב מ' - תירגול 3 2 לולאת while מבוא למדעי המחשב מ' - תירגול 3 3 לולאת while

More information

Exams questions examples

Exams questions examples Exams questions examples 1 Exam example 1. y - x what נק' ( לפניך הפעולה הרקורסיבית מקבלת כפרמטרים שני מספרים שלמים ו 10 )? מה יהיה הפלט כתוצאה מזימון הפעולה what public static int what(int x, int y) if(x

More information

Engineering Programming A

Engineering Programming A Engineering Programming A תרגול 5 25.11.2012 מערכים חד-מימדיים )תזכורת( לדוגמא: מערך בשם Arr בגודל 8 שאיבריו מטיפוס int 3 7 5 6 8 1 23 16 0 1 2 3 4 5 6 7 ב - arr[0] ב יושב ערך שהוא המספר השלם 3 arr[1]

More information

מבוא למדעי המחשב תרגול 5: לולאות ומערכים

מבוא למדעי המחשב תרגול 5: לולאות ומערכים מבוא למדעי המחשב תרגול 5: לולאות ומערכים תוכנייה לולאת while, do while, for מערכים מערכים דו ממדיים 2 לולאות 3 תזכורת: לולאת while גוף הלולאה מתבצע שוב ושוב כל עוד התנאי מתקיים int number; scanf( %d, &number);

More information

מבוא למדעי המחשב תרגול 13: עצים בינאריים

מבוא למדעי המחשב תרגול 13: עצים בינאריים מבוא למדעי המחשב תרגול 13: עצים בינאריים עצים בינאריים - הגדרה הגדרה: עץ בינארי הוא עץ ריק (בלי צמתים) או עץ המורכב משורש ושני תתי-עצים, הוא עץ בינארי. ימני ושמאלי, שכל אחד מהם תרגיל 1 עץ בינארי מסודר

More information

Amortized Analysis, Union-Find,

Amortized Analysis, Union-Find, Practical Session No. 13 Amortized Analysis, Union-Find, AMORTIZED ANALYSIS Refers to finding the average running time per operation, over a worst-case sequence of operations. Amortized analysis differs

More information

Practical Session - Heap

Practical Session - Heap Practical Session - Heap Heap Heap Maximum-Heap Minimum-Heap Heap-Array A binary heap can be considered as a complete binary tree, (the last level is full from the left to a certain point). For each node

More information

Computer Programming A תרגול 9

Computer Programming A תרגול 9 Computer Programming A תרגול 9 1 מטרת התרגול הקצאת זיכרון מבנים רשימות דינאמית ניהול הזיכרון בתוכנית עד כה כל המשתנים שראינו היו לוקאליים. משך הקיום של משתנים מקומיים הוא הזמן אשר הפונקציה בה הם נמצאים

More information

לתיכנות עם MATLAB Lecture 5: Boolean logic and Boolean expressions

לתיכנות עם MATLAB Lecture 5: Boolean logic and Boolean expressions מבוא לתיכנות עם MATLAB 234127 Lecture 5: Boolean logic and Boolean expressions Written by Prof. Reuven Bar-Yehuda, Technion 2013 Based on slides of Dr. Eran Eden, Weizmann 2008 1 motivation Proper academic

More information

מבוא לתכנות בשפת C. Tzachi (Isaac) Rosen

מבוא לתכנות בשפת C. Tzachi (Isaac) Rosen מבוא לתכנות בשפת C מצביעים והקצאה דינאמית כתובות של משתנים לכל משתנה כתובת של המקום שלו בזיכרון כבר ראינו: שם של מערך הוא למעשה הכתובת של התא הראשון )באינדקס 0( של המערך להזכירכם: תא של מערך הינו משתנה

More information

מבוא לתכנות ב- JAVA מעבדה 3. Ipc161-lab3

מבוא לתכנות ב- JAVA מעבדה 3. Ipc161-lab3 מבוא לתכנות ב- JAVA מעבדה 3 Ipc161-lab3 נושאי התרגול ניפוי שגיאות לולאות בדיקת תרגילים בקורס )השוואת פלטים למול הפתרון המצופה( כיצד להפנות את פלט התוכנית לקובץ טקסט איך להשוות תכנים של שני קבצים בעזרת

More information

הנכות 1 םוכיס לוגרת 14 1

הנכות 1 םוכיס לוגרת 14 1 תוכנה 1 סיכום תרגול 14 1 קצת על מנשקים מנשק יכול להרחיב יותר ממנשק אחד שירותים במנשק הם תמיד מופשטים וציבוריים public interface MyInterface { public abstract int foo1(int i); int foo2(int i); The modifiers

More information

רזח יליגרתו םי יראני ב ם

רזח יליגרתו םי יראני ב ם מבוא למדעי המחשב עצים בינאריים ותרגילי חזרה תרגול 13: עצים בינאריים - הגדרה הגדרה: עץ בינארי הוא עץ ריק )בלי צמתים( או עץ המורכב משורש ושני תתי-עצים, הוא עץ בינארי. ימני ושמאלי, שכל אחד מהם שאלה עץ בינארי

More information

Introduction to Programming in C תרגול 8

Introduction to Programming in C תרגול 8 Introduction to Programming in C תרגול 8 1 1 נושאים מצביעים רקע אופרטורים על מצביעים מצביעים כפרמטרים לפונקציה הקצאה דינמית מבנים תאור הזיכרון של המחשב: מצביעים ניתן לחשוב על זיכרון המחשב כעל רצף של תאים,

More information

סכום (סדרת ערכים) אחרת - דוגמא: סכום-ספרות (num) אם < 10 num החזר 1 או אם = 0 = num החזר 0 public static int numofdigits (int num)

סכום (סדרת ערכים) אחרת - דוגמא: סכום-ספרות (num) אם < 10 num החזר 1 או אם = 0 = num החזר 0 public static int numofdigits (int num) 1 תבנית צבירה תבניות אלגוריתמיות לפעולות רקורסיביות תבנית צבירה לסדרת ערכים: סכום (סדרת ערכים) החזר את ערך הקצה + סכום (סדרת הערכים ללא ערך הקצה) דוגמא: פעולה המחזירה את סכום הספרות שבמספר שלם לא שלילי

More information

PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE

PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE 1. Write a C program to perform addition, subtraction, multiplication and division of two numbers. # include # include int a, b,sum,

More information

כתב וערך: שייקה בילו. תרגיל 1 הגדירו פונקציה בשם print_list המקבלת מצביע לתחילת רשימה דו כיוונית ומדפיסה את איברי הרשימה.

כתב וערך: שייקה בילו. תרגיל 1 הגדירו פונקציה בשם print_list המקבלת מצביע לתחילת רשימה דו כיוונית ומדפיסה את איברי הרשימה. תרגילים ופתרונות בשפת C כתב וערך: שייקה בילו רשימות מקושרות תרגיל 1 הגדירו פונקציה בשם print_list המקבלת מצביע לתחילת רשימה דו כיוונית ומדפיסה את איברי הרשימה. void print_list (CellPtr list) print_rev

More information

Algorithms. Intro2CS week 5

Algorithms. Intro2CS week 5 Algorithms Intro2CS week 5 1 Computational problems A computational problem specifies an inputoutput relationship What does the input look like? What should the output be for each input? Example: Input:

More information

Structured programming. Exercises 3

Structured programming. Exercises 3 Exercises 3 Table of Contents 1. Reminder from lectures...................................................... 1 1.1. Relational operators..................................................... 1 1.2. Logical

More information

שים לב! אין לכתוב בשוליים. השוליים יחתכו לצורך סריקת המבחן.

שים לב! אין לכתוב בשוליים. השוליים יחתכו לצורך סריקת המבחן. מספר : 804042 שם המרצה: תאריך הבחינה: ד"ר גדעון גרדוול, ד"ר אריאלה ריכרדסון 13/02/2013 משך הבחינה )בדקות(: 150 חומר עזר מותר לשימוש: ללא חומר עזר מחשבון: ללא מחשבון מס' תלמיד: מכון: לב/נוה, טל, טל-דעת,

More information

מצליחה. 1. int fork-bomb() 2. { 3. fork(); 4. fork() && fork() fork(); 5. fork(); printf("bla\n"); 8. return 0; 9. }

מצליחה. 1. int fork-bomb() 2. { 3. fork(); 4. fork() && fork() fork(); 5. fork(); printf(bla\n); 8. return 0; 9. } שאלה : (4 נקודות) א. ב. ג. (5 נקודות) הגדירו את המונח race-condition במדוייק לא להשמיט פרטים. ספקו דוגמא. (5 נקודות) מהו? Monitor נא לספק הגדרה מלאה. ( נקודות) ( נקודות) ציינו כמה תהליכים יווצרו בקוד הבא

More information

מבוא לתכנות ב- JAVA מעבדה 4

מבוא לתכנות ב- JAVA מעבדה 4 מבוא לתכנות ב- JAVA מעבדה 4 מה בתרגול מערכים מחרוזות מערך חד מימדי מערך הוא מבנה המחזיק סדרה של איברים מאותו טיפוס גודל המערך הוא קבוע )נקבע בעת יצירת המערך( הגישה לכל איבר היא באמצעות אינדקס למה לי מערך?

More information

תרגול 4 פונקציות. מבנה של פונקציה: public static <return value type> <function name> (<arg1 type> <arg1>, <arg2 type> <arg2>, ) { <function body> }

תרגול 4 פונקציות. מבנה של פונקציה: public static <return value type> <function name> (<arg1 type> <arg1>, <arg2 type> <arg2>, ) { <function body> } נושאי התרגול: מה הן פונקציות הגדרת פונקציה,קריאה לפונקציה העברת ארגומנטים,החזרת ערך או void העברת משתנים פרימיטיביים ומערכים לפונקציה העמסה של פונקציות תרגול 4 פונקציות מוטיבציה לעיתים,אנו נזקקים לבצע

More information

מבוא לתכנות תוכנית שעור מס. 1 1 דר' דרור טובי, המרכז האוניברסיטאי אריאל בשומרון.

מבוא לתכנות תוכנית שעור מס. 1 1 דר' דרור טובי, המרכז האוניברסיטאי אריאל בשומרון. מבוא לתכנות תוכנית ראשונה שעור מס. 1 דרור טובי דר' 1 מבוא לתכנות בשפת ++C C \ שלום!! מרצה ד"ר דרור טובי, drorto@ariel.ac.il שעות קבלה: יום ב, 10-12 טלפון )אריאל( 03 9076547 אתר הקורס: http://www.ariel.ac.il/cs/pf/tdror/courses/cpp

More information

Name Roll No. Section

Name Roll No. Section Indian Institute of Technology, Kharagpur Computer Science and Engineering Department Class Test I, Autumn 2012-13 Programming & Data Structure (CS 11002) Full marks: 30 Feb 7, 2013 Time: 60 mins. Name

More information

A control structure refers to the way in which the Programmer specifies the order of executing the statements

A control structure refers to the way in which the Programmer specifies the order of executing the statements Control Structures A control structure refers to the way in which the Programmer specifies the order of executing the statements The following approaches can be chosen depending on the problem statement:

More information

Dr. R. Z. Khan, Associate Professor, Department of Computer Science

Dr. R. Z. Khan, Associate Professor, Department of Computer Science ALIGARH MUSLIM UNIVERSITY Department of Computer Science Course: CSM-102: Programming & Problem Solving Using C Academic Session 2015-2016 UNIT-2: Handout-3 Topic: Control Structures (Selection & Repetition)

More information

מבוא לתכנות ב- JAVA תרגול 6

מבוא לתכנות ב- JAVA תרגול 6 מבוא לתכנות ב- JAVA תרגול 6 מה בתרגול )methods( פונקציות/שיטות ב- Java הגדרת פונקציה קריאה/הפעלה העברת ארגומנטים ערכי החזרה מבוא לפונקציות- שימוש חוזר בקוד נניח שבמהלך תוכנית נדרשתם לחשב את הסכום של המספרים

More information

Computer Programming Summer 2017

Computer Programming Summer 2017 Computer Programming Summer 2017 תרגול 6 פונקציות 1 פונקציות פונקציות מאפשרות שימוש בקטעי קוד כקופסה שחורה ללא צורך לדעת את פרטי המימוש )מספיק לדעת מה עושה הפונקציה ולא איך(. למשל: הפונקציה strlen מהתירגול

More information

הנכות 1 תואיגש םע תודדומתהו תואלול,םי : כרעמ 2 לוגרת

הנכות 1 תואיגש םע תודדומתהו תואלול,םי : כרעמ 2 לוגרת תוכנה 1 תרגול 2: מערכים, לולאות והתמודדות עם שגיאות מערכים מערכים Array: A fixed-length data structure for storing multiple values of the same type Example from last week: An array of odd numbers: Indices

More information

הנכות 1 תואיגש םע תודדומתהו תואלול,םיכרעמ : לו 2 גרת

הנכות 1 תואיגש םע תודדומתהו תואלול,םיכרעמ : לו 2 גרת תוכנה 1 תרגול 2: מערכים, לולאות והתמודדות עם שגיאות מערכים Array: A fixed-length data structure for storing multiple values of the same type Example from last week: An array of odd numbers: Indices (start

More information

תכנות מתקדם בשפת C משתנים

תכנות מתקדם בשפת C משתנים תכנות מתקדם בשפת C משתנים 1 משתנים סוגי משתנים בשפת C ההבדלים בין סוגי המשתנים השונים 2 /* This program computes m to the power of n */ /* Assumptions: m is an integer; n is a positive integer */ #include

More information

<exp> ::= <define> <cexp> <define> ::= ( define <var-decl> <cexp> ) / DefExp(var:VarDecl, val:cexp)

<exp> ::= <define> <cexp> <define> ::= ( define <var-decl> <cexp> ) / DefExp(var:VarDecl, val:cexp) הנחיות כלליות: תאריך הבוחן: 10.5.2018 שם המרצה: מני אדלר,מיכאל אלחדד, ירון גונן מבחן בקורס: עקרונות שפות תכנות מס' קורס: 202-1-2051 מיועד לתלמידי: מדעי המחשב והנדסת תוכנה שנה: ב' סמסטר: ב' משך הבוחן: 2

More information

Simple Web Service. namespace MyService { public class Service1 : System.Web.Services.WebService {

Simple Web Service. namespace MyService { public class Service1 : System.Web.Services.WebService { Simple Web Service WS פתיחת פרוייקט File New Project ASP.Net web service project - >http://localhost/webservice1 יצירת שירות המחשב חיבור וחילוק 2 מספרים : הטיפוסים הבסיסיים using System; איסוף וניהוף אוספי

More information

תוכנה 1 תרגול 2: מערכים ומבני בקרה

תוכנה 1 תרגול 2: מערכים ומבני בקרה תוכנה 1 תרגול 2: מערכים ומבני בקרה 2 Useful Eclipse Shortcuts Ctrl+1 quick fix for errors, or small refactoring suggestions Ctrl+SPACE code content assist (auto-completion) Auto completion for main create

More information

Week 3 More Formatted Input/Output; Arithmetic and Assignment Operators

Week 3 More Formatted Input/Output; Arithmetic and Assignment Operators Week 3 More Formatted Input/Output; Arithmetic and Assignment Operators Formatted Input and Output The printf function The scanf function Arithmetic and Assignment Operators Simple Assignment Side Effect

More information

שאלה 1 מהו הפלט של התוכנית הבאה:

שאלה 1 מהו הפלט של התוכנית הבאה: תרגול חזרה שאלה 1 מהו הפלט של התוכנית הבאה: public sttic int wht(int n) { int i; int sum=0; if(n == 0) return 1; for (i=0; i

More information

במידה ולסעיף ניתנה תשובה ובנוסף נרשם לגבי הסעיף לא יודע/ת אזי הניקוד שיינתן

במידה ולסעיף ניתנה תשובה ובנוסף נרשם לגבי הסעיף לא יודע/ת אזי הניקוד שיינתן פקולטה: מדעי הטבע מחלקה: מדעי המחשב שם הקורס: מבוא למחשבים ושפת C קוד הקורס: 2-7028510 תאריך בחינה: שאלות חזרה למבחן. חשוב: אין להסיק ששאלות אחרות לא יכולות להישאל במבחן, אין להסיק כי נושאים מסויימים בסיליבוס

More information

Operating Systems. Practical Session 4 Threads

Operating Systems. Practical Session 4 Threads Operating Systems Practical Session 4 Threads 1 Threads Executed within a process. Allow multiple independent executions under the same process (container). Possible states: running, ready, blocked, terminated.

More information

BSM540 Basics of C Language

BSM540 Basics of C Language BSM540 Basics of C Language Chapter 9: Functions I Prof. Manar Mohaisen Department of EEC Engineering Review of the Precedent Lecture Introduce the switch and goto statements Introduce the arrays in C

More information

16.216: ECE Application Programming Fall 2011

16.216: ECE Application Programming Fall 2011 16.216: ECE Application Programming Fall 2011 Exam 2 Solution 1. (24 points, 6 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling

More information

Program Control Structures

Program Control Structures Program Control Structures Michael Griffiths Corporate Information and Computing Services The University of Sheffield Email m.griffiths@sheffield.ac.uk Control Sequence Structures Selection Structures

More information

תוכנה 1 תרגול 2: מערכים, מבני בקרה ושגיאות

תוכנה 1 תרגול 2: מערכים, מבני בקרה ושגיאות תוכנה 1 תרגול 2: מערכים, מבני בקרה ושגיאות מערכים Array: A fixed-length data structure for storing multiple values of the same type Example: An array of odd numbers: Indices (start from 0) 0 1 2 3 4 5

More information

Computer Programming. Decision Making (2) Loops

Computer Programming. Decision Making (2) Loops Computer Programming Decision Making (2) Loops Topics The Conditional Execution of C Statements (review) Making a Decision (review) If Statement (review) Switch-case Repeating Statements while loop Examples

More information

$ gcc check.c. $ a.out. $ gcc check.c -o check. $ check. $ gcc -Wall check.c -o check. #include <stdio.h>

$ gcc check.c. $ a.out. $ gcc check.c -o check. $ check. $ gcc -Wall check.c -o check. #include <stdio.h> תכנות בסיסי בשפת C תוכנית ראשונה תוכנית ב - C מורכבת מאוסף פונקציות והגדרות טיפוסים. C איננה שפה object oriented כך שאין בה מושגים של מחלקה ואובייקט. נתחיל בתוכנית הראשונה המסורתית, זו המדפיסה הודעה יחידה

More information

int marks[10]; // fixed size and fixed address No change in Memory address.

int marks[10]; // fixed size and fixed address No change in Memory address. Dynamic Memory Allocation : Used When we want to allocate memory during run time. int marks[10]; // fixed size and fixed address No change in Memory address. // fixed size. ( no change in size possible

More information

!"#$% &'($) *+!$ 0!'" 0+'&"$.&0-2$ 10.+3&2),&/3+, %&&/3+, C,-"!.&/+"*0.&('1 :2 %*10% *%7)/ 30'&. 0% /4%./

!#$% &'($) *+!$ 0!' 0+'&$.&0-2$ 10.+3&2),&/3+, %&&/3+, C,-!.&/+*0.&('1 :2 %*10% *%7)/ 30'&. 0% /4%./ 0!'" 0+'&"$ &0-2$ 10 +3&2),&/3+, #include int main() int i, sum, value; sum = 0; printf("enter ten numbers:\n"); for( i = 0; i < 10; i++ ) scanf("%d", &value); sum = sum + value; printf("their

More information

Programming in C תרגול 8

Programming in C תרגול 8 Programming in C תרגול 8 1 1 נושאים מצביעים רקע אופרטורים על מצביעים מצביעים כפרמטרים לפונקציה הקצאת זיכרון דינאמית Malloc free מצביעים תאור הזיכרון של המחשב: ניתן לחשוב על זיכרון המחשב כעל רצף של תאים,

More information

Formatted Input/Output

Formatted Input/Output Chapter 3 Formatted Input/Output 1 The printf Function The printf function must be supplied with a format string ( 格式化字串 ), followed by any values that are to be inserted into the string during printing:

More information

Computer Programming תרגול 6 פונקציות

Computer Programming תרגול 6 פונקציות Computer Programming תרגול 6 פונקציות 1 פונקציות פונקציות מאפשרות שימוש בקטעי קוד כקופסה שחורה ללא צורך לדעת את פרטי המימוש )מספיק לדעת מה עושה הפונקציה ולא איך(. למשל: הפונקציה strlen מהתירגול הקודם.

More information

מערכים שעור מס. 4 כל הזכויות שמורות דר ' דרור טובי המרכז האוניברסיטאי אריאל 1

מערכים שעור מס. 4 כל הזכויות שמורות דר ' דרור טובי המרכז האוניברסיטאי אריאל 1 מערכים שעור מס. 4 דרור טובי דר' כל הזכויות שמורות דר ' דרור טובי המרכז האוניברסיטאי אריאל 1 למה מערכים? ברצוננו לאחסן בתוכנית ציוני בחינה כדי לחשב את ממוצע הציונים וסטיית התקן. נניח ש 30 סטודנטים לקחו

More information

Programming for Engineers in Python

Programming for Engineers in Python Programming for Engineers in Python Lecture 9: Sorting, Searching and Time Complexity Analysis Autumn 2011-12 1 Lecture 8: Highlights Design a recursive algorithm by 1. Solving big instances using the

More information

Programming for Engineers in Python

Programming for Engineers in Python Programming for Engineers in Python Lecture 9: Sorting, Searching and Time Complexity Analysis Autumn 2011-12 1 Lecture 8: Highlights Design a recursive algorithm by 1. Solving big instances using the

More information

C Language Part 2 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee

C Language Part 2 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee C Language Part 2 (Minor modifications by the instructor) 1 Scope Rules A variable declared inside a function is a local variable Each local variable in a function comes into existence when the function

More information

לאחר הרצת התכנית יופיע בחלון הoutput הפלט הבא: run: ******************************* *****Welcome to Java!***** *******************************

לאחר הרצת התכנית יופיע בחלון הoutput הפלט הבא: run: ******************************* *****Welcome to Java!***** ******************************* דוגמה 1: public class Hello { 2: public static void main(string[] args) { 3: System.out.println("*******************************"); 4: System.out.println("*******Welcome to Java!********"); 5: System.out.println("*******************************");

More information

סטודנטים יקרים הפתרונות מוגשים בסרטוני וידאו המלווים בהסבר קולי, כך שאתם רואים את התהליכים בצורה מובנית, שיטתית ופשוטה, ממש כפי שנעשה בשיעור פרטי.

סטודנטים יקרים הפתרונות מוגשים בסרטוני וידאו המלווים בהסבר קולי, כך שאתם רואים את התהליכים בצורה מובנית, שיטתית ופשוטה, ממש כפי שנעשה בשיעור פרטי. סטודנטים יקרים לפניכם ספר תרגילים בקורס ארגון ותכנות המחשב (שפת אסמבלי). הספר הוא חלק מפרויקט חדשני וראשון מסוגו בארץ במקצוע זה, המועבר ברשת האינטרנט.On-line הקורס באתר כולל פתרונות מלאים לספר התרגילים.

More information

תוכנה 1 מערכים. Array Creation and Initialization. Array Declaration. Loop through Arrays. Array Creation and Initialization

תוכנה 1 מערכים. Array Creation and Initialization. Array Declaration. Loop through Arrays. Array Creation and Initialization מערכים תוכנה 1 Array: A fixed-length data structure for storing multiple values of the same type Example from last week: An array of odd numbers: Indices (start from 0) 0 1 2 3 4 5 6 7 תרגול 2: מערכים

More information

Flow of Control. Selection. if statement. True and False in C False is represented by any zero value. switch

Flow of Control. Selection. if statement. True and False in C False is represented by any zero value. switch Flow of Control True and False in C Conditional Execution Iteration Nested Code(Nested-ifs, Nested-loops) Jumps 1 True and False in C False is represented by any zero value The int expression having the

More information

תוכנה 1 מערכים. Array Creation and Initialization. Array Declaration. Array Creation and Initialization. Loop through Arrays

תוכנה 1 מערכים. Array Creation and Initialization. Array Declaration. Array Creation and Initialization. Loop through Arrays מערכים Array: A fixed-length data structure for storing multiple values of the same type תוכנה 1 Example: An array of odd numbers: Indices (start from 0) 0 1 2 3 4 5 6 7 odds: 1 3 5 7 9 11 13 15 odds.length

More information

קורס תכנות בשיעור הקודם למדנו על רקורסיה שיעור שישי: מערכים פונקציה רקורסיבית שאלה חישוב נוסחאות רקורסיביות בשפת C

קורס תכנות בשיעור הקודם למדנו על רקורסיה שיעור שישי: מערכים פונקציה רקורסיבית שאלה חישוב נוסחאות רקורסיביות בשפת C בשיעור הקודם למדנו על רקורסיה פתרנו את בעיית מגדלי הנוי בעזרת רקורסיה כלומר בעזרת פונקציה שקוראת לעצמה. רקורסיה מאפשרת לנו לפתור בעיה "גדולה" בעזרת פתרון של בעיות "קטנות" המרכיבות אותה. קורס תכנות שיעור

More information

תוכנה 1 3 תרגול מס' מערכים ומבני בקרה

תוכנה 1 3 תרגול מס' מערכים ומבני בקרה תוכנה 1 3 תרגול מס' מערכים ומבני בקרה מערכים Array: A fixed-length data structure for storing multiple values of the same type Example: An array of odd numbers: Indices (start from 0) 0 1 2 3 4 5 6 7 odds:

More information

C/Java Syntax. January 13, Slides by Mark Hancock (adapted from notes by Craig Schock)

C/Java Syntax. January 13, Slides by Mark Hancock (adapted from notes by Craig Schock) C/Java Syntax 1 Lecture 02 Summary Keywords Variable Declarations Data Types Operators Statements if, switch, while, do-while, for Functions 2 By the end of this lecture, you will be able to identify the

More information

C/Java Syntax. Lecture 02 Summary. Keywords Variable Declarations Data Types Operators Statements. Functions. if, switch, while, do-while, for

C/Java Syntax. Lecture 02 Summary. Keywords Variable Declarations Data Types Operators Statements. Functions. if, switch, while, do-while, for C/Java Syntax 1 Lecture 02 Summary Keywords Variable Declarations Data Types Operators Statements if, switch, while, do-while, for Functions 2 1 By the end of this lecture, you will be able to identify

More information

כתבו קוד ב- 3 קבצי ה hpp (כתבו כהערה את שם הקובץ מעל) כך שהקוד יהיה תקין ובסגנון טוב. אין חובה

כתבו קוד ב- 3 קבצי ה hpp (כתבו כהערה את שם הקובץ מעל) כך שהקוד יהיה תקין ובסגנון טוב. אין חובה פקולטה: מדעי הטבע מחלקה: מדעי המחשב שם הקורס: מבנה זכרון ושפת ++C קוד הקורס: 7027810 תאריך בחינה: שאלות לדוגמא משך הבחינה: שעתיים שם המרצים: ד"ר אופיר פלא, ד"ר מירי בן ניסן חומר עזר: פתוח שימוש במחשבון:

More information

Communication Networks ( ) / Spring 2011 The Blavatnik School of Computer Science, Tel-Aviv University. Allon Wagner

Communication Networks ( ) / Spring 2011 The Blavatnik School of Computer Science, Tel-Aviv University. Allon Wagner Communication Networks (0368-3030) / Spring 2011 The Blavatnik School of Computer Science, Tel-Aviv University Allon Wagner Kurose & Ross, Chapter 3.5.5, 3.7 (5 th ed.) Many slides adapted from: J. Kurose

More information

פתרון מוצע לבחינה בשפת C של מה"ט מועד אביב תשע"ז, פברואר 2017 מחבר: מר עסאקלה שאדי, מכללת אורט בראודה

פתרון מוצע לבחינה בשפת C של מהט מועד אביב תשעז, פברואר 2017 מחבר: מר עסאקלה שאדי, מכללת אורט בראודה פתרון מוצע לבחינה בשפת C של מה"ט מועד אביב תשע"ז, פברואר 2017 מחבר: מר עסאקלה שאדי, מכללת אורט בראודה שאלה מספר 1 נתונה התכנית הבאה בשפת C: #include #define SUM_OF_3(x,y,z) x+y+z #define AVRG_OF_3(x,y,z)

More information

Programming Language A

Programming Language A Programming Language A Takako Nemoto (JAIST) 22 October Takako Nemoto (JAIST) 22 October 1 / 28 From Homework 2 Homework 2 1 Write a program calculate something with at least two integer-valued inputs,

More information

הנכות 1 םוכיס לוגרת 13 1

הנכות 1 םוכיס לוגרת 13 1 תוכנה 1 סיכום תרגול 13 1 קצת על מנשקים מנשק יכול להרחיב יותר ממנשק אחד שירותים במנשק הם תמיד מופשטים וציבוריים public interface MyInterface { public abstract int foo1(int i); int foo2(int i); The modifiers

More information

UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING

UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING APS 105 Computer Fundamentals Midterm Examination October 20, 2011 6:15 p.m. 8:00 p.m. (105 minutes) Examiners: J. Anderson, T. Fairgrieve,

More information

EECE.2160: ECE Application Programming Spring 2018

EECE.2160: ECE Application Programming Spring 2018 EECE.2160: ECE Application Programming Spring 2018 1. (46 points) C input/output; operators Exam 1 Solution a. (13 points) Show the output of the short program below exactly as it will appear on the screen.

More information

Chapter 4: Expressions. Chapter 4. Expressions. Copyright 2008 W. W. Norton & Company. All rights reserved.

Chapter 4: Expressions. Chapter 4. Expressions. Copyright 2008 W. W. Norton & Company. All rights reserved. Chapter 4: Expressions Chapter 4 Expressions 1 Chapter 4: Expressions Operators Expressions are built from variables, constants, and operators. C has a rich collection of operators, including arithmetic

More information

CSC 270 Survey of Programming Languages

CSC 270 Survey of Programming Languages CSC 270 Survey of Programming Languages C Lecture 1 : Getting Started: in C #include int { A First Program main(void) header makes input and output available to us printf("this is my first C

More information

CS102: Standard I/O. %<flag(s)><width><precision><size>conversion-code

CS102: Standard I/O. %<flag(s)><width><precision><size>conversion-code CS102: Standard I/O Our next topic is standard input and standard output in C. The adjective "standard" when applied to "input" or "output" could be interpreted to mean "default". Typically, standard output

More information

EECE.2160: ECE Application Programming Fall 2017

EECE.2160: ECE Application Programming Fall 2017 EECE.2160: ECE Application Programming Fall 2017 1. (46 points) C input/output; operators Exam 1 Solution a. (13 points) Show the output of the short program below exactly as it will appear on the screen.

More information

1. Write a C program that receives 10 float numbers from the console and sort them in nonascending order, and prints the result

1. Write a C program that receives 10 float numbers from the console and sort them in nonascending order, and prints the result Solutions 1. Write a C program that receives 10 float numbers from the console and sort them in nonascending order, and prints the result #include int main() //Program Start float numbers[10],result;

More information

Lecture 02 Summary. C/Java Syntax 1/14/2009. Keywords Variable Declarations Data Types Operators Statements. Functions

Lecture 02 Summary. C/Java Syntax 1/14/2009. Keywords Variable Declarations Data Types Operators Statements. Functions Lecture 02 Summary C/Java Syntax Keywords Variable Declarations Data Types Operators Statements if, switch, while, do-while, for Functions 1 2 By the end of this lecture, you will be able to identify the

More information

Programming Language A

Programming Language A Programming Language A Takako Nemoto (JAIST) 30 October Takako Nemoto (JAIST) 30 October 1 / 29 From Homework 3 Homework 3 1 Write a program to convert the input Celsius degree temperature into Fahrenheight

More information

Graph Database, think different!

Graph Database, think different! Graph Database, think different! Written by Roni Licher Winter 2014-2015 236363 - Database Systems - Technion Nodes Edges (directed or not) Properties Neo4j and Cypher 4j Graph database (Like SQL server

More information

הנכות 1 םוכיס לוגרת 13 1

הנכות 1 םוכיס לוגרת 13 1 תוכנה 1 סיכום תרגול 13 1 בחינה באופק! הבחינה תכלול את כל הנושאים שכיסינו במהלך הסמסטר: כל ההרצאות כל תרגולים כל תרגילי בית חומר סגור שאלות אמריקאיות 2 קצת על מנשקים מנשק יכול להרחיב שירותים במנשק הם תמיד

More information

Welcome! COMP s1. Programming Fundamentals

Welcome! COMP s1. Programming Fundamentals Welcome! 0 COMP1511 18s1 Programming Fundamentals COMP1511 18s1 Lecture 7 1 Strings Andrew Bennett chars arrays of chars strings 2 Before we begin introduce yourself to the

More information

Welcome! COMP s1 Lecture 7. COMP s1. Before we begin. Strings. Programming Fundamentals. Overview. Andrew Bennett

Welcome! COMP s1 Lecture 7. COMP s1. Before we begin. Strings. Programming Fundamentals. Overview. Andrew Bennett Welcome! COMP1511 18s1 Programming Fundamentals 0 COMP1511 18s1 Lecture 7 Strings Andrew Bennett 1 chars arrays of chars strings Before we begin 2 Overview after this lecture,

More information

Precedence and Associativity Table. % specifiers in ANSI C: String Control Codes:

Precedence and Associativity Table. % specifiers in ANSI C: String Control Codes: CMPE108, Homework-2 (C Fundamentals, Expressions, and Selection Structure.) Student Nr:... Name,Surname:...:... CMPE108 Group:... Signature... Please print this homework, and solve all questions on the

More information

Smart Pointers Nir Adar

Smart Pointers Nir Adar 7.1.2005 גירסה 1.00 Smart Pointers מסמך זה הורד מהאתר. אין להפיץ מסמך זה במדיה כלשהי, ללא אישור מפורש מאת המחבר. מחבר המסמך איננו אחראי לכל נזק, ישיר או עקיף, שיגרם עקב השימוש במידע המופיע במסמך, וכן לנכונות

More information

For questions 4 through 7, select the value assigned to the relevant variable, given the declarations: 3) ) This is not allowed

For questions 4 through 7, select the value assigned to the relevant variable, given the declarations: 3) ) This is not allowed This homework assignment focuses primarily on some of the basic syntax and semantics of C. The answers to the following questions can be determined by consulting a C language reference and/or writing short

More information

מבוא לתכנות ב- JAVA תרגול 5. Ipc161- practical session 5

מבוא לתכנות ב- JAVA תרגול 5. Ipc161- practical session 5 מבוא לתכנות ב- JAVA תרגול 5 Ipc161- practical session 5 מה בתרגול מערכים דו ממדיים )methods( פונקציות/שיטות ב- Java הגדרת פונקציה קריאה/הפעלה העברת ארגומנטים ערכי החזרה מערך דו ממדי מערך של מערכים חד ממדיים

More information

Practical Session No. 14 Topological sort,amortized Analysis

Practical Session No. 14 Topological sort,amortized Analysis Practical Session No. 14 Topological sort,amortized Analysis Topological- Sort Topological sort Ordering of vertices in a directed acyclic graph (DAG) G=(V,E) such that if there is a path from v to u in

More information

The C language. Introductory course #1

The C language. Introductory course #1 The C language Introductory course #1 History of C Born at AT&T Bell Laboratory of USA in 1972. Written by Dennis Ritchie C language was created for designing the UNIX operating system Quickly adopted

More information

Engineering 12 - Spring, 1999

Engineering 12 - Spring, 1999 Engineering 12 - Spring, 1999 1. (18 points) A portion of a C program is given below. Fill in the missing code to calculate and display a table of n vs n 3, as shown below: 1 1 2 8 3 27 4 64 5 125 6 216

More information

Engineering 12 - Spring, 1998

Engineering 12 - Spring, 1998 Engineering 12 - Spring, 1998 1. (15 points) Rewrite the following program so that it uses a while loop in place of the for loop. (Note that a part of the new program is already shown at the bottom of

More information

טבלאות אם נרצה למקם תמונה ומלל זה ליד זה, או רצף של תמונות זו ליד זו כל פריט מיושר לכיוון אחר, נשתמש בטבלאות.

טבלאות אם נרצה למקם תמונה ומלל זה ליד זה, או רצף של תמונות זו ליד זו כל פריט מיושר לכיוון אחר, נשתמש בטבלאות. 1 טבלאות אם נרצה למקם תמונה ומלל זה ליד זה, או רצף של תמונות זו ליד זו כל פריט מיושר לכיוון אחר, נשתמש בטבלאות. - - - - - - - - - טבלה - - - - - - - - - שורה בטבלה Table Row -

More information