ICS 10 A,B,C
Final Project Set A
Instructor: Mr. Jessie Christopher E. Lagrosas
1.
Title:
TWOTHREEFIVE NUMBERS
A twothreefive number is defined as a number whose only prime factors are 2, 3, or 5.
The sequence 1,2,3,4,5,6,8,9,10,12,15 show the first 11 twothreefive numbers. By convention, 1 is included.
Write a program to find the first N twothreefive numbers, where (0<N<=25).
Sample input:
5
Sample output
1, 2, 3, 4, 5
Java Source Code : CamiloX WorkZ | Ching’s WorkZ | Paolo’s WorkZ
2.
Title:
Modified N!
The expression N! (N factorial) denotes the product of the first N positive integers, where N>0.
Example
0! = 1
1! = 1
2! = 2
3! = 6
4! = 24
and so on.
Write a program that computes for the last non-zero digit of the factorial of N, where N is positive.
Input is any positive integer<10, N.
Output is the last non-zero digit of N!.
Sample input 1:
5
Sample output 1:
1. (because 5!=120, and 2 is the last non-zero digit)
Sample input 2:
12
Sample output 2:
6
Java Source Code : CamiloX WorkZ | Ching’s WorkZ | Genevive’s WorkZ
3. Title: TriangleZ
A triangleZ is a triangle of integers with 1 on top and on the sides. Any number in the interior equals the sum of the two numbers above it.
Sample triangle with 5 rows. (left justified triangle)
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
Write a program that displays the triangleZ with N rows, where (0<N<20)
Input: an integer, N, which corresponds to the number of rows for the triangle.
Output: a left justified triangle.
Sample input:
6
Sample output:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
Java Source Code : CamiloX WorkZ | Ching’s WorkZ | Genevive’s WorkZ | Paolo’s WorkZ
4.
GCF
(Greatest Common Factor)
GCF is the largest number that divides two numbers.
Write a program that computes for the GCF of two given numbers.
Input: 2 integers, (0<x,y<10000)
Output: GCF of the two integers
Sample Input:
10 15
Sample Output:
5
Java Source Code : CamiloX WorkZ | Ching’s WorkZ
5.
Counting
Change
After making a purchase, a man was given P2.50 as change with the following combination of coins: 2 * P1.00, 2 * P0.25. The next day he went shopping, he was given another P2.50 as change for a different purchase but this time with different combination of coins: 1 * P1.00, 4 * P0.25, 5 * P0.10.
Your task is to write a program that finds the total number of combination for a given amount using the different combination of Philippine peso coins (10, 5, 1, .25, .10, .05).
Input: any amount, N, where (0<N<5.0)
Output : the number of combinations available
Java Source Code : CamiloX WorkZ | Ching’s WorkZ
-=[ Back ]=-
CamiloX & Ching’s
WorkZ
© Copyright 2003
All Rights Reserved.