0% found this document useful (0 votes)
22 views

Introduction To Information and Computer Science

The Health IT Workforce Curriculum was developed for U.S. community colleges to enhance workforce training programmes in health information technology. The curriculum consist of 20 courses of 3 credits each. Each course includes instructor manuals, learning objectives, syllabi, video lectures with accompanying transcripts and slides, exercises, and assessments. The materials were authored by Columbia University, Duke University, Johns Hopkins University, Oregon Health & Science University, and University of Alabama at Birmingham. The project was funded by the U.S. Office of the National Coordinator for Health Information Technology. All of the course materials are available under a Creative Commons Attribution Noncommercial ShareAlike (CC BY NC SA) License. The course description, learning objectives, author information, and other details may be found at http://archive.org/details/HealthITWorkforce-Comp04Unit05. The full collection may be browsed at http://knowledge.amia.org/onc-ntdc or at http://www.merlot.org/merlot/viewPortfolio.htm?id=842513.
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Introduction To Information and Computer Science

The Health IT Workforce Curriculum was developed for U.S. community colleges to enhance workforce training programmes in health information technology. The curriculum consist of 20 courses of 3 credits each. Each course includes instructor manuals, learning objectives, syllabi, video lectures with accompanying transcripts and slides, exercises, and assessments. The materials were authored by Columbia University, Duke University, Johns Hopkins University, Oregon Health & Science University, and University of Alabama at Birmingham. The project was funded by the U.S. Office of the National Coordinator for Health Information Technology. All of the course materials are available under a Creative Commons Attribution Noncommercial ShareAlike (CC BY NC SA) License. The course description, learning objectives, author information, and other details may be found at http://archive.org/details/HealthITWorkforce-Comp04Unit05. The full collection may be browsed at http://knowledge.amia.org/onc-ntdc or at http://www.merlot.org/merlot/viewPortfolio.htm?id=842513.
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 14

Introduction to Information and

Computer Science
Computer Programming
Lecture e
This material (Comp4_Unit5e) was developed by Oregon Health and Science University, funded by the Department of Health
and Human Services, Office of the National Coordinator for Health Information Technology under Award Number
IU24OC000015..
Computer Programming
Learning Objectives
Define the purpose of programming languages. (Lecture
a)
Differentiate between the different types of programming
languages and list commonly used ones. (Lecture a)
Explain the compiling and interpreting process for
computer programs. (Lecture b)
Learn basic programming concepts including variable
declarations, assignment statements, expressions,
conditional statements and loops. (Lectures c, d)
Describe advanced programming concepts including
objects and modularity. (Lecture e)

2
Health IT Workforce Curriculum
Version 3.0/Spring 2012
Introduction to Information and Computer Science
Computer Programming
Lecture e
Object-Oriented Programming
Object-oriented programming (OOP) is a
paradigm
Very popular today
C++, C#, Java, Python, Ruby
Supports software engineering principles
Graphical user interface (GUI) programming
naturally conforms to OOP
3
Health IT Workforce Curriculum
Version 3.0/Spring 2012
Introduction to Information and Computer Science
Computer Programming
Lecture e
Objects
Objects have
Identity (name)
Attributes (instance variables)
Behavior (methods)
OOP is a way of organizing code
Data and related methods stored together
OOP allows for code reuse
Modularity
Inheritance
4
Health IT Workforce Curriculum
Version 3.0/Spring 2012
Introduction to Information and Computer Science
Computer Programming
Lecture e
Classes vs. Objects
Classes are the code definition for objects
They are the "blueprint for objects
Objects are created when the program runs
Instantiation
Similar to declaring a variable
5
Health IT Workforce Curriculum
Version 3.0/Spring 2012
Introduction to Information and Computer Science
Computer Programming
Lecture e
Procedural vs. OOP
double circleArea(double
radius)
{
return
3.14*radius*radius; }
}
In class, radius is stored
with the calcArea method
In procedure, radius is
passed into calcArea as
a parameter
How to add
circumference
calculation?

class Circle
{
double radius;
void setRadius(double
rValue)
{
radius = rValue;
}
double calcArea()
{
return
3.14*radius*radius;
}
}

6
Health IT Workforce Curriculum
Version 3.0/Spring 2012
Introduction to Information and Computer Science
Computer Programming
Lecture e
OOP Designs
Programs are
designed using tools
UML (Unified
Modeling Language)
is very common
Example for class of
BMICalculator
BMICalculator
double weight
double height
double bmi

void setWeight(double wValue)
void setHeight(double hValue)
void calcBmi()
void outputBmi()
void outputBmiCategory()

5.2 Table: BMI Calculator
7
Health IT Workforce Curriculum
Version 3.0/Spring 2012
Introduction to Information and Computer Science
Computer Programming
Lecture e
Inheritance
Inheritance is a powerful feature of OOP
Classes can inherit methods and instance
variables
Makes coding less redundant
Allows for polymorphism
8
Health IT Workforce Curriculum
Version 3.0/Spring 2012
Introduction to Information and Computer Science
Computer Programming
Lecture e
BankingAccount
String accountNum
double balance
void setAccountNum(double aValue)
void setBalance(double bValue)
double getBalance()
void printAccountInfo()
CheckingAccount
double overdraft
void setOverdraft(double oValue)
double getOverdraft()
SavingsAccount
double interestRate
void setInterestRate (double iValue)
void accrueInterest()
UML Diagram: Inheritance
5.3 Figure: Child classes inherit all methods and instance variables from
parent class

9
Health IT Workforce Curriculum
Version 3.0/Spring 2012
Introduction to Information and Computer Science
Computer Programming
Lecture e
Modularity
Separation of code into components such as
objects
Non-OOP languages implement modularity
Procedures
Allows for
Reuse of code
Maintainability
10
Health IT Workforce Curriculum
Version 3.0/Spring 2012
Introduction to Information and Computer Science
Computer Programming
Lecture e
Encapsulation
Objects can declare methods and instance variables
to be private or public
Typically, instance variables are private
Some (all) methods are public
Class definition controls
Valid ranges for values
Rules for setting values, calling methods
Details of implementation are hidden
Interface is public methods and documentation
11
Health IT Workforce Curriculum
Version 3.0/Spring 2012
Introduction to Information and Computer Science
Computer Programming
Lecture e
Computer Programming
Summary Lecture e
This lecture introduced:
Object-oriented programming
Inheritance
Modularity
Encapsulation
Differences between classes and objects
12
Health IT Workforce Curriculum
Version 3.0/Spring 2012
Introduction to Information and Computer Science
Computer Programming
Lecture e
Computer Programming
Summary
This unit covered:
The purpose of programming languages
Different types of programming languages
The compilation/interpreter process
Programming language constructs
Object-oriented programming (OOP)
How programs are designed and implemented
What code looks like
What objects are and why they are used
13
Health IT Workforce Curriculum
Version 3.0/Spring 2012
Introduction to Information and Computer Science
Computer Programming
Lecture e
Computer Programming
References Lecture e
References
Eck, David. (2011) Introduction to Programming Using Java, Sixth Edition. [updated 2011 Jul 18; cited 2011 Nov
13]: Available from: http://math.hws.edu/javanotes/
Lesson: Object-Oriented Programming Concepts inThe Java Tutorials. (2011). Retrieved 2011 Nov 13 from:
http://download.oracle.com/javase/tutorial/java/concepts/.
Morley Deborah, Parker Charles S. (2010). Chapter 13: Program Development and Programming Languages. In:
Understanding Computers Today and Tomorrow.12
th
ed. Boston: Course Technology.
Parsons JJ, Oja D. (2010). Chapter 12: Computer Programming. In: New Perspectives on Computer Concepts
2011: Comprehensive. 13th ed. Boston: Course Technology.
The Java Language: An Overview. [Webpage]. c 2007. [updated 2007 Dec 17; cited 21 March 2011]. Available
from: http://java.sun.com/docs/overviews/java/java-overview-1.html
Sierra Kathy, Bates Bert. (2009). Head First Java, Second Edition. OReilly Media.

Charts, Tables, Figures
5.2 Table: BMI Calculator (Hribar, 2011)
5.3 Figure: Child classes inherit all methods and instance variables from parent class (Hribar, 2011).


14
Health IT Workforce Curriculum
Version 3.0/Spring 2012
Introduction to Information and Computer Science
Computer Programming Lecture
e

You might also like