Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 12 pages
Summary

Summary Computer Science 144 A1 summaries

Document preview thumbnail
Preview 2 out of 12 pages

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 Java's class mechanism. 3.3 Designing Data Types considers important techniques for designing data types, emphasizing APIs, encapsulation, immutability, and design-by-contract. 3.4 Case Study: N-Body Simulation presents a case study that simulates the motion of n particles, subject to Newton's laws of gravity. Note: these summaries are for the Java language.

Content preview

3.1 .

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 .

Document information

Uploaded on
September 21, 2022
Number of pages
12
Written in
2022/2023
Type
Summary
$7.63

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
miaolivier16
4.5
(124)
Sold
745
Followers
465
Items
24
Last sold
2 months ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions