CSC 243 Homework Assignment 2, Fall 2012
Lebanese American University · Introduction to Object Oriented Programming · 2 pages · Dr. Azzam Mourad
More CSC 243 files
Show the text of this homework
LEBANESE AMERICAN UNIVERSITY
School of Arts and Sciences
Department of Computer Science and Mathematics
Fall 2012
CSC 243
Assignment 2
Due on October 15, 2012
ExerciseI: Write an application that inputs one number consisting of five digits from
the user separates the number into its individual digits and prints the digits separated from
one another by three spaces each. For example, if the user types in the number 42339, the
program should print
4 2 3 3 9
ExerciseII:
Using only the programming techniques you learned in this chapter, write an application
that calculates the squares and cubes of the numbers from 0 to 10 and prints the resulting
values in table format, as shown below. [Note: This program does not require any input
from the user.
Number Square Cube (n++)
0
0
0
1
1
1
2
4
8
3
9
27
4
16
64
5
25
125
6
36
216
7
49
343
8
64
512
9
81
729
10
100
1000
ExerciseIII:
Book 6th edition (P. 137, PP 2.9) or Book 7th edition (P 135, PP 2.11)
Deliverables:
You must submit an electronic copy of this assignment (zip files containing only the .java
files) to your lab instructor through blackboard. You have also to do a demo during the
first lab on or after the due date. The lab instructors are M. Ghenwa Al Jurdi
(ghenwa.aljurdi@lau.edu.lb) and M. Hiba Sanadiki (hiba.sanadiki@lau.edu).
Policy on Cheating and Plagiarism
Plagiarism on assignments and project work is a serious offense. If plagiarism is detected,
a student will be subject to penalty, which ranges from receiving a zero on the assignment
concerned to an “F” in the course.