Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing verb in Module10 slide #2

Open
wants to merge 53 commits into
base: module09
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
ae6d374
merging master into dev
mwand Oct 8, 2017
b4b7cea
merging module08 into dev
mwand Oct 23, 2017
f592a22
updating links in index.html
mwand Oct 23, 2017
e7833e0
catching up master into dev
mwand Oct 23, 2017
cdc2560
removed gp07-4 and cleaned up gp07-3
mwand Oct 23, 2017
261a8fa
fixed solution link in GP 8.3
mwand Oct 23, 2017
14ac961
added instructions for compiling test runner to gp8.3
mwand Oct 23, 2017
838f0e7
fixed typo in L8.2
mwand Nov 1, 2017
1f2ada9
fixed assorted typos, updated syllabus
mwand Nov 1, 2017
fe02059
ps09 ready for release
mwand Nov 6, 2017
3fd1a10
added examples for lecture 09
mwand Nov 6, 2017
49805a8
cleaning up Examples folder
mwand Nov 6, 2017
ddb1053
added links to code packages for ps09
mwand Nov 6, 2017
e84c8b5
fixed typos in PS09 attachments, L9.5
mwand Nov 7, 2017
7a76766
more typos corrected in L9.5, from @1294
mwand Nov 7, 2017
fc6bec0
posting Module 10
mwand Nov 8, 2017
95624eb
converted Will's Lesson 9.5 from HTML to PPT
Nov 9, 2017
3a196ba
added links to L9.5 in pptx and pdf on module09.html
Nov 9, 2017
ff8169c
cleaning out Examples/09*.rkt 10*.rkt 11*.rkt
Nov 9, 2017
77e777b
removing Examples/*.ps11
Nov 9, 2017
4b372f0
removing Examples/Old Module 05 and 06
Nov 9, 2017
11c03b0
added UTC pages to InterfaceClasses2 so links will work
Nov 9, 2017
ad62f37
added examples for lecture 10
mwand Nov 13, 2017
e26bd49
cleaning up old examples
mwand Nov 14, 2017
c9db6ac
cleaning up
mwand Nov 14, 2017
80c13d0
Merge branch 'master' into dev
mwand Nov 14, 2017
acb20f5
cleaning up old examples
mwand Nov 14, 2017
a2c8935
Merge branch 'module10' into dev
mwand Nov 14, 2017
2b6f914
problem set 10 ready for publication
mwand Nov 14, 2017
6d3fa2a
publishing ps10
mwand Nov 14, 2017
d77cbf3
publishing examples for module 10
mwand Nov 14, 2017
6f0e891
added link to Examples in module10.html
mwand Nov 14, 2017
039d76d
cleaning up Examples/11* 12*
mwand Nov 14, 2017
12af2b7
removing Examples/Experimental
mwand Nov 14, 2017
6873488
Alist implementations as updated in class
mwand Nov 16, 2017
83335d9
module 11 ready for publication
mwand Nov 26, 2017
bd2cb01
updated Common Slides
mwand Nov 26, 2017
edd5ca5
merging module11 into master
mwand Nov 26, 2017
6327043
added link to module11, removed link to old ps11
mwand Nov 26, 2017
750772d
added links to Module 11 class material
Nov 27, 2017
d9d8524
added materials as zip file, with link
Nov 27, 2017
2e040a7
ps11 ready to publish
Nov 28, 2017
822bffd
fixed typos in ps11 and associated files
mwand Nov 28, 2017
f6bf197
fixed broken link in Inheritance lesson
mwand Nov 29, 2017
736c201
fixed bug in example for distinct()
mwand Nov 29, 2017
8ff7b09
added Java examples from Lecture 11
mwand Nov 30, 2017
92efa49
Lesson 12 ready for posting on test site
mwand Dec 2, 2017
ee2093e
merging master into dev
mwand Dec 2, 2017
513a749
added link to module 12
mwand Dec 2, 2017
c067fbb
added more of Will's lessons to Module 12
mwand Dec 2, 2017
42dd809
fixed broken link
mwand Dec 2, 2017
67faadb
tweaked text of Module12.html
mwand Dec 3, 2017
cd5433b
dummy commit to test credentials
mwand Dec 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
129 changes: 129 additions & 0 deletions ClassMaterials/Module11/complex.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
// more complicated examples of inheritance and fields

interface I {
int f ();
int g ();
int h ();
}

class A implements I {
int i = 15;
int j = 20;

A () {
System.out.println("calling constructor for A");
show("i", i); show("j", j);
}

// EFFECT: increments i
// RETURNS: the new value of i + j

public int f () {
System.out.println("calling method f of class A");
i = i + 1;
return (i + j);
}

// RETURNS: mystery!!

public int g () {
System.out.println("calling method g of class A");
return (this.f() + 1);
}

public int h () {
System.out.println("calling method g of class A");
j = j + 10;
return (i - j);
}

public void show (String str, int n) {
System.out.println(str + "=" + n);
}


}

class B extends A implements I {
int k = 200;

B () {
System.out.println("calling constructor for B");
j = 100;
int n = this.h();
show("i", i); show("j", j); show("k", k);
}

public int g () {
System.out.println("calling method g of class B");
return (i + j + k);
}

public int h () {
System.out.println("calling method h of class B");
j = j + 100;
return (super.g() + 30);
}

}


class C extends B implements I {

C () {
System.out.println("calling constructor for C");
show("i", i); show("j", j); show("k", k);
}

public int f () {
System.out.println("calling method f of class C");
return (j - k);
}

public int g () {
System.out.println("calling method g of class C");
return (super.h() + 20);
}

public int h () {
System.out.println("calling method h of class C");
k = k + 20;
return (j + k);
}
}
class Tests {

public static void main (String[] args) {

System.out.println("***Starting tests for class A***");

I a1 = new A();

show("a1.f()", a1.f());
show("a1.g()", a1.g());
show("a1.h()", a1.h());

System.out.println("\n***Starting tests for class B***");

I b1 = new B();

show("b1.f()", b1.f());
show("b1.g()", b1.g());
show("b1.h()", b1.h());

System.out.println("\n***Starting tests for class C***");

I c1 = new C();

show("c1.f()", c1.f());
show("c1.g()", c1.g());
show("c1.h()", c1.h());


}

public static void show (String str, int n) {
System.out.println(str + "=" + n + "\n");
}

}
Binary file added ClassMaterials/Module11/module11.zip
Binary file not shown.
129 changes: 129 additions & 0 deletions ClassMaterials/Module11/simple.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
// simple example of inheritance of methods and fields

interface I {

// no purpose; these are just for illustration
int f ();
int g ();
int g1 ();
int h ();
}

class A implements I {
int i;
int j;

A () {
System.out.println("calling constructor for A");
this.i = 15;
this.j = 20;
System.out.println("i = " + i + " j = " + j);
System.out.println("");
}

public int f () {
System.out.println("calling method f of class A");
return (i + j);
}

public int g () {
System.out.println("calling method g of class A");
return (i + this.f());
}

public int g1 () {
System.out.println("calling method g1 of class A");
return (i + f());
}

public int h () {
System.out.println("calling method h of class A");
return (i - j);
}
}

class B extends A implements I {
int k;

B () {
System.out.println("calling constructor for B");
k = 200;
System.out.println("i = " + i + " j = " + j + " k = " + k);
System.out.println("");
}

public int f (){
return 1000;
}

public int h () {
System.out.println("calling method h of class B");
return (30 + super.g());
}
}

class C extends B implements I {

C () {
System.out.println("calling constructor for C");
j = 100;
}

public int f () {
return (j - k);
}

public int g () {
return (super.h() + 20);
}

public int h () {
return (j + k);
}
}

class Tests {

public static void main (String[] args) {

System.out.println("***Starting tests for class A***");

I a1 = new A();

show("a1.f()", a1.f());
show("a1.g()", a1.g());
show("a1.g1()", a1.g1());
show("a1.h()", a1.h());

System.out.println("\n***Starting tests for class B***");

I b1 = new B();

show("b1.f()", b1.f());
show("b1.g()", b1.g());
show("b1.g1()", b1.g1());
show("b1.h()", b1.h());

System.out.println("\n***Starting tests for class C***");

I c1 = new C();

show("c1.f()", c1.f());
show("c1.g()", c1.g());
show("c1.g1()", c1.g1());
show("c1.h()", c1.h());


}

static void show (String str, int n) {
System.out.println(str + "=" + n + "\n");
}

}






Binary file modified CourseMaps/module10.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified CourseMaps/module11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified CourseMaps/module12.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions Efficiency2/ackermann3.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- meta name="keywords" content="software" -->

<title>
Ackermann's Function in ps11
Ackermann's Function in a small hypothetical language
</title>

<link type="text/css"
Expand All @@ -26,7 +26,12 @@
<h3>
Ackermann's Function in ps11
</h3>
<div>
<div>
<p>ps11 was a small language that was used as an example in CS 5010 in
Spring 2017. As you will see in an upcoming slide, it had an
interpreter and two compilers.
</p>

<pre>
ack (m, n)
if m = 0
Expand Down
2 changes: 1 addition & 1 deletion Efficiency2/gcPSZero.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h3>
need a more typical benchmark.
</p>
<p>
The flight-scheduling problem posed by Problem Set 00,
The flight-scheduling problem posed as Problem Set 00 in Spring 2017,
at the beginning of the semester,
gives us a more typical benchmark.
Because this is not a course on algorithms,
Expand Down
2 changes: 1 addition & 1 deletion Efficiency2/gcSpecialPleading.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h3>
Many programmers take pride in their knowledge and skillful
use of the programming language they know best.
When confronted with empirical evidence showing their
favorite language do not always perform as well as
favorite language does not always perform as well as
other languages, they may become defensive and resort
to special pleading.
</p>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading