Anda di halaman 1dari 1

ITCS121L – Computer Programming 2

Problem Set
2nd Semester, Midterm, AY 2010-2011
Sir Jayson Sabale

Submission Requirements:
1. Executable file (create a menu of all problems and solutions)
2. Source Code ( project folder including .cpp files)
3. Problems and Answer/s to Each Problem (PDF format, indicate group members)
Grading Criteria:
 Promptness 10 pts.
 Correct Answers 5 pts. Each x 7
 Completeness of Requirements 30 pts.
 Object-oriented Approach 15 pts.
Total of 90 points
Manner of Submission:
 compress it in a RAR or ZIP format and send it to: jssabale@dlsud.edu.ph and to jssabale@live.com
 Filename: CSIT212L_MembersSurname for ACC/ACI
 Ex. CSIT212L _RosarioQueSabale
 Filename: ITCS121L_MembersSurname for BCS
 Ex. ITCS121L _RosarioQueSabale
Deadline of Submission:
January 28, 2011
Late submitted requirements will incur a 5% deduction per day
* First group to pass will merit 4 additional points for Long Quiz, 2 nd Group – 3 points, the rest, 2 points.
Problems
Note: All computations/solutions must be in a separate file. Use only the concepts discussed so far.

1. Find the greatest product of five consecutive digits in the 1000-digit number.
73167176531330624919225119674426574742355349194934969835203127745063262395783180169848018694788518438586156078
91129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523
16173185640309871112172238311362229893423380308135336276614282806444486645238749303589072962904915604407723907
13810515859307960866701724271218839907979087922749219016997208880937766572733300105336788122023542180975125454
05947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482
83972241375657056057490261407972968652414535100474821663704844031998900088952434506585412275886668811642717147
99244429282308634656748139191231628245861786645835912456652947654568284891288314260769004224219022671055626321
11110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005
24063689912560717606058861164671094050775410022569831552000559357297257163626956188267042825248360082325753042
0752963450

2. A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit
numbers is 9009 = 91 × 99.
Find the largest palindrome made from the product of two 3-digit numbers.

3. 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

4. The sum of the squares of the first ten natural numbers is,
1^(2) + 2^(2) + ... + 10^(2) = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ... + 10)^(2) = 55^(2) = 3025

Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum
is 3025 − 385 = 2640.

Find the difference between the sum of the squares of the first one hundred natural numbers and the square of
the sum.

5. A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,
a^(2) + b^(2) = c^(2)

For example, 3^(2) + 4^(2) = 9 + 16 = 25 = 5^(2).

There exists exactly one Pythagorean triplet for which a + b + c = 1000.


Find the product abc.
Find a, b, c.

6. If you used only your keyboard to enter data, how many years and days would it take to fill up the hard drive in
your computer that can store 90 gigabytes of data? Assume "normal" six-hour working days, and that one byte is
required to store one keyboard character, and that you can type 200 characters per minute. Create a program
that will accept size of HD, hours per day, characters per minute as inputs and display the years and days to
complete the task. *Note: 1 kb = 1024 bytes

Anda mungkin juga menyukai