100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Class notes

CMSC131 Class Notes

Rating
-
Sold
-
Pages
32
Uploaded on
28-02-2025
Written in
2021/2022

Notes for the CMSC131 course taken at the University of Maryland, College Park












Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
February 28, 2025
Number of pages
32
Written in
2021/2022
Type
Class notes
Professor(s)
Fawzi
Contains
All classes

Content preview

Type name(declaring) next____ name(using) numbers textinquotes scanner/system/string


Lecture 1 and 2:
● IDE = Integrated Development Environment

Lecture 3: Number Base Conversions
● Base to 10 : basen, basen-1, … , base1, base0
● 10 to base: number/base → remainder is rightmost digit → repeat
● Binary to hex < -- >: group by four and use 8421
○ A=10 → → → F=15
● Write numbers as: numberbase

Lecture 4: Hardware Basics
● Hardware: physical components
● Software: programs
● CPU = Central processing Unit
● Ram:
○ primary memory
○ Random Access Memory
○ extremely fast
● Secondary memory:
○ More permanent (non-volatile)
○ More storage
○ Hard drive
○ USB
● I/O devices: from perspective of computer:
○ Input = send data to computer (mouse)
○ Output = send data from computer (printer)
● Bit: binary digit, either 0 or 1
● Byte: “a sequence of 8 bits”
● Byte combinations available given k(bits) : 2k
● Kilobyte = 1000 or 210
● Megabyte = 1 million or 220
● Gigabyte = 1 billion or 230
● Terabyte = 1 trillion or 240
● How to represent data in binary
○ negative numbers:
■ 2’s complement
■ Flip binary digit and add 1
● -27
● Flip 11011→ 00100
● Add one 00100 + 1 = 00101

,Type name(declaring) next____ name(using) numbers textinquotes scanner/system/string




○ Floating point:
■ Write in scientific notation → _.__ e k
■ Write number in binary and attach k in binary to the end
● *Not correct* 247.3721 → 2.373721e2
● 1101101110110110111 x 27
● 1101101110110110111 |7 represented in binary|
● 1101101110110110111 |0111|
○ Text:
■ Each character has a specific number attached to it
■ ASCII used to be original system
● Used one byte
● 256 possibilities
● 8 digits used
■ unicode
● Since we have more characters to use (diff languages)
● 2 bytes
● 16 digits used

Lecture 5: Operating Systems
● There is windows mac, android, iOS
● What do operating Systems do:
○ Process management
■ What is running right then
■ Could be virus protection or apps not open
■ Orders them in importance
○ Memory Management
■ What memory is being used or not
○ Primitive I/O
■ Handling devices like printers and mouse
○ GUI
■ Graphics, windows, dragging
○ Network control
■ Manages data packets
■ Sent or failed
○ Security
■ Accounts and encryptions

,Type name(declaring) next____ name(using) numbers textinquotes scanner/system/string


Lecture 6: Programming Languages
● Machine language: language that CPU uses
● Assembly language: mnemonic representation of machine language, “readable”
● Languages:
○ Fortran
■ Late 50’s
■ One of the first programming languages
■ Used by scientists and engineers
■ Not designed for object oriented
○ Cobol:
■ Late 50’s
■ Used with big corporations, business
■ Not designed for object oriented
○ Lisp:
■ Hasn’t changed much
■ Used in AI
■ Still used
○ Pascal
■ Used in education
○ C
■ Very easy to learn
■ Not too different from assembly code
■ Procedurally oriented
○ C++
■ Changed for object oriented, abomination
○ Python
○ Java
■ Object oriented
○ Ruby
■ Language of least astonishment
○ Translating higher level code to machine code
■ Compiler is faster but platform dependent
■ Interpreter is the same for everyone
■ Java is both
■ Java compiles to universal java bytecode program and then invokes
interpreter
■ Portability: bytecode runs on all different platforms the same way for
everybody


Lecture 7: First Java Programs

, Type name(declaring) next____ name(using) numbers textinquotes scanner/system/string


● Object: occupy memory and can do things
● Class: module that you write, type of object
● Method: chunk of code given a name
○ Main method: program starts
● Statements: sequential
○ End in “ ; ”
● Comments:
○ // to end of line
○ /* multiple lines */
● String literals: text with “”
● Console: shows running code
● Variables:
○ Variable declaration= making a variable
■ Must do first to be able to use
○ Memory diagram
■ Call stack with value
○ = is assignment operator
■ Name of variable = value

Lecture 8: Primitive Types
● Whole Number primitive types
○ Int = 4 bytes
■ int secondsPerYear = 31557600
○ Long = 8 bytes
■ long humansOnEarth = 7,625,913,792L
○ Short = 2 bytes
○ Byte = 1 bytes
■ byte age =19
● Floating Point primitive types
○ float = 4 bytes
■ float distance = 52.25F
○ double =8 bytes
■ More precision
■ Good for NASA
■ double velocity = 325.92732

● Remaining primitive types
○ char = store characters
■ char letterGrade = 'A';
○ Boolean
■ boolean result = true;
$3.49
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
martinsokorie

Get to know the seller

Seller avatar
martinsokorie University Of Maryland - College Park
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
9 months
Number of followers
0
Documents
3
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

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

Frequently asked questions