

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The extra credit assignment for csce 101: introduction to computer concepts, spring 2008. Students are required to identify variables, their types, assignment statements, output statements, and input statements in five different c++ programs. The document also includes the code for each program.
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


CSCE 101: Introduction to Computer Concepts
Extra Credit Assignment 2
Name: ______________________________________________________________
Section: ________________________________ Grade: _____________
For each one of the following program, provide the following. (2 pt. each).
programs.
Program 1
Line# Code
#include <iostream.h>
main() {
int number =6;
int weight =1;
if (number >= weight)
cout << number;
else {
cout << number;
cout << weight;
}
cout << endl;
}
Program 2
Line# Code
#include <iostream.h>
main() {
int principal =3;
principal = principal - 1;
while (principal < 3){
cout << principal << endl;
principal = principal + 1;
}
}
Program 3
Line# Code
#include <iostream.h>
main() {
int limit = 1;
int index;
while (limit < 4){
cout << index << endl;
index = 1;
while (index <= 3) {
cout << index << endl;
index = index + 1;
limit = limit + 1;
Program 4
Line# Code
#include <iostream.h>
main() {
int area = 0;
int principal;
while (area < 4){
cout << area << endl;
principal= area;
while (principal <= 4) {
cout << principal << endl;
principal = principal + 1;
area = area + 1;