This course will introduce you to the field of computer science and the fundamentals of computer programming. Introduction to Computer Science I is specifically designed for students with no prior programming experience, and taking this course does not require a background in Computer Science. This course will touch upon a variety of fundamental topics within the field of Computer Science and will use Java, a high-level, portable, and well-constructed computer programming language developed by Sun Microsystems (now Oracle), to demonstrate those principles. We will begin with an overview of the course topics as well as a brief history of software development. We will cover basic object-oriented programming terminology and concepts such as objects, classes, inheritance, and polymorphism, as well as the fundamentals of Java, its primitive data types, relational operators, control statements, exception handling, and file input /output. By the end of the course, you should have a strong understanding of the fundamentals of Computer Science and the Java programming language. This course will lay the groundwork for a strong educational in Computer Science and a successful career devoted to implementing the principles you will learn as you progress through the CS discipline.
- Course Information
- Unit 1: Introduction
We will begin this course by identifying our motivation for learning fundamental programming concepts and learning the history of programming languages in general. We will then discuss the hardware (the physical devices that make up the computer) and software (Operating Systems and applications that run on the computer) of a computer. We will conclude with a brief discussion of the Java programming language, which we will use throughout the rest of this course. By the end of this unit, you will have a strong understanding of the history of programming and be well prepared to learn about programming concepts in greater detail.
Completing this unit should take you approximately 16 hours.
- 1.1: History and Motivation
- 1.1.1: History of Software and Computer System Design
- 1.1.2: Evolution of Programming
- 1.2: Hardware/Software Model of a Computer
- 1.2.1: Hardware vs. Software
- 1.2.2: Programs and Processes
- 1.2.3: The Software Development Lifecycle
- 1.2.4: The Programming Process
- 1.3: Java
- 1.3.1: History of the Java Programming Language
- 1.3.2: Interpreted vs. Compiled Languages
- 1.3.3: Compiling and Running a Simple Java Program
- 126.96.36.199: Option 1 - Using an Online IDE
- 188.8.131.52: Option 2 - Installing Java on Your Machine
- 184.108.40.206: Java Application Programming Interface (API)
- 1.3.4: Byte Code vs. Machine Code
- Topic 21
- Unit 2: Object-Oriented Programming
Java is an Object-Oriented programming language. Since Object-Oriented programming (OO) is currently one of the most popular programming paradigms, you will need to learn its fundamental concepts in order to build a career in Computer Science. This unit will begin with a discussion of what makes OO programming so unique, and why its advantages have made it the industry-standard paradigm for newly designed programs. We will then discuss the fundamental concepts of OO and relate them back to Java. By the end of this unit, you will have a strong understanding of what Object-Oriented programming is, how it relates to Java, and why it is employed.
Completing this unit should take you approximately 10 hours.
- 2.1: Programming Language Design
- 2.1.1: Object-Oriented vs. Procedural
- 2.1.2: Advantages/Disadvantages of OO Programming
- 2.1.3: Examples
- 220.127.116.11: Java
- 18.104.22.168: Python
- 22.214.171.124: C++
- 2.2: Fundamental Concepts of OO Programming
- 2.2.1: Classes vs. Objects
- 2.2.2: Encapsulation
Encapsulation is to put both data, and operations that can be performed on this data, in a single class. The advantages of encapsulation include information hiding, which means the user does not need to know the implementation details of the internal design, but is still be able to access and modify the data through public operations provided.
- 2.2.3: Inheritance
Inheritance is to reuse the existing classes when creating a new class. The derived class will inherit public operations defined in the base class. It usually involves a hierarchy of related entities.
- 2.2.4: Polymorphism
- 2.2.5: Decoupling
- Topic 36
- Unit 3: Java Fundamentals
Now that you have a basic understanding of OO programming, we will move on to the fundamental concepts of the programming language we will be studying this semester: Java. The Java-related concepts you will learn in this unit are in many cases directly transferable to a number of other languages. We will begin by learning about "Hello World", a basic software application that simply prints "Hello World" to the screen as a means of demonstrating the most essential elements of a programming language, and will then move on to discuss the more fundamental concepts of variables, literals, data types, and operators. In addition, we will also learn about two different styles of adding comments to the code. By the end of this unit, you should have a fundamental understanding of Java basics and be prepared to utilize those concepts later in the course.
Completing this unit should take you approximately 22 hours.
- 3.1: HelloWorld.java
- 3.1.1: Class and File Naming Conventions
- 3.1.2: Importing Libraries
- 3.1.3: Declaring a Class
- 3.1.4: Compiling and Executing a Java Program
- 3.2: Variables, Literals, and Primitive Data Types
- 3.2.1: Variables vs. Literals
- 3.2.2: Legality of Variable Names
- 3.2.3: Primitive Data Types
- 3.3: Basic Operations in Java
- 3.4: String Class
- Topic 49
- Unit 4: Relational and Logical Operators in Java
In this unit, we will discuss relational and logical operators in Java, which provide the foundation for topics like control structures (which we will further discuss in Unit 5). In this unit, we will start by taking a look at operator notation. We will then discuss relational operators as they apply to both numeric operands and object operands before concluding the unit with an introduction to logical operators. By the end of this unit, you should be able to perform comparisons and logic functions in Java and have a fundamental understanding of how they are employed.
Completing this unit should take you approximately 9 hours.
- 4.1: Operator Notations
- 4.2: Relational Operators
- 4.3: Logical Operators
- 4.3.1: Uses
- 4.3.2: Truth Tables
- Topic 56
- Unit 5: Control Structures
Control structures dictate what the behavior of a program will be under what circumstances. Control structures belong to one of two families: those that test values and determine what code will be executed based on those values, and those that loop, performing identical operations multiple times. Control structures like if-then-else and switch the program to behave differently based on the data that they are fed. The while and for loops allow you to repeat a block of code as often as it is needed. As you can see, that functionality can be very useful when designing complex programs. This unit will introduce you to control structures and the ways in which they are used before moving on to discuss if, switch, while/do-while, and for loops. We will also discuss some advanced topics, such as nesting and scope. By the end of this unit, you should be able to draw from the information you learned in the previous unit to create a control structure, which will allow you to create more complex and useful programs.
Completing this unit should take you approximately 20 hours.
- 5.1: Introduction to Control Structures
- 5.2: The 'if' statement
- 5.3: The 'switch' Statement
- 5.4: The 'while' and 'do-while' Loops
- 5.5: The 'for' Loop
- 5.6: Advanced Topics
- 5.6.1: Nesting Control Structures
- 5.6.2: Variable Scope within a Control Structure
- 5.7: Arrays
- 5.7.1: Introduction to Arrays
- 5.7.2: Common Array Algorithms
- Topic 69
- Unit 6: User-Defined Methods
In addition to the methods predefined in Java, we can write user-defined methods. In this unit, we will discuss how to name a method, declare a parameter list, and specify the return type. This unit introduces the scope of variables as well. By the end of this unit, you will have a strong understanding of how to define and call a method.
Completing this unit should take you approximately 11 hours.
- 6.1: Method Syntax in Java
- 6.2: Overloaded Methods
- Topic 73
- Unit 7: Arrays
This unit discusses Arrays. An Array is a fixed-size data structure that allows elements of same data type to be stored in it. Each array element has a unique index associated with the value it stores. Arrays are commonly used in a loop structure such as for loops. In addition, this unit introduces two-dimensional arrays and its applications.
Completing this unit should take you approximately 7 hours.
- 7.1: Introduction to Arrays
- 7.2: Two-Dimensional Arrays
- 7.3: Common Array Algorithms
- Topic 78
- Unit 8: Java I/O and Exception Handling
In this unit, we will discuss two important programming concepts in Java: input and output, and well as exception handling. Input and output techniques allow programmers to design more complex and useful programs. For this reason, you must fully understand how to use a programming language's built-in I/O (input/output) functionality. In this unit, we will discuss function I/O in Java before moving on to file I/O: both writing and reading data to and from files. Each unit will contain a discussion of the applicable Java classes, which are part of the standard programming language - FileWriter, PrintWriter, FileReader, BufferedReader, and IOException. We will then identify the common pitfalls and design concepts that you should keep in mind as a programmer. By the end of this unit, you will have a strong understanding of how to write and read from a file and how to write a Java program that performs these functions. Exception handling mechanism allows a program to continue executing, even if an error occurs in the program, instead of terminating it abruptly.
Completing this unit should take you approximately 11 hours.
- 8.1: Input/Output in Java
- 8.2: Writing Data to a File
- 8.2.1: The FileWriter Class in Java
- 8.2.2: The PrintWriter Class in Java
- 8.3: Reading Data from a File
- 8.4: Exception Handling