Corrected answers are in red
CMSC 150 Section 6380 Spring 2017 Assignment 1 Answer Sheet
Name:
1: Which of the following sentences are logical statements?
a: If x even divides y, then x is a factor of y
This is a Logical statement not logical
b: If John d
Corrected answers in red
CMSC 150 Section 6380 Spring 2017 Assignment 2 Answer Sheet
Name:
1: Translate the following English sentences into statements of predicate calculus.
a. All programmers enjoy discrete mathematics.
( x)( P( x ) P ( y)
where P(x) =
This homework received 100% from the professor
CMSC 150 Section 6380 Spring 2017 Assignment 6 Answer Sheet
Name:
1: Determine whether each of the following functions is 1to1 and whether it is onto. Assume
the domain and codomain is Z, the integers. Exp
This homework received 100% from the professor
CMSC 150 Section 6380 Spring 2017 Assignment 3 Answer Sheet
Name:
1: Prove that the difference of two odd integers is even. Give a justification
at each step.
Let x and y be odd integers and
( ( x ) ) ( ( y )
This homework received 100% from the professor
CMSC 150 Section 6380 Spring 2017 Assignment 7 Answer Sheet
Name:
1: Calculate the number of integers divisible by 4 between 50 and 500, inclusive.
N = 4k
500 = 52 + 4(n1)
4(n1) = 500  52 = 448
n  1 = 448
Corrected answers are in red
CMSC 150 Section 6380 Spring 2017 Final Exam Answer Sheet
Name:
1: For each the following groups of sets, determine whether they form a partition for the set of
integers. Explain your answer.
a.
A1 = cfw_n Z : n > 0
A2 = cfw_n
Corrected answers are in red
CMSC 150 Section 6380 Spring 2017 Assignment 5 Answer Sheet
Name:
1: Enumerate the elements of the following relations from the set A of positive integers less than
or equal to 10 to the set B of positive integers less than or
This homework received 100% from professor
CMSC 150 Section 6380 Spring 2017 Assignment 4 Answer Sheet
Name:
1: Enumerate the elements of the following sets:
a. cfw_x: x is an odd positive integer less than 13
Let A = cfw_x: x is an odd positive integer l
CMSC 150 Section 6380 Spring 2017 Assignment 4 Answer Sheet
Name:
1: Enumerate the elements of the following sets:
a. cfw_x: x is an odd positive integer less than 13
cfw_1, 3, 5, 7, 11
b. cfw_y: y is a positive integer that is a multiple of 4 and greater
CMSC 150
Homework 1
1. Whichofthefollowingsentencesarelogicalstatements?
a.
Ifxevendividesy,thenxisafactorofy
b.
IfJohndoeswellindiscretemath,thenhewillbeanexcellentprogrammer
c.
2istheonlyevenprimenumber
d.
Heisthebeststudentintheclass
2. Constructthetru
CMIS 150
Homework 4
1. Enumerate the elements of the following sets:
a. cfw_x: x is an odd positive integer less than 13
cfw_1, 3, 5, 7, 9, 11
b. cfw_y: y is a positive integer that is a multiple of 4 and greater than 10 but less
than 25
cfw_12, 16, 20, 2
CMSC 150
Homework 3
1. Prove that the difference of two odd integers is even. Give a justification at
each step
Let q and r be odd integers, ( ( q ) ) ( ( r ) ) [O ( q ) O ( r ) E ( qr ) ]
Statement
O(q)
Justification
O(r)
O(q)
q= 2k+1
O(r)
r= 2k+1
q r=
CMSC 150
Homework 2
1. Translate the following English sentences into statements of predicate
calculus.
A) All programmers enjoy discrete mathematics.
Px= x is programmer
Py= y is enjoy discrete mathematics
( x)( Px Py )
B) Some integers are not odd.
Ix=
Homework #1
1. B & C
2. p
T
T
F
F
q
T
F
T
F
~p
F
F
T
T
p ^ ~p
F
F
F
F
(p ^ ~p) ^ q
F
F
F
F
Contradiction everything returned false
p
T
T
F
F
q
T
F
T
F
~p
T
F
T
T
(p V q) (q V p)
T
F
T
F
Neither False and True returns
p
T
T
T
T
F
F
F
F
q
T
T
F
F
T
T
F
F
r
Homework 1
By Nicholas Cardenas
1. Which of the following sentences are logical statements?
a. If x even divides y, then x is a factor of y
This is a logical statement
b. If John does well in discrete math, then he will be an excellent programmer
This is
Class ManagementCompany
java.lang.Object
o ManagementCompany
public class ManagementCompany
extends java.lang.Object
Author:
Professor khandan Monshi
o Constructor Summary
Constructors
Constructor and Description
ManagementCompany(java.lang.String name,
Lab 6 Data Element Class
Lab Objectives

Be able to declare a new class
Be able to write a constructor
Be able to write instance methods that return a value
Be able to write instance methods that take arguments
Be able to instantiate an object
Be able to
mport javax.swing.JOptionPane;
/*
* Driver to estimate the limit of one of several functions
* as x goes to a specified value from the left
* @author ralexander
*
*/
public class EstimateLimit cfw_
private static Function fn;
one
public static void main(S
1Page
CMSC 203 Spring 2017  Lab 5
Memory Mapping Worksheet
1. Draw the memory map of the following onedimensional array of type int.
int[] x = new int[8];
Stack:
Heap:
2. Draw the memory map of the following twodimensional ragged array of ints.
int[][
/*
* A test driver class.
*
* @author Professor khandan Monshi
*
*/
public class PropertyMgmDriverNoGui cfw_
public static void main(String[] args) cfw_
/Create property objects
Property p1 = new Property ("Belmar", "Silver Spring", 1200,
"John Smith");
P
public class Property
extends java.lang.Object
Represents a Property object
Author:
khandan
o Constructor Summary
Constructors
Constructor and Description
Property(Property p)
Copy Constructor, creates a new object using the information of the object pas
1.
Task #3 Methods
1. Complete the mutator (setter) method called setDescription to set the value of the field
called description to the string corresponding to the index supplied to the method. Use
standard inline notation for the functions (for example
/*
* A test driver class.
*
* @author Professor khandan Monshi
*
*/
public class PropertyMgmDriverNoGui cfw_
public static void main(String[] args) cfw_
/Create property objects
Property p1 = new Property ("Belmar", "Silver Spring", 1200,
"John Smith");
P
CMSC 203, Assignment 4
Spring 2017
Concepts tested by this program
Aggregation,
Passing object to method
Array Structure
Objects as elements of the Array
Processing array element
Copy Constructor
Junit test
Deliverables:
Java files (source code)
JavaDoc F
CMSC 150 Section 6380 Spring 2017 Assignment 1 Answer Sheet
Name:
1: Which of the following sentences are logical statements?
a: If x even divides y, then x is a factor of y
b: If John does well in discrete math, then he will be an excellent programmer
c:
1.
Enumerate the elements of the following relations from the set A of positive integers less then
or equal to 10 to the set B of positive integers less then or equal to 30.
A= cfw_1, 2, 3, 4, 5, 6, 7, 8, 9, 10
B= cfw_1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
1. Enumerate the elements of the following sets:
a. cfw_x: x is an odd positive integer less than 13
cfw_1, 3, 5, 7, 9, 11
b. cfw_y: y is a positive integer that is a multiple of 4 and greater than 10 but less
than 25
cfw_12, 16, 20, 24
2. What is the car
1. (10 pts) For each the following groups of sets, determine whether they form a
partition for the set of integers. Explain your answer.
a. A1 = (n Z : n > )
A 2 = ( n Z : n < 0)
Al = contain all the integers greater than 0
A2 = contain all the integers l
1. Calculate the number of integers divisible by 4 between 50 and 500, inclusive.
( ( 500 52 ) / 4 ) + 1 = ( 448 / 4 ) + 1 = 112 + 1 = 113
2. Hexadecimal digits are formed using either a numeric decimal digit or a letter
from A to F. How many possible dig