Learning journal 1 cs1103 PDF

Title Learning journal 1 cs1103
Author alibek Abdykarimov
Course Programming 2
Institution University of the People
Pages 3
File Size 77.4 KB
File Type PDF
Total Downloads 10
Total Views 130

Summary

Learning Journal Unit 1 for Programing 2 course of UoPeople...


Description

Describe what you did. This week I started my programming 2 course. And honestly, I was a bit surprised at how hard it was for me initially to get back into programming after such a short break. I started by going over the material from previous course to remember different aspects of programming and java language specifically. Then I started going over the reading assignment for this week. I always found it hard for myself to learn from the textbook, as it is hard for me to sit and concentrate on reading for a long time. I personally prefer video lectures or tutorials. So, I combined the two. I went over the basic idea of the new concepts with the help of video tutorials and lectures on the internet and then dwelled in more detail by using the textbook. The hardest part though, was the programming assignment. But the funny thing is that I kind of made it hard for myself unintentionally. I spent a considerable amount of time writing a program 1 (benchmarking sorting algorithms) from the lab 2. What I did not know, is that the assignment only required the first program. So, I also spent a lot of time writing the second program on the lab. And after some time, when I was finally finished and was about to submit my work, I saw that I only needed to do the first program. It was funny and sad at the same time, because I finished my work late at night and could’ve gone to sleep much earlier, but I consider this a good experience for myself in a long run. Describe your reaction to what you did. New concepts excited me, especially the algorithms. I can already imagine numerous ways in which I would use my knowledge in the future during my work. I also found the programming assignment to be quite interesting. And although not required, I found the second program from the lab 2 to be a helpful tool which could be used in many different ways. Describe any feedback you received or any specific interactions you had. Discuss how they were helpful. This week’s discussion board was very interesting and helpful for me. I received good and helpful feedback on my assignment and also learned a lot from the posts of my peers. Describe your feelings and attitudes. I can already feel that this course is harder than the previous, but I’m excited to go deeper into it. New challenges always give me a bit of anxiety and stress, but we have to preserver in order to strive. Describe what you learned. I reminded myself about different core concepts of programming as well as exceptions and the basics of analysis of algorithms. What skills and knowledge do I recognize that I am gaining? From the beginning of my studies of programming, each week I learn something more. New concepts, programming language tools or simple tricks. But the most important knowledge for me is the ability to solve problems. As I was writing my program for the assignment, I encountered a lot of mistakes that I had to fix and problems that needed to be solved. And for me this knowledge is the most valuable.

Solution for the non graded assignment:

public class Main { public static void main(String[] args) { double A, B, C;

// Coefficients in the equation.

double solution;

// The solution computed for the

boolean goAgain;

// Set to true if the user wants to // solve another equation.

equation.

TextIO.putln("This program will print a solution of an equation"); TextIO.putln("of the form A*X*X + B*X + C = 0, where A, B, and"); TextIO.putln("C are values that you enter."); do { /* Get the coefficients from the user. */ TextIO.putln(); TextIO.putln("Enter values for A, B, and C:"); TextIO.put("A = "); A = TextIO.getlnDouble(); TextIO.put("B = "); B = TextIO.getlnDouble(); TextIO.put("C = "); C = TextIO.getlnDouble(); TextIO.putln(); /* Print the solution, or an error message, if there is no solution. */ try { solution = root(A,B,C); TextIO.putln("A solution of the equation is " + solution); } catch (IllegalArgumentException e) { TextIO.putln("Sorry, I can't find a solution."); TextIO.putln(e.getMessage()); } /* Find out whether the user wants to go again. */ TextIO.putln(); TextIO.put("Do you want to solve another equation? "); goAgain = TextIO.getlnBoolean(); } while (goAgain); } // end main /** * Returns the larger of the two roots of the quadratic equation

* A*x*x + B*x + C = 0, provided it has any roots.

If A == 0

or * if the discriminant, B*B - 4*A*C, is negative, then an exception * of type IllegalArgumentException is thrown. */ static public double root( double A, double B, double C ) throws IllegalArgumentException { if (A == 0) { throw new IllegalArgumentException("A can't be zero."); } else { double disc = B*B - 4*A*C; if (disc < 0) throw new IllegalArgumentException("Discriminant < zero."); return } } }

// end class

(-B + Math.sqrt(disc)) / (2*A);...


Similar Free PDFs