Computer Science I
Dr. Tom Hicks - Trinity University - CSCI 1320-  Fall 2020

All Labs/Assignments Are Due The Next Class Period Unless Specified Otherwise!


P
R
E
-
S
E
M
E
S
T
E
R




Maybe Prepare Your Computer
Before Semester Begins?

 

Install vdi.trinity.edu

Install ZOOM

How o Upload Files To Mars DropBox
(VMWare Installation Directions Included)

Transferring-Files-Into-My-Mars-DropBox-From-Win.pdf

Transferring-Files-Into-My-Mars-DropBox-From-Mac.pdf

Transferring-Files-Into-My-Mars-DropBox-From-Linux.pdf
# Topic(s) Reading Assignments
 & Handouts
Laboratory Assignment

#1

8/25

TU


Introduction To Class
Discuss Course Outline

Chapter 1

Computer Science
Computer Programming
Designing, Writing, Testing Debugging, Maintaining
CS Salaries
CS - Young Science
Charles Babbage
Ada Lovelace
Alan Turing - Turing Award
Alonzo Church - Lamda Calculus
Eniac
Software
BIOS Software
Operating Systems
Hardware
Motherboard, Processor, Cooling Fan,
Machine Language
Processor Cycles
Binary Digits (0,1) - Bit
Processor Instruction Set
Voltage
Transistors
von Neumann Architecture
Memory
Bus
 Machine Language
Processor Cycles
Binary Digits (0,1) - Bit
Processor Instruction Set
Voltage
Transistors
von Neumann Architecture
Memory
Bus
Assembly Language
Assembler
Compilers
High-Level Languages
Scala
Interpreter
Scala - Java Virtual Machine
Scala Portability
Scala Multiplatform
Martin Odersky - Creator Scala
Scala - open source
Programming Paradigms
Imperative Paradigm
Functional Paradigm
Object Oriented Paradigm
Scala - Hybrid Language
Basic Integer Operations
Integer Division
math.pow(2,3) - Exponentiation
Int - Integer Variables
Double - Double Variables
Order Of Operations - Correct
Modulus
REPL - Read-Evaluate-Print-Loop
Numeric Literal - 0,5,3
res0 - result0
Strings - String Variables
Line Comments //
Block Comments /*   */
val vs. var ??
String Concatenation +
print & println
Int - +/- 2 billion - 4 bytes
var - variable - can be changed
val - constant - no change
Double - decimal numbers
double - float - not exact

 

Course Outline

PCS1-Ch-1A-Intro-Scala-Slides

Read Chapter 1

 

 

CH-1A-Intro-To-CS-Scala-HW.zip

 


# 2

8/27

TH


Chapter 2
Linux & Tools

GUI
Valid Directory Names
Command Line Interface
Putty - Free!
clear - clear console window
Bit - binary digit
Byte 8 bits - 1 char
Directory/Folder
Text File
ASCII
Binary File - Executable
ls - list files
Linux File Permissions
Hidden Files (start with.)
Wild Cards (*)
mkdir - create directory
cat - display ascii-text files
cd - Change Directory
cp - Copy Files
rmdir - Delete Empty Directory
rm - Delete File Or Directory
mv - Move Files
chmod - Change File Permissions
rwx - binary -421
exit - close terminal window
man - help system man pages
compile a scala program
redirect output >
less - cycle through file
whoami - linux groups
ping
rsh - remote shell disabled
telnet - disabled
df - disk free
find - display a list of files
grep - search files for text
head - top of file
tail - bottom of file
who - logged in?

vi command line  editor
why use
2 modes
i - enter input mode
ESC - enter command mode
ESC:wq - save & exit
ESC:w - save & stay
ESC:q! - exit & discard changes
a - input after cursor
arrow keys - command mode
:50 - go to line 50
I - input mode at beginning of line
A - input mode at end of line
x - delete char
dd - delete line
yy - yank to clipboard
P - paste before cursor line
p - paste after cursor line
J - join cursor line with following line
/tom - search for tom
- repeat last command
u - undo
:r a.scala - read file into editor



Ch-2A-Intro-Linux-Slides

Read Chapter 2

Ch-2A-Linux-HW.zip


# 3

9/1

TU


Chapter 2B
Basics & Scripts
 
Byte - 8 bits
Short - 2 bytes - 16 bits
Int - 4 bytes - 32 bits
Long - 8 bytes - 64 bits
Char - 8 bits - single quotes
String - double quotes - \n
String - \\ - \' - \"
Boolean - true = false
Float - 4 bytes - 32 bits
Double - 4 bytes - 32 bits
.toString Conversion
.toInt Conversion
.toByte Conversion
.toLong Conversion
.toFloat Conversion
.toDoubleConversion
6 Logical Operators
<, <=,  >, >=, ==, !=
AND &&, OR || , NOT !
String Concatenation
String Repeat
Tuples ( , , )
2-tuple 5 -> 9
readInt
readDouble
readLine
Interactive Program
Scripts vs Applications
Scripts -> no scalac
shortcuts & abbreviations


 

