Category Archives: Activity

First: drawing in a piece of paper – Privacy violations

Classwork:
Visit edmodo.com
Create and account or join with the code for your period.
Find the code on the home page.
Please use your full name as your screen name.

Designing an algorithm

Find a partner. You will need paper and pencil/pen.
Activity 1:

Your teacher will hand you a drawing in a piece of paper.

  • Don’t let your partner see the drawing.
  • Your partner will draw the same shape on his/her paper by following your “set of instructions”.
  • Write down the instructions as you give them.
  • You can not use direct words that describes the image.
  • Once finished, both look at the drawings and compare them.
  • If the drawings don’t match, go back to your instructions and change them until you are satisfied.
  • You and your partner reverse roles.
  • Do the instructions need to be revised?

Homework:

Read the following articles linked bellow and answer questions on edmodo.com
Privacy violations – the dark side of social media
Screen Shot 2014-09-04 at 6.12.33 PM

Digital Explosion: Why Is It Happening, and What Is at Stake?
Screen Shot 2014-09-04 at 6.27.26 PM

First: Connecting Related Objects

1. Form a group of students and create your own graph with related objects. Include your initials on the line connecting the objects.

2. For each item make a list of all the objects that are directly connected to it.

3. Submit to edmodo.com the following items:
a. The name of your team mates.
b. A picture of your graph.
c. The list you created in part 2.

Input/Output: StdDraw Exercises

MyTriangles_YI.java
Use StdDraw to implement MyTriangles_YI.java to create a drawing of 3 different triangles: acute, obtuse, and right. Look at this example.

MyFunctionGraph_YI.java
Run and understand how FunctionGraph.java works and modify it to create the graph of this function
y = sin(4x) + cos(20x)

Write a short paragraph about how the graph changes as the input argument changes.

<pre>

/******************************************************************************
 *  Compilation:  javac FunctionGraph.java 
 *  Execution:    java FunctionGraph n
 *  Dependencies: StdDraw.java
 *
 *  Plots the function y = sin(4x) + sin(20x) between x = 0 and x = pi
 *  by drawing n line segments.
 *
 ******************************************************************************/

public class FunctionGraph {
    public static void main(String[] args) {

        // number of line segments to plot
        int n = Integer.parseInt(args[0]);

        // the function y = sin(4x) + sin(20x), sampled at n+1 points
        // between x = 0 and x = pi
        double[] x = new double[n+1];
        double[] y = new double[n+1];
        for (int i = 0; i <= n; i++) {
            x[i] = Math.PI * i / n;
            y[i] = Math.sin(4*x[i]) + Math.sin(20*x[i]);
        }

        // rescale the coordinate system
        StdDraw.setXscale(0, Math.PI);
        StdDraw.setYscale(-2.0, +2.0);

        // plot the approximation to the function
        for (int i = 0; i < n; i++) {
            StdDraw.line(x[i], y[i], x[i+1], y[i+1]);
        }
    }
}
</pre>

Mystery Graph
Download the text file below and find out what the points draw.
Is the file missing anything?
Take a screenshot for submission.
Hint: use the PlotFinder.java

OOD Project: My Application

Programming Project: My Application

Write your own application based on a set of interacting objects.
Here are some ideas keeping in mind a simplified system and yet a good testing class. Your test class must include activities between the objects and their methods.

Requirements for the project:
1. Methods must be consistent: toSTring(), getter and setter methods.

2. Encapsulation must be enforced. All instance fields should be private.

3. Objects from different ADTs must interact with each other.

4. The test driver must execute all parts of the implementation.

Advice:

1. Keep it simple. You can add more after it runs successfully. You can keep the big picture in mind but develop from small components.

2. Start with just two ADT objects just like in My School example. First start with Student and Course objects only.


https://java.mrseliasclasses.org/my-school-how-to-implement-a-multi-adt-application-ood/

Later, we add Teacher and after that add the School ADT. Example will be provided shortly.
https://java.mrseliasclasses.org/my-school-multi-adt-application-ood-add-more/

3. The test driver should be the final version of the many changes and additions you made as you develop your full application.
In this version of your project, submit two ADTs and a test driver with minimal activity between the object(s) of each ADT.


Grade notes:
If your ADTs have only String objects and primitive data types as instance fields, the best grade you can get is a 65.

If your ADTs do not interact with each other, the best grade you can get is a 65.

If you only have 2 ADTs interacting with each other, the best grade you can get is a 80. Optimal number of interacting ADTs is 3.

1. A good description of your project – Tell the story about your application and make sure the story clearly identifies the objects you create from the different ADTs.
2. Author’s name
3. Date and java version
4. Include the output from the your test driver
5. The test driver should have enough activity to test all methods from each ADT