Case Study #1 (Sequence)
Nov. 14-18, 2006
1. given:
Input the value of a and b and return the value of C. Express the result with two decimal places.2. One sack of rice is equivalent to 50 kilos and its cost is M pesos. Input the value of M together with the number of kilos that Beth will buy. Return the equivalent amount Beth will pay.
3. Input the number of days (in integer form) and return the following breakdown in terms of: # of months, # of weeks, and # of excess days.
Consider 30 days equals one month. Use the "/" and "%" operators.
~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~
Case Study #2 (Selection)
Nov. 21-25, 2006
1. Input an integer value from 0 - 10000 and output its word equivalent. Any other numbers are considered invalid.
2.

~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~
Case Study #3 (Iteration)
Jan 9-13, 2007
1. Satisfy the following:
a) Input the number of row (given range is from 1-15 only) and generate an inverted triangle as shown below.
Ex: row = 4
b) Generate the ff:
2. Create a digital clock with hours, minutes and seconds simulation. Start the counting from 00:00:00 until 23:59:59 and reset the figure to 00:00:00. Implement delay.
~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~
Case Study #4 (Function)
Feb. 6-10, 2007
1. Call by Value
Input four exam scores in function main( ). Valid exam scores are from 0-100 only. Based on the displayed computed average grade, the function equivalent( ) should the return a result based on the table below:
average grade ................ result
90 - 100 ........................... A
80 - 89 ............................. B
70 - 79 .............................. C
60 - 69 ............................. D
0 - 59 ............................... E
Display the returned result in function main( ).
2. Call by Reference
Input a positive integer number N in the function main( ). Maximum value for N is 10. (provide error trapping mechanism). Call function entry( ) which will ask for N integer numbers as inputs. Function entry( ) should return the count of all positive, negative, and zero numbers. Print the results in function main( ).
3. Recursion
Convert the formula pow(base, exponent) using a recursive process. Input the value of the base as an integer data and the exponent should be a positive, non-zero integer value (observe error trapping). Print the expected output in the function main( ).
ex: base = 2, exponent = 5, proces = 2*2*2*2*2, result = 32
~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~
Case Study #5 (Array)
up to March 17, 2007
given: 9x9 int array
specs:
1. Allow the user to specify the row and column to work with; min of 2x2 and max of 9x9 dimension
2. The contents/elements of the array will be provided by the user
3. The user is allowed to select one or all of the ff. sorting requirements, namely: by row, by column, or the entire set. The sorting manner will be ascending.
ex.
row = 3, col = 4
input data
5 0 4 3
1 7 2 6
9 2 8 1
sort by row
0 3 4 5
1 2 6 7
1 2 8 9
sort by column
1 0 2 1
5 2 4 3
9 7 8 6
sort all
0 1 1 2
2 3 4 5
6 7 8 9
* see passing of values for 2-dimensional array on March posting
~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~
No comments:
Post a Comment