PCS1-Ch-2B-Scala-Basics-Slides.pdf PCS1-Ch-2B-Scala-Basics-HW.zip

# 4

9/3

TH

  

Chapter 2C
Numeration & Basics

Decimal Numeration System
Decimal Counting Numbers
Binary Numeration System
Binary Counting Numbers
Euler Process
Convert Base 10 to Base 2
Convert Base 2 to Base 10
Octal Numeration System
Octal Counting Numbers
Euler Process
Convert Base 10 to Base 8
Convert Base 8 to Base 2
Convert Base 2 to Base 8
Convert Base 8 to Base 10
Hexadecimal Numeration System
Hexadecimal Counting Numbers
Euler Process
Convert Base 16 to Base 10
Convert Base 10 to Base 162
Convert Base 16 to Base 2
Convert Base 2 to Base 16
Storage Of Positive Integers
Sign Bit - High Bit
Bits Numbered From Zero
Sign Magnitude - Negative Integers
One's Complement - Negative Integers
Two's Complement - Negative Integers
.toBinaryString
.toOctalString
.toHexString
Addition Of Base Two Numbers
Subtraction Of Base Two Numbers
Math Defaults -> Int & Double
Why Know?
 

PCS1-Ch-2C-Numeration-Slides.pdf



PCS1-Ch-2C-Numeration-HW.zip


# 5

9/8

TU

 

Install Scala

Practice

 


Practice 2A, 2B, & 2C

# 6

9/10

TH


Chapter 3-A
Conditional Logic
 
George Boole
Linux GUI Editor gedit&
Multiple Windows
if then
if then else
Amusement Park Program
Testing A Program
String Equivalence eq
Mathematical Order Operations
Food Cost Calculation Program
Good Error Messages
Test!
match statement

PCS1-Ch-3A-Conditional-Logic-Slides.pdf

 

Read Chapter 3

Installing-Java-Scala-On-Windows-10.pdf

Installing-Java-Scala-On-A-Mac.pdf

 

 

PCS1-Ch-3A-Conditional-Logic-HW.zip
   


# 7

9/15

TU

 
Chapter 3-B - Chapter 8
Loops

length - String
.toUpperCase
.toLowerCase
.substring(N,M)
short-cuts
+=, -=, *=, /=, %=
while - pretest loop
When To Use While Loop
Examples
do while - posttest loop
When To Use Do While Loop
Examples
for - fixed repetition loop
When To Use For Loop
Examples
formatted printf ("%5d"
formatted printf ("%5.2f"
str(N) - Returns String Character


  

PCS1-Ch-3B-Basic-Loops-Slides.pdf

Read Chapter 3



PCS1-Ch-3B-Basic-Loops-HW.zip

# 8

9/17

TH

 

Chapter 4
Functions With Explicit Returns
 

max(x,y) - Return Largest Of Two Ints
Function Format
max(x,y,z) - Return Largest Of Three Ints
areaTriangle (height, base) - Return Area
volumeTriangularPrism (triangleHeight: Double, triangleBase: Double, prismHeight: Double)
upChar - Return Capital
secondsToTimeString(totalSeconds:Int)

   

 

 

PCS1-Ch-4A-Functions-1-Slides.pdf

Read Chapter 4


PCS1-Ch-4A-Functions-1.zip


# 9

9/22

TU

 

 

 


# 10

9/24

TH

   Exam I  


 

# 11

9/29

TU

 

 






# 12

10/1

TH






 

# 13

10/6

TU

 


 

 


# 14

10/8

TH

   



# 15

10/13

TU

 

   

# 16

10/15

TH

 
   




# 17

10/20

TU

 



   



# 18

10/22

TH

 



   



# 19

10/27

TU




 














# 20

10/29

TH


   Exam II  



 
# 21

11/3

TU

 











# 22

11/5

TH





   
 

# 23

11/10

TU




 

# 24

11/12

TH

   

 








 

# 25

11/17

TU

 



 
 

# 26

11/19

TH








# 27

11/24

TU


THANKSGIVING

   

   

# 28

11/26

TH

THANKSGIVING

   

# 29

12/1

TU

   Exam III 

   

# 30

12/8

TH

 

   




RD

12/9

M




READING DAY





    READING DAY





    READING DAY



RD

12/10

TU



    READING DAY




    READING DAY




    READING DAY


+

No Assignments Will Be Accepted After Noon on 12/9