Skip to main content

Posts

Showing posts with the label Java

7th Week-Progress

I have entered the 7th week since my fatal decision to become a master coder. What progress can I report?    I finished The Odin Project's Web Development 101 course on Monday and began the third course in curriculum : "Ruby Programming". Although I completed the Codecademy Ruby course and did some other Ruby work a few weeks ago, I felt I needed a review.  To this end I am redoing the Codecademy course, I completed Chris Pine's book  Learn to Program,  and I reread Chs.2 + 3 of Peter Cooper's Beginning Ruby .  Needless to say, the revision was worth it- I have a much clearer understanding of blocks and procs, as well as hashes and arrays. Concurrent with the Odin Project I am working through the  Epicodus curriculum . It is always helpful to have multiple perspectives on a subject. I have also discovered an intriguing course called FreeCodeCamp . It isn't complete yet, but the aim is to train students to write code for non-profits. Much of t...

Final-Reference Variables-Constants in Java. What does it all mean?

So far, my programming journey has been easy riding. Everything in computer science I've come across so far seems so logical and (really) obvious after a moment's thought. (n.b. The following will contain mistakes, don't copy and paste this for your Comp.Sci.101 Assignment. If any readers can help clarify my thinking, it would be much appreciated.) Well, except for constants in Java. In Java, you can define a variable and give it a value:   ( e.g. Year current =1932;  creates an variable of type Year and initializes it with the value 1932). Speaking correctly, the variable   current  is NOT equal to 1932. Rather, current is a reference to a location in the computer's memory where the data 1932  is stored. A variable name like current  can be thought of as a listing in a telephone directory: "To find the current year, go to this address in the memory." Variable are so called because their values can change during the running of a program. For ...

My First Control Structure in Java

Here is my first original program, written after 5 days of learning java. The goal was to include a looping control structure with decision making paths (if/else). ____________________________________________________________________ import java.util.Scanner; public class AverageTemp  { //Calculates the average temperature of weekdays in centigrade  public static void main(String[] args)  { Scanner keyboard = new Scanner (System.in); double monday, tuesday, wednesday,thursday,friday; char option; //User input for five weekdays do { System.out.println ("What was the average temperature on Monday?:"); monday = keyboard.nextDouble(); System.out.println ("What was the average temperature on Tuesday?:"); tuesday = keyboard.nextDouble();  System.out.println ("What was the average temperature on Wednesday?:"); wednesday = keyboard.nextDouble(); System.out.println ("What was the average temperature on Thursd...