Simula 1967 n Smalltalk 19721980 n Ada 19831995

  • Slides: 34
Download presentation

 שפות לתכנות מונחה עצמים Simula 1967 n Smalltalk 1972/1980 n Ada 1983/1995 n

שפות לתכנות מונחה עצמים Simula 1967 n Smalltalk 1972/1980 n Ada 1983/1995 n C++ 1986 n Eiffel 1992 n Java 1995 n C# 2002 n [Pascal 1970] [C 1972] Copyright © Moti Ben-Ari, 2005.

API- דוגמה לטיפוס מה JButton n void set. Enabled(boolean b) void set. Font)Font f(

API- דוגמה לטיפוס מה JButton n void set. Enabled(boolean b) void set. Font)Font f( void set. Text(String text( boolean is. Enabled() void add. Action. Listener(Action. Listener l( Copyright © Moti Ben-Ari, 2005.

Pascal - תכנית פשוטה ב program Hello; begin writeln(‘Hello world’) end. Copyright © Moti

Pascal - תכנית פשוטה ב program Hello; begin writeln(‘Hello world’) end. Copyright © Moti Ben-Ari, 2005.

Java - תכנית פשוטה ב class Hello { public static void main)String[] args} (

Java - תכנית פשוטה ב class Hello { public static void main)String[] args} ( Output. Window. println("Hello world; (" { { Copyright © Moti Ben-Ari, 2005.

program Most. Points)input, output; ( const LAST = 100; type Point. Type = array[1.

program Most. Points)input, output; ( const LAST = 100; type Point. Type = array[1. . LAST] of integer; var Points: Point. Type ; Max. Points, P, Num. Play: integer ; function Max(A: Point. Type; Players: integer): integer; var Point. Max, P: integer; begin Point. Max : = A[1; [ for P : = 2 to Players do if A[P] > Point. Max then Point. Max : = A[P; [ Max : = Point. Max end {Max; { Copyright © Moti Ben-Ari, 2005.

begin writeln')Enter number of points ; (': Num. Play ; 1 =: read(Points[Num. Play;

begin writeln')Enter number of points ; (': Num. Play ; 1 =: read(Points[Num. Play; ([ while Points]Num. Play] > -1 do begin Num. Play : = Num. Play + 1; read(Points[Num. Play([ end; Num. Play : = Num. Play - 1; Max. Points : = Max(Points, Num. Play; ( for P : = 1 to Num. Play do if Points[P] = Max. Points then writeln('Prize to player', P( end. Copyright © Moti Ben-Ari, 2005.

#include <stdio. h< const int LAST = 100; int max(int a[], int num. Play(

#include <stdio. h< const int LAST = 100; int max(int a[], int num. Play( { int point. Max =a[0; [ int p; for )p = 1; p < num. Play; p++) if )a[p] > point. Max ( point. Max = a[p ; [ return point. Max; } Copyright © Moti Ben-Ari, 2005.

int main() { int points]LAST; [ int max. Points, num. Play, p ; 0

int main() { int points]LAST; [ int max. Points, num. Play, p ; 0 = printf")Enter number of points; (”: scanf("%d", points[num. Play; ([ while )points[num. Play] > -1} ( num. Play++; scanf%")d", points[num. Play; ([ } max. Points =max(points, num. Play; ( for )p = 0; p < num. Play; p++) if )points[p] == max. Points( printf")Prize to player %dn", p’( } Copyright © Moti Ben-Ari, 2005.

class Most. Points. J { static int max)int[] a, int num. Play} ( int

class Most. Points. J { static int max)int[] a, int num. Play} ( int point. Max = a[0; [ for (int p = 1; p < num. Play; p(++ if (a[p] > point. Max ( point. Max = a[p; [ return point. Max; { static final int LAST = 100; Copyright © Moti Ben-Ari, 2005.

public static void main)String[] args} ( int []points = new int[LAST; [ int max.

public static void main)String[] args} ( int []points = new int[LAST; [ int max. Points, num. Play = 0 ; points[num. Play] = Input. Requestor. request. Int("Enter; (": while (points[num. Play] > -1} ( num. Play; ++ points[num. Play] = Input. Requestor. request. Int("Enter; (": { max. Points = max(points, num. Play; ( for (int p = 0; p < num. Play; p (++ if (points[p] == max. Points( Output. Window. println("Prize to" + p; ( { { Copyright © Moti Ben-Ari, 2005.

using System; class Most. Points { static int max)int[] a, int num. Play} (

using System; class Most. Points { static int max)int[] a, int num. Play} ( int point. Max = a[0; [ for (int p = 1; p < num. Play; p(++ if (a[p] > point. Max ( point. Max = a[p; [ return point. Max; { static readonly int LAST = 100; Copyright © Moti Ben-Ari, 2005.

static void Main} () int[] points = new int[LAST; [ int max. Points, num.

static void Main} () int[] points = new int[LAST; [ int max. Points, num. Play = 0; Console. Write. Line("Enter; (": points[num. Play] = int. Parse(Console. Read. Line; (() while (points[num. Play] > -1} ( num. Play; ++ points[num. Play] = int. Parse(Console. Read. Line; (() { max. Points = max(points, num. Play; ( for (int p = 0; p < num. Play; p (++ if (points[p] == max. Points( Console. Write. Line("Prize to" + p; ( { { Copyright © Moti Ben-Ari, 2005.

class Most. Points. Obj { static final int LAST ; 100 = int []points

class Most. Points. Obj { static final int LAST ; 100 = int []points = new int[LAST; [ public Most. Points. Obj{ … } () void get. Points () { … } void print. Prizes () { … } int max() { … } public static void main)String[] args} ( Most. Points. Obj m =new Most. Points. Obj; () m. get. Points; () m. print. Prizes; () } } Copyright © Moti Ben-Ari, 2005.

 הבנת שגיאות הודעות על שגיאות מנוסחות כמובן n ! לפי תמ"ע יש להבין

הבנת שגיאות הודעות על שגיאות מנוסחות כמובן n ! לפי תמ"ע יש להבין את : אין קיצורי דרך n. העקרונות כדי לפענח אותן public static void main)String args([] n public static void main(String args( n public static main)String[] args( n public static Hello(String[] args( n Copyright © Moti Ben-Ari, 2005.

 הבנת שגיאות exception in thread "main" java. lang. No. Such. Method. Error: main

הבנת שגיאות exception in thread "main" java. lang. No. Such. Method. Error: main n invalid method declaration: return type expected n modifier static not allowed here n Copyright © Moti Ben-Ari, 2005.

 סביבות פיתוח לימודיות סביבות להוראה לתלמידים מתחילים n : וחלשים n Alice (Carnegie

סביבות פיתוח לימודיות סביבות להוראה לתלמידים מתחילים n : וחלשים n Alice (Carnegie Mellon U. ) n JPIE (Washington U. in St. Louis) n LIVE (Hamilton College) Copyright © Moti Ben-Ari, 2005.