Gustavo Rayos
March 5, 2015
Computer Security
Midterm 1 Exam
I.
Introduction
A. Characters
Alice = Good
Bob = Good
Trudy = Bad
B. Alices online bank
 Alice is a good person opening up a bank
1) What are her security concerns?
o Hacking
o Losing money
Computer Security
Homework 1
SOLUTIONS
Please complete the following problems, being sure to explain your conclusions or show your work when
such details are requested. Your solutions must be submitted to Canvas as a PDF le.
This assignment is to be compl
Gustavo Rayos
March 2, 2015
Computer Security
Homework 1
Chapter 1:
1. Consider the definitions of confidentiality, integrity, and availability.
(a) When might each of these aspects of information security be m
/ File: Errors.java
/ Purpose: A program with lots of syntax errors
/ Correct all of the errors (STUDY the program carefully!)
import java.util.Scanner;
public class Errors cfw_
public static void main (String[] args) cfw_
String Name; / Name of the user;
Gustavo Rayos
February 9, 2015
HW 3
Homework 3
1. Analyze the running time of the division algorithm that we studied in HW2. You should denote the
running time for dividing a mbit integer x by an nbit in
Gustavo Rayos
April 20, 2015
Computer Security
Homework 2
Chapter 4
a. Alice sends to Bob (ga mod p), which is (39 mod 17) = 14
a mod p), which is (35 mod 17) = 5
Bob sends to Alice (g
/
/ Hypotenuse.java
/
/ Print the length of the hypotenuse of a right triangle
/
public class Hypotenuse
cfw_
// Calculates the length of the hypotenuse of a right triangle given lengths a
and b
/public static void main (String[] args)
cfw_
int leg_a =
Gustavo Rayos
February 02, 2015
CS 372
HW 2

Question 1

Case 2: x is even and 2r < y proof
Base Case:
0 recursive calls.
The program returns (q,r) = (0,0) when x = 0. It is immediate to
Gustavo(Rayos(
March(3,(2015(
Data(Structures(and(Algorithms(
(
Homework(6(
(
Question)1:)
(
(
*(Please(continue(to(next(page(
(
(0,1) is a tree edge as pre[1] is 0
(1,5) is a tree edge as pre[5] is 0
(2,1) is a tree edge as pre[1] is 0
(5,4) is a tree ed
/
/
/
/
of
/
/
/
CS 271  lab assignment #2
calls.c
To scan a .txt file with phone call lengths, and calculate mean, min, and max
calls.
written by Gustavo Rayos
September 5, 2014
#include <stdio.h>
int main() cfw_
unsigned count = 0;
int length;
int sum
/ CS 172
/ Thursday Lab
/ Written by: Gustavo Rayos
/ March 4, 2014
/ Box.java
/ Purpose: To return whether a box, with given height, width, and depth, is
full.
public class Box cfw_ / class header
private int Height; / instance variables
private int Widt
Gustavo Rayos
April 13, 2015
Data Structures and Algorithms
Homework 10
(a) False
This statement is false because we need to consider a case when the heaviest edge is the only edge
connecting two connected c
Question 3:
3a)
SA
WA
NT
Q
NSW
V
RGB
RGB
RGB
RGB
RGB
RGB
Red
GB
GB
GB
GB
GB
Red
Green
B
G
B
G
This chart shows that the nodes with the most restraints should be t
1. Explain how software development is an engineering task, and explain how it is
also creative and artistic. Compare it to other engineering fields and reason as to
whether they also have both aspects (engineering and art) in them.
Webster's dictionary d
/
/
/
/
/
/
CS 172
Thursday Lab
Written by: Gustavo Rayos
May 5, 2014
FindGCD.java
Purpose: Find the gcd of two numbers using a recursive method.
public class FindGCD cfw_
public static int gcd (int num1, int num2) cfw_
if (num1 < 0)  (num2 < 0) / error
Gustavo Rayos
February 16, 2015
Artificial Intelligence I
Assignment 1
Question 1
Can the software within a GPS device be considered an intelligent agent?
To be an intelligent agent, there are 4 categories i
Gustavo Rayos
March 3, 2015
Artificial Intelligence
Midterm 1 Review
Assignment 1:
1) GPS devices are everywhere. Can the software within a GPS device be considered an intelligent agent?
Why or Why not?
To be considered an intelligent agent, the agent mus
/ CS 172
/ Thursday Lab
/ Written by: Gustavo Rayos
/ February 25, 2014
/ ALittleTrig.java
/ Purpose: To calculate the area of the right triangle formed by the
corresponding point on the unit circle.
import java.util.Scanner;
import java.text.DecimalForma
/
/
/
/
/
/
CS 172
Thursday Lab
Written by: Gustavo Rayos
March 11, 2014
CompareFiles.java
Purpose: To compare two .txt files, and print out the differences.
import java.util.Scanner;
import java.io.*;
public class CompareFiles cfw_
public static void mai
Gustavo Rayos
August 29, 2014
Lab 1 C.S. 278
Part I
1) ImplementthefunctionsbarsandbarsRedeemaccordingtothe
inductivedefinitionsaboveinJavaasrecursiveprograms.
public static int BarsRedeem (int n) cfw_ / part 1
if (n < 0)
return 0;
if (n < 9)
return 0;
re
/ CS 172
/ Thursday Lab
/ Written by: Gustavo Rayos
/ March 11, 2014
/ CountPunctuation.java
/ Purpose: To count the number of commas, periods, exclamation points, and
question marks in a .txt file.
import java.util.Scanner;
import java.io.*;
public class
Gustavo Rayos
HW 1
1/21/2015
0.1. In each of the following situations, indicate whether f = O(g), or f = (g), or both
(in which case f = (g).
f(n)
g(n)
(a) n100
n200
=
f = (g)
f(n)
/ Gustavo Rayos
/ September 3, 2014
/ CS 278
/ Lab 2 Euclids Method
Lab 2
Part I
1) Implement Euclids algorithm for computing gcd using recursion. Runyour
program to compute gcd(8932922, 3987418) and gcd(13741728, 37746852).
public static int gcd (int a,
Gustavo Rayos
April 6, 2015
Artificial Intelligence
Homework 3
Question 1:
If a unicorn is mythical, then it is immortal, but if it is not mythical, then it is a mortal mammal. If the unicorn is
either im
Gustavo Rayos
April 21, 2015
Data Structures and Algorithms
Homework 11
a. 2, 100, 1, 1
The first player has a chance to pick the 2 or the 100. If the first player picks the first card, the 2, t
COMP 9024, Homework Solution, 11s2, Class 1
John Plaice
Sat Aug 13 18:20:52 EST 2011
In each of the following situations, indicate whether f = O(g), or f = (g), or both
(in which case f = (g).
1. f (n) = n 100 and g(n) = n 200.
Both are O(n), so f = (g).