Home Previous Next

CSC110AB::Lecture Note::Week 01
Assignments | Handouts | Resources | Email Thurman {Twitter::@compufoo Facebook::CSzero}
GDT::Bits:: Time  |  Weather  |  Populations  |  Special Dates

Overview Assignment(s) HandoutsCSC110AB Syllabus | About CSC110AB | HowToSubmitAssignments
Code HelloWorld.java | HW.java | HelloGoodbyeWorld.java


Syllabus Review

It is the student's responsibility to read and understand the syllabus. Some of the more important points are:

The following information was copied from the Maricopa.edu website.
http://aztransmac2.asu.edu/cgi-bin/WebObjects/MCCCD.woa/wa/freeForm2?id=122238

MCCCD Official Course Description for CSC110AB.

   "Concepts of problem-solving, structured and object-oriented 
    programming in Java, fundamental algorithms and techniques 
    and computer system concepts. Social and ethical responsibilities. 
    Intended for Computer Science and Computer Systems Engineering Majors."

    Prerequisites: A grade of C or better in MAT120 or MAT121 or MAT122.

MCCCD Official Course Competencies for CSC110AB.

   1.  Describe computer hardware and an operating system.
   2.  Use an interpreter and associated utility programs to create 
       and run programs in Java. 
   3.  Develop and implement algorithms using top-down design with 
       stepwise refinement.
   4.  Develop and implement well-structured programs. 
   5.  Develop and implement Java programs using control structures, 
       functions, various data types, arrays, and structures. 
   6.  Explain Java classes and their use. 
   7.  Develop and implement Java programs using exception handling.
   8.  Present arguments for and against an ethical issue 
       related to computing.
[Student Advisement] When CS != CS

First, in the computing world the exclamation point ! frequently represents not. For example: 3 != 5 (3 is not equal to 5) and !empty (is read not empty; and semantically it means empty is a variable that has a value != 0).

Many degrees and certificates offered by the Maricopa Community Colleges require students to earn CS credits. In this case the CS stands for Computer Statistics. The Maricopa Community Colleges have numerous courses that satisfy the CS requirement.

The Maricopa Community Colleges offer numerous Computer Science Courses (CSC). These courses have a CSC suffix. Most CSC courses satisfy the Computer Statistics requirement. CSC110 is an Introduction to Computer Science course that is intended for Computer Science (CS) and Computer Science Engineering (CSE) majors.

It has been my experience that many students take a CSC class in order to satisfy the Maricopa Community College's CS requirement. If a student has zero interest in CS (Computer Science), then I strongly recommend that they do not take a CSC class in order to satisfy their CS (Computer Statistics) requirement.

{TopOfPage} {Oracle.com::API Specification | Tutorial} {GDT::Java Resources} {Eclipse IDE} {Udacity} {udemy} {CodingGround (online IDE)


Computer Science, Computing Science, Computational Thinking

   "Unfortunately, the way computer science is currently taught in 
    high school tends to throw students into the programming deep 
    end, reinforcing the notion that code is just for coders, not 
    artists or doctors or librarians." -- Tasneem Raja

{TopOfPage} {Oracle.com::API Specification | Tutorial} {GDT::Java Resources} {Eclipse IDE} {Udacity} {udemy} {CodingGround (online IDE)


What is a Computer?

A computer (hardware) is a programmable electronic device that can store, retrieve, and process data. [Via Wikipedia.org: "A computer is a general purpose device that can be programmed to carry out a finite set of arithmetic or logical operations."]

Data is information that has been put into a form (i.e. format) that a computer can use (i.e. understand). ["Big Data" is a popular buzzphrase in 2012. #BigData]

A computer is comprised of six logical components:

Wikipedia.org::Computer

Archive.org::How It Works... The Computer [original edition 1971; revised edition 1979]

Sloan.Stanford.edu::The First Computer Mouse (circa 1964) was invented by Doug Engelbart.

GDT::Computing::Bit::History of Computing Presented Using YouTube Videos [created 22 August 2009]

LongStreet.Typepad.com::The Computer Tree (1945-1960s)
[via Texas Advanced Computing Center (TACC) Facebook posting on 7 August 2012]

{TopOfPage} {Oracle.com::API Specification | Tutorial} {GDT::Java Resources} {Eclipse IDE} {Udacity} {udemy} {CodingGround (online IDE)


History of the Internet (in a nutshell)

1957 -- Sputnik launch by USSR [ listen (113K)]
1957 -- U.S. government creates Defense Advanced Research Projects Agency (DARPA)
1965 -- The term hypertext is coined by Theodore Nelson.
1969 -- UNIX operating system is created. (C progamming language)
1969 -- First four hosts (nodes) on the ARPAnet.
1972 -- Electronic mail and Telnet applications
1973 -- FTP application
1979 -- Usenet
1982 -- Internet and TCP, UDP, and IP
1984 -- DNS (Domain Name Service)
1988 -- CERT is formed; IRC application
1990 -- November 12th... WorldWideWeb: Proposal for a HyperText Project
1991 -- Gopher; Tim Berners-Lee posts the first code for the WWW
1992 -- Lynx text web browswer
1993 -- Mosaic (GUI-oriented web browser which became Netscape)
1995 -- Java Programming Language (Applets)


Timeline of Net Terms and Concepts by Keith Lynch
Short History of Hypertext by Jakob Nielsen
Hobbes' Internet Timeline by Robert H'obbes' Zakon

{TopOfPage} {Oracle.com::API Specification | Tutorial} {GDT::Java Resources} {Eclipse IDE} {Udacity} {udemy} {CodingGround (online IDE)


What are Bits, Bytes, and Words?

Memory consists of a sequence of binary digits (or bits). A bit is either on or off (true or false, 1 or 0). Bits are usually grouped into bytes. Typically, there are 8 bits to a byte. A computer that has 16 megabytes (MB) of memory has approximately 16 million (16,000,000) bytes. A group of bytes is often referred to a word.

tera- ... peta- ... exa-
1 kilobyte (1K) 1024 bytes (2 to the power of 10)
1 megabyte (1MB) 1024K or 1,048,576 bytes (2 to the power of 20)
1 gigabyte (1GB) 1024MB or 1,073,741,824 bytes (2 to the power of 30)

[More...] Wikipedia.org:: Binary prefix

RoadHacker::Speaking of bits... Two Bit Cafe located in Hope Village, New Mexico.

{TopOfPage} {Oracle.com::API Specification | Tutorial} {GDT::Java Resources} {Eclipse IDE} {Udacity} {udemy} {CodingGround (online IDE)


Computer Languages: machine, assembly, high-level, 4GL

ThurmNet Technologies created a family of pretend programming languages to help discuss the various generations of programming languages.

1st-Generation: Machine Language (tnt1GL)

The tnt1GL machine language has four "commands" and supports the use of the hexadecimal digits 0 through F.

The commands are:

   0000 -- START
   0011 -- PRINT
   0001 -- END
   1111 -- ABORT

The supported hexadecimal digits are:

   0 -- 0000
   1 -- 0001
   2 -- 0010
   3 -- 0011
   4 -- 0100
   5 -- 0101
   6 -- 0110
   7 -- 0111
   8 -- 1000
   9 -- 1001
   A -- 1010
   B -- 1011
   C -- 1100
   D -- 1101
   E -- 1110
   F -- 1111

Each program begins by issuing a START command. The PRINT command takes one operand -- a "digit." The END command that "terminates" a program. The ABORT command "abnormally terminates" a program.

The following is a tnt1GL written program that prints gdt's age at the end of 2019.

      000000110110001100100001

   To aid readability assume the program can be written as follows:

      0000
      0011 0110
      0011 0010
      0001

GDT::Images::Real programmers code in binary.

2nd-Generation: Assembly Language (tntASML)

The following is the same program written in tntASML (i.e. TNT assembly language):

   START 
   PRINT 6
   PRINT 2
   END

Prior to executing, an assembly program is submitted to an assembler program that converts it into machine language.

3rd-Generation: High-level Language (tnt3GL)

The following is the same program written in tnt3GL (i.e. TNT 3rd-generation language):

   main() {
      printint 62; 
      exit; 
   }

Prior to executing, a high-level language is submitted to a compiler program that "translates" it into machine language.

Some of the early popular 3rd-generation languages were Fortran (1957; Formula Translation), COBOL (1959; COmmon Business Oriented Language), and BASIC (1964; Beginner's All-purpose Symbolic Instruction Code).

The 3rd-generation programming languages C and C++ were created circa 1972 and 1980, respectively.

[tidbit] When I decided to minor in CS in 1977 the first language learned was BASIC, followed by assembly then PL/I. In 1980 graduate school, Pascal was the primary language used.

4th-Generation: 4GL (tnt4GL)

Finally, the same program writting in tnt4GL (i.e. TNT 4th-generation language):


   print 62 and exit

[Definition] Portable refers to the ability to move a program from one machine to another without having to modify the code.

Machine and assembly languages are not portable. Many 3rd-generation languages are, but they portable if and only if programmers write with portability in mind.

[More...] Wikipedia.org::Programming Languages

GDT::Computing::Bit:: What is a real programmer?

{TopOfPage} {Oracle.com::API Specification | Tutorial} {GDT::Java Resources} {Eclipse IDE} {Udacity} {udemy} {CodingGround (online IDE)


Program Development

Computer programs are typically written in response to a request from a user. [A user may also be referred to as a customer or client.]

The user typically generates a requirements document from which the programmer writes their program. In a computer class, the assignment write-up plays the role of the requirements. It is your job, as the programmer, to review the requirements to make sure you understand what it is you are being asked to program. Computer programs typically solve problems; solving the wrong problem usually provides no value to the user.

A program usually receives some input (i.e. data or information), subjects the input to processing, and generates output (i.e. the data after being subjected to processing).

Many refer to the program as a black-box because from the user's perspective, the program does something, but they are oblivious as to how it does it. In other words, the user doesn't need to know the program does what it does; the programmer has that knowledge. Examples: convert feet to inches; sort a list of names; get a resource given a URL; send an email message; receive a chat message; animate a GIF; and so on.

Programs are written using a programming language (e.g. COBOL, C, C++, Java, Perl and so on). There are hundreds of programming languages. Most programs today are written in a high-level (or 3rd-generation) programming language. Some low-level programs (i.e. those that communicate directly with hardware [e.g. device drivers]) are written in assembly language primarily for performance reasons.

Source code is a programming language that is typed into a text file. If you are using a compiled-language, then the source code must be converted into a format (machine language) that can executed by the CPU. This conversion is accomplished using a compiler program. Source code files containing non-compiled languages (e.g. perl, javascript, php, shell script) are executed by submitting them to an interpreter program.

Later in the semester we will allocate some time to present the software development process.

{TopOfPage} {Oracle.com::API Specification | Tutorial} {GDT::Java Resources} {Eclipse IDE} {Udacity} {udemy} {CodingGround (online IDE)


What is Java?

Wired.com::The Java Saga from December 1995. [Starts with... Sun's Java is the hottest thing on the Web since Netscape. And that leads to three questions: (0) What was Sun? (1) What is the Web? (2) What was Netscape?]

"Sun" is Sun Microsystems and in 2010 Sun Microsystems Inc. was acquired by Oracle Corporation for $7.4 billion. Note: Sun Microsystems was founded in 1982 by Vinod Khosla, Andy Bechtolsheim, Bill Joy and Scott McNealy.

The Java platform was developed at Sun in the early 1990s to enable programmers to write programs that were hardware (device) independent. Java slogan: "Write Once, Run Anywhere" (WORA). [Sun's slogan: "The network is the computer."]

In 2006 Java was licensed under the GNU General Public License.

According to the July 2012 TIOBE Index, Java was the second most frequently used programming language. [C #1, Objective-C #3, C++ #4, C# #5] [update 2014.01.13: TIOBE Index for January 2013 and January 2014 saw no changes for the top eight languages. PHP, Visual Basic, Python were #6, #7, #8, respectively, with JavaScript #9 and Transact-SQL #10.]

James Gosling is considered the father of Java. Gosling briefly worked at Oracle after Oracle acqired Sun. He was a Googler for a short time before becoming Chief Software Architect at Liquid Robotics. {YouTube.com::Thoughts for Students (by James Gosling)}

{TopOfPage} {Oracle.com::API Specification | Tutorial} {GDT::Java Resources} {Eclipse IDE} {Udacity} {udemy} {CodingGround (online IDE)


Java Compilation Process (Introduction)

Executing a java program requires two steps.

The following (ASCII art) diagram summarizes the Java compilation process.

   source         +----------+        class
   file     --->  | compiler |  --->  file    ---+
   (x.java)       +----------+      (x.class)    |
                   (javac)                       |
                                                 v
                                       +----------------------+
                                       | Java Virtual Machine |
                                       +----------------------+
                                                 |
                                                 |
                                                 v
                                                CPU

A Java source file can contain only one public class and the name of that class must be identical to the basename of the file name containing the class definition. All Java source files must end in .java .

   public class MyDate { ... }

      Class  MyDate  must be defined in a file named  MyDate.java

A Java source file is compiled using the javac JSDK command. The command requires at least one argument: the name of a Java source file to be compiled.

   $ javac MyDate.java

      Note:  the  .java  suffix is required.  This example assumes
      our current working directory is the same directory in which
      the source file is located.

The output of a successfully compiled MyDate.java is stored in a file name MyDate.class. ".class" files are in bytecode format -- they are not executable files. In order to execute the MyDate program, its class file must be submitted to the Java interpreter (i.e. the JSDK command java [or the JVM]).

The java command requires one argument: the class name. The name is specified without the ".class" suffix.

   $ java MyDate

      The JVM (Java Virtual Machine) is started and the  
      MyDate  application is executed.

A Java source file can contain multiple classes (but only one of them can be public). When a file containing multiple classes is compiled, a ".class" file is generated for each class defined in the file.

   File:  Testing.java

      public class Testing { ... }
      class X { ... }
      class Y { ... }

   $ javac Testing.java

      Compiling  Testing.java  results in the creation of three
      separate class files.

   $ ls
   Testing.class
   Testing.java
   X.class
   Y.class

Multiple Java source files can be compiled at one time.

   $ javac Foo0.java Foo1.java Foo2.java

      Compiles all three  .java   source files.  The compilation
      process stops if any file encounters a compile-time error.
      The  'javac'  command does contain some "makefile"
      capabilities (e.g.  if  Foo0.java  uses the  Foo1  and  Foo2
      classes, then simply compiling  Foo0.java  causes  Foo1.java
      and  Foo2.java  to be compiled [but only if they need to be]).

Unlike C and C++, the Java compilation process does not include a preprocessor, nor does it require a linker/loader.

{TopOfPage} {Oracle.com::API Specification | Tutorial} {GDT::Java Resources} {Eclipse IDE} {Udacity} {udemy} {CodingGround (online IDE)


The Java Software Development Kit (JSDK)

The JSDK (Java Software Development Kit) is a collection of commands that make up the JVM (Java Virual Machine).

The JSDK is a collection of one more APIs (Application Programmer Interfaces), programming tools (commands) and documentation that enables a programmer to develop programs (applications) for a specific platform.

Here is list of some of the commands that come in the JSDK.

Note that the JSDK does not come with a text editor. Typically, Java programmers using an IDE enter their Java source code using an editor provided by the IDE. Those who don't use an IDE, use their favorite text editor (e.g. 'vi', 'emacs', etc.).

Oracle.com::Java Platform, Standard Edition (Java SE)

{TopOfPage} {Oracle.com::API Specification | Tutorial} {GDT::Java Resources} {Eclipse IDE} {Udacity} {udemy} {CodingGround (online IDE)


Home Previous Next