Bookmark and Share

Liens sponsorisés

Juniors Level 6 Print E-mail
Written by Administrator   

1 TENT GRAPH

Write a program that will generate and print out the TENT GRAPH below. The fewer PRINT statements you use, the higher your solution will be rated.

! *

! * *

! * *

! * *

!* *

* - - - - *

 

2. STEPPING STONES

A set of stepping stones with lengths 1, 1/2,1/3,1/4,1/5(continuing in this pattern) are available -- one step for each size. It takes at least four steps placed in a stair-step fashion with decreasing step-size (as shown below) for the total height to exceed 2. Three steps are not enough; four is the minimum number of steps necessary to equal or exceed the height of 2.

Write a program that computes a table of numbers showing the minimum number of steps necessary to equal or exceed the heights from 1 to 8. Print out the table in the following format:

Sample Run

HEIGHT STEPS

------ -----

1 1

2 4

3 11

4 31

5 83

6 227

7 616

8 1674

 

3. DART BOARD

Darts thrown at a dart board land in different regions of the board, and a value or score is assigned accordingly. The total score is the sum of the values scored for each toss. The two views of the dart board below show the regions on the board and the corresponding values or scores.

Write a program that simulates the tossing of darts until the score first equals or exceeds 1000 -- when the game ends. Assume that each region is equally likely to be hit by a dart according to the following Random Region Generator:

SEED VALUES (for the Random Region Generator)

J=2^7+3: M=2^15: L=1

SUBROUTINE: R is the Random Region Generator

Begin the generator with the seed L=1.

L=J*L-M*INT(J*L/M)

R=INT(10*L/M)+1

RETURN

Print out a report as shown in the sample run.


Sample Run

REGION HITS POINTS

1 32 224

2 21 105

3 23 115

4 31 155

5 42 126

6 37 111

7 24 72

8 36 36

9 29 29

10 28 28

TOTAL = 1001

 

4 WORD CHECKER

Write a program that asks the user to enter any UPPER-CASE sentence (less than 70 characters in length) and checks it against the words in the DICTIONARY shown below. If a word is not in the dictionary, then print the word and the message "IS NOT IN THE DICTIONARY." Assume that no commas are used in the sentence entered. Test your program with the following sentence (the spaces around the word ALL are intended and should be entered). Your program should handle the spaces properly and should not count them as words. Test your program with the sentence:

NOW IS DE TIME FOR ALL GOUD PR0BLEM SOLVERS TO SOLVE THIS PRBLEM.

DICTIONARY WORDS:

A, ALL, FOR, GOOD, IS, NOW, PROBLEM, SOLVE, SOLVERS, THIS, TIME, TO, WRITE


Sample Run

ENTER AN UPPER-CASE SENTENCE LESS THAN 70 CHARACTERS LONG:

? NOW IS DE TIME FOR ALL GOUD PROBLEM SOLVERS TO SOLVE THIS PRBLEM.

DE IS NOT IN THE DICTIONARY.

GOUD IS NOT IN THE DICTIONARY.

PRBLEM IS NOT IN THE DICTIONARY.

 

5 6X6 CHECKER CHALLENGE

In the 6X6 checkerboard below one and only one checker is placed in each row, each column, and each main diagonal:

Write a program that computes the total number of solutions to the 6X6 Checker Challenge.


Sample Run

THERE ARE ?? DIFFERENT SOLUTIONS TO THE 6X6 CHECKER CHALLENGE.



 

 

Liens sponsorisés