-
Notifications
You must be signed in to change notification settings - Fork 0
/
exam1-s08-sol.txt
131 lines (106 loc) · 1.79 KB
/
exam1-s08-sol.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
https://powcoder.com
代写代考加微信 powcoder
Assignment Project Exam Help
Add WeChat powcoder
https://powcoder.com
代写代考加微信 powcoder
Assignment Project Exam Help
Add WeChat powcoder
Exam 1, Version 1 (day listed as "Tue").
Solutions
CS 213 Spring 2008
*********
Problem 1
********
Decimal | Binary
27 | 011011
-28 | 100100
-21 | 101011
3 | 011
43 | 101011
-8 | 111000
8 | 001000
-2 | 110
-32 | 100000
*********
Problem 2
********
A.
2^(-149)
NaN
2^24 + 1
B.
False (Tmin)
True
False (TMax, TMin)
True
*********
Problem 3
********
A.
0 001 1000
1 111 0000
0 101 0010
0.6875 or 21/32
-0.125 or -1/8
NaN
B.
0 000 1111 = 15/64 = 0.234375
C.
0 110 1111 = 31/2 = 15.5
*********
Problem 4
********
int **
A[i][j]*i*j
*********
Problem 5
********
H = 9
J = 62
*********
Problem 6
********
A Wed
B Mon
C Thu
D Tue
*********
Problem 7
********
long test(long a, long b, long c)
{
long answer = 0;
switch(c)
{
case 3:
answer = b-a;
break;
case 2: (or 7)
case 7: (or 2)
answer = b+42;
break;
case 0:
a = a+b;
/* Fall through */
case 6:
answer = a^b;
break;
default:
answer = 0;
}
return answer;
}
*********
Problem 8
********
A.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|a |xx|us|us|b |xx|cn|cn|c |xx|xx|xx|xx|xx|xx|xx| e|u | p|r |i |c |e |e | d|xx|
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|xx|xx|uk|uk|uk|uk| | | | | | | | | | | | | | | | | | | | |
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
B. Answers vary.
C. 12
D. 4