/home/karlrees/public_html/gallery2/bla
/home/karlrees/public_html/gallery2/bla
/home/karlrees/public_html/gallery2/bla Java session one: part two (homework) | Wayne and Rebecca Madsen

Java session one: part two (homework)

wayne's picture
/** * */ package echo;

import java.util.Scanner;

/**
* @author wayne
*
*/
public class TheCodeB {

/**
* @param args
*/
public static void main(String[] args) {
Scanner scan = new Scanner (System.in);
double pounds, kilos;
System.out.println("Please enter amount of pounds:");
pounds = scan.nextDouble();
kilos = pounds * .45359237;
System.out.println("You currently have " + kilos + " kilograms of stuff.");

}

}

Rebecca gave me homework. It was the only way.

Most of learning comes from plugging away at something and playing with it, of course with the fastidious guidance of a tutor. I've thought a great deal about tutors over the past couple of days since my last lesson. In grade school, when you fall behind your studies you are recommended to take on a tutor. This person acts as a mediator to maintain personal contact and guidance in training your mind and studies to understand the skills that are being taught. I believe that I once had a tutor for math when I was in high school. Amanda Gambino. A friend who was in advanced math who was willing to help me out. I wasn't in trouble of flunking: I just felt behind because I was in the advanced classes and didn't grasp math as fast as my brother might have.

Interesting in looking back that my tutor then performed her great charity to me in part because she wanted to date me. Here I am, getting tutoring lessons from my wife, the person who I want to spend all my time with.

Rebecca gave me some twenty pages of text in our "textbook," Lewis & Loftus' 5th edition Java Software Solutions text. I believe she used a similar text when she went through her studies of early java. A couple of confessions for those of you reading this, hoping to learn a bit of java along the way: I think I had a headstart. My limited actionscripting knowledge has transferred easily to the basic skills we're dealing with here. Since I know what a string is and the difference between a string an integer, I can't say that my reading was terribly enlightening. I read pages 42 - 90; truthfully, I skimmed most of them. However, a few pages before the discussion on scanning data, I got really lost and had to do the work in order to understand what was going on.

While reading this, I thought about the Battleguard group I infiltrated earlier this year and how similar this experience is to that experience. There is a limit/threshold which I was able to go up to comfortably, without experiencing any conflict with previous personal experience - or lack thereof. I could go to the practices and pick up a sword, but the moment I was considering becoming more engaged than that, it plunged me into a social experience I wasn't prepared for. This is an experience that we all go through by crossing thresholds between our inner social matrix and the outside matrix which includes the greater public sphere. Somehow, I'm trying to reach that sphere and chip away at it, by learning scanning in java. After a couple of attempts with using the scanner method to input data, I eventually fulfilled the requirements to create a conversion from pounds to kilograms (see TheCodeb.java).

Scanning is an input to the code. System.in.
Scanning isn't actually a string/text/number, but an object. It must be converted to a string or number.

Why shouldn't I get in the habit of always using double for a numerical value, and then choose from the other possible options when those limitations are necessary?