Elementary Divsion 1992
Your sample runs need not be formatted exactly like the ones shown 
here.
1.  BAR CHART   
Write a program that asks the user to enter three numbers A,B,C 
where 0<=A<=B<=C<=20 and then prints out a bar chart as shown in
the sample run. 
 
Test you program with the numbers  3,6,9 and 3,9,12. 
 
Sample Run 
 
EL92_1 BAR CHART <Team Name> 
Please enter A,B,C with 0<=A<=B<=C<=20:  3,6,9 
 
  3   6   9 
  *   X   @ 
  *   X   @ 
  *   X   @ 
      X   @ 
      X   @ 
      X   @ 
          @ 
          @ 
          @ 

2.  LIST TO NINE
Start with a two digit number AB with A_B, say 19. Reverse the 
digits to get 91 and take the difference between 91 and 19 to get 
the next number in the list 72 = 91-19. Repeat this process with 
72 to get the next number 45 = 72-27. One more repetition of the 
same process yields 9 = 54-45. The LIST TO NINE is:

		19  72  45  9
The length of the list is 4.

Write a program that asks the user to enter a two digit number AB 
and then generates, using the process described above, 
its LIST TO NINE. If A=B it stops at zero. Display the list and it's 
length.

Test your program with the numbers 19, 55 and 29.
  
Sample Run 

EL92_2 LIST TO NINE <Team Name>

Please enter a number AB between 10 and 99 with A<>B: 19

	19	72	45	9
     **** LIST LENGTH = 4

3.  LET'S MAKE A DEAL
A prize is placed behind one of three doors. You are invited to find it 
by 
picking any one of the doors. Write a program that simulates making 
100 
choices and computing the number of wins and losses. A win occurs if 
you pick 
the door with the prize behind it.

Repeat this simulations 10 times and report the results as shown in the 
sample run.
 
Sample Run  
 
EL92_3 LET'S MAKE A DEAL <Team Name>" 

PICK ONE OF THREE DOORS TO FIND THE PRIZE 
10 SIMULATIONS OF 100 TRIALS EACH

  WINS        LOSSES
   34          66
   38          62
   31          69
   31          69
   36          64
   34          66
   31          69
   34          66
   37          63
   28          72

4. PAGE LAYOUT  
You are a document layout specialist and you are given text to input 
and reformat into one column as in a newspaper. Unfortunately, the 
layout manager is  not sure exactly how wide she wants the column to 
be so she wants you to give  her some samples of different widths. The 
column width is a variable your program will use to format the text. 
 
Write a program to format a paragraph of text into one columns for a 
given total column width. The user will select the width (in characters) 
that the page should be. You can make the following assumptions: 
 
There will be no more than 25 rows of input lines or 25 rows of 
output. For this problem, place the text in DATA STATEMENTS so it 
needs to be entered only once.
 
Test you program with the first paragraph above. Run the program 
with column width = 60 and column width = 40. 

Sample Run

El92_4 PAGE LAYOUT <Team Name>
Enter a column width:  40

You are a document layout specialist 
and you are given text to input and 
reformat into one column as in a 
newspaper. Unfortunately, the layout
manager is not sure exactly how wide 
she wants the column to be so she wants
you to give her some samples of 
different widths. The column width is a
variable your program will use to 
format the text. 
 
5. UNIQUE QUOTIENTS
Find all unique solutions to the quotient:

              ABC / DE = 9

where the digits A, B, C and D,E are all odd digits 
taken from the set 1,3,5,7,9 . The efficiency of your algorithm 
will be used to award design and speed points.

Sample Run

EL92_5  UNIQUE QUOTIENTS  <Team Name>
117 / 13 = 9
135 / 15 = 9
153 / 17 = 9
171 / 19 = 9
315 / 35 = 9
... / .. = 9
	ICPSC 1992
	Elementary Division Problems

{PAGE}


