COMP122
Week 6 Homework
Complete the following problems.
1. Write C+ statements to do the following:
a. Declare an array alpha of 15 components of type int.
int alpha[15];
b. Output the value of the 10th component of the alpha array.
cout < alpha[9];
c. S

Page 1 of 4
COMP122
Jorge H RuedaLopez
COMP122
Week 3 Homework
Complete the following problems.
1. What is the output from the following C+ code fragment?
int count = 1;
int y = 100;
while(count < 100)
cfw_
y = y - 1;
count+;
cout < "y = " < y < " and co

1
COMP122
Jorge H Rueda Lopez
COMP122
Week 2 Homework
Complete the following problems.
1. Suppose you are given the following variable declarations:
int x, y;
char ch;
What values (if any) are assigned to x, y, and ch after each of these statements execut

1
COMP122
Jorge H RuedaLopez
COMP122
Week 1 iLab - Part 2
Complete the following two programs:
Programming Problem 1
John wants to know the values of the area and perimeter of a rectangle. John can take
measurements of the length and width of the rectangl

1
COMP122
Jorge H. RuedaLopez
COMP122
Week 2 iLab
Complete the following two programs:
Programming Problem 1
Write a program that calculates and outputs the monthly paycheck information for an
employee, including all the amounts deducted from an employees

COMP122
Week 1 iLab - Part 2
Complete the following two programs:
Programming Problem 1
John wants to know the values of the area and perimeter of a rectangle. John can take
measurements of the length and width of the rectangle in inches. John's measureme

COMP122
Week 1 Homework
Part 1: Complete the following problems.
1. What is machine code? Why is it preferable to write programs in a high level language
such as C+?
Machine code is the root language of computers that is spoken in 0 and 1. We use a high
l

COMP122
Week 2 Homework
Complete the following problems.
1. Suppose you are given the following variable declarations:
int x, y;
char ch;
What values (if any) are assigned to x, y, and ch after each of these statements execute?
Assume that the input to ea

COMP122
Week 2 iLab
Complete the following two programs:
Programming Problem 1
Write a program that calculates and outputs the monthly paycheck information for an
employee, including all the amounts deducted from an employees gross pay, and the net
pay th

Michael Stepaniak
COMP122
Week 3 Homework
Complete the following problems.
1. What is the output from the following C+ code fragment?
int count = 1;
int y = 100;
while(count < 100)
cfw_
y = y - 1;
count+;
cout < "y = " < y < " and count = " < count < end

COMP122
Week 3 iLab
Complete the following two programs:
Programming Problem 1
Write a program that generates all the factors of a number entered by the user. For
instance, the number 12 has the factors 2 * 2 * 3. This program has the following
requiremen

COMP122 Week 4 Lab Part 2
Part 2 Black Box Testing
A customer has requested a program be developed to meet the following criterion:
1. The program needs to convert from Celsius temperatures to Fahrenheit temperatures.
2. The user should be able to enter t

COMP122
Week 5 Homework
Complete the following problems.
1. Determine the value of the following expressions.
a. toupper('b')
B
b. tolower('C');
c
c. pow(3.0,3.0);
3
3 =27
d. sqrt(81.0);
81=9
e. fabs(-1.23);
|-1.23|=1.23
f. floor(22.46);
22
g. ceil(33.3)

COMP122
Week 5 iLab
INPUTS
PREDICTED
OUTPUT
Test
Cas
e
Menu
Input
Start
Temperature
Stop
Temperature
Increment
1
f
32
212
36
FtoC calc and table
2
F
-40
-20
10.5
FtoC calc and table
3
C
0
100
50
CtoF calc and table
4
c
-100
20
20.5
CtoF calc and table
5
Q

1
COMP 122
Jorge H RuedaLopez
COMP122
Week 1 Homework
Part 1: Complete the following problems.
1. What is machine code? Why is it preferable to write programs in a high level language
such as C+?
Machine code is a low-level programming language that is ex

COMP122
Week 6 iLab
You are to design a program that will allow some number of grades (up to a max of 100)
to be input by the user. After the data has been collected, your program should calculate
and output the mean and median of the collected data, as w

COMP122
Week 5 Homework
Complete the following problems.
1. Determine the value of the following expressions.
a. toupper('b')
B
b. tolower('C');
C
c. pow(3.0,3.0);
27
d. sqrt(81.0);
9
e. fabs(-1.23);
1.23
f. floor(22.46);
22
g. ceil(33.3);
34
2. Using the

COMP122
Week 1 Homework
Part 1: Complete the following problems.
1. What is machine code? Why is it preferable to write programs in a high level language
such as C+?
Machine code is a language that a computer can understand and execute. Writing
programs i

COMP122
Week 3 Homework
Complete the following problems.
1. What is the output from the following C+ code fragment?
int count = 1;
int y = 100;
while(count < 100)
cfw_
y = y - 1;
count+;
cout < "y = " < y < " and count = " < count < endl;
y = 1 and count

COMP122
Week 2 Homework
Complete the following problems.
1. Suppose you are given the following variable declarations:
int x, y;
char ch;
What values (if any) are assigned to x, y, and ch after each of these statements execute?
Assume that the input to ea

COMP122
Week 2 Homework
Complete the following problems.
1. Suppose you are given the following variable declarations:
int x, y;
char ch;
What values (if any) are assigned to x, y, and ch after each of these statements execute?
Assume that the input to ea

COMP122
Week 1 iLab - Part 2
Complete the following two programs:
Programming Problem 1
John wants to know the values of the area and perimeter of a rectangle. John can take
measurements of the length and width of the rectangle in inches. John's measureme

COMP122
Week 1 Homework
Part 1: Complete the following problems.
1. What is machine code? Why is it preferable to write programs in a high level language
such as C+?
Machine code is a low-level programming language that is executed directly by the CPU.
Si

COMP122
Week 3 iLab
Complete the following two programs:
Programming Problem 1
Write a program that generates all the factors of a number entered by the user. For
instance, the number 12 has the factors 2 * 2 * 3. This program has the following
requiremen

COMP122
Week 2 iLab
Complete the following two programs:
Programming Problem 1
Write a program that calculates and outputs the monthly paycheck information for an
employee, including all the amounts deducted from an employees gross pay, and the net
pay th

COMP122
Week 3 Homework
Complete the following problems.
1. What is the output from the following C+ code fragment?
int count = 1;
int y = 100;
while(count < 100)
cfw_
y = y - 1;
count+;
cout < "y = " < y < " and count = " < count < end;
y = 1 and count