Summaries for Stellenbosch University Computer Science 144 - covering topics 3.1, 3.2, 3.3. and 3.4.
3.1 Using Data Types
describes how to use existing reference data types, for text processing image processing.
3.2 Creating Data Types
describes how to create user-defined data types using J...
Using Data Types
often
Objects are called
ways to hide
data type value
complexity
Objects : holds a abstract data types : Abts
the variable name refers to the object
has its own set of
properties leg Strings
.
: concatenate . . . ) Data type : set of values and operations
on those values
examples of objects
V
set of values Operations primitive boolean , int double
Data type types :
, ,
. . .
color 24 bits get red component, brighten > these values directly map to machine
Picture of colours get / set color of pixel Ciij )
array
representation / follow machine
2D
string sequence of character length ,
substring , compare instructions ( building blocks of objects)
✓
construct a new object creates space for an object objects combine types to
perform specific
•
keyword new ( invokes constructor method ) tasks ( they process other types of data)
name of data type to specify which type of object
◦
Apply an
operation not
initialized ,
•
use name of object ( specify)
dot ( invoke method )
use
operator
•
^
•
use name of the method Cto
specify operation) dot
operator
string : An ADT Object ) for text processing
•
basis for text processing
set of values of Unicode characters
sequence
• =
•
has an API :
Application Programming Interface
with each other
way for 2 to communicate coffers service to
a computer programs
> a
or more
other pieces of
>
API
specification :
describes how to use such an interface software )
e.
g. Gene finding algorithm
, Image processing
color Data type
•
set of values ( RGB representation ) : 2563 values
of red, and blue scale of
quantify amount
green on a 0 255
-
instance methods
( modify objects to do something )
colour)
• luminance determines the readibility of text on a screen ( effective brightness of a
•
difference in luminance between 2 colours should be ≥ 128
•
grayscale : when all three R G and B values are the same
,
picture Data type
of
2D
array colour objects (
pixels )
◦ -
OOP :
Natural vehicle for
studying abstract
models of the real
world .
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller miaolivier16. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for £5.43. You're not tied to anything after your purchase.