{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

exerciseMarch1008

exerciseMarch1008 - public double getReal public double...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
COMP202 Instructor: Ladan Mahabadi March 10, 2008 Turing Machines Turing machines are abstract machines described by Alan Turing in 1936. These simple machines are significant because the Church-Turing Thesis states that that a computing problem can be solved on any computer (or more generally on any reasonable model of computation) if and only if it can be solved on a Turing machine. Write a program that receives two non-negative integers less than 128, stores their bits in two arrays of size 8, subtracts the two and replaces the first number with the result and erases the second number.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
with the result and erases the second number. Fractals: First, create a complex class with limited functionality: public class Complex { private double real; private double imaginary; private double modulus; public Complex() { } public Complex(double rPart, double imPart)
Image of page 2
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { } public double getReal() { } public double getIm() { } public double getMod() { } public double calcMod(double rPart, double imPart) { } public Complex add(Complex second) { } public Complex mult(Complex second) { } } Now, randomly choose an initial complex number c, and repeat the following operation n number of times where n is a user-input value: Z_i = (Z_{i-1})^2 + c If after 10 iterations, modulus of z_10 is less than 1 continue, otherwise choose another initial c and repeat the process. public class Fractal { private Complex start; private Complex addCons; private Complex current; public Fractal(Complex constant) { //Start from 0 + i0 // Set addCons to be the input constant //Set current to be (start)^2 + addCons } public void move(int iterations) { } public boolean convg() { return (current.getMod() < 1); } }...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern