Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Divine Word College of Calapan

School of Engineering and Architecture

1. Write a program that accepts a number and outputs its equivalent in words.

Sample Input/output dialogue:

Enter a number: 1380 INPUT

One thousand three hundred eighty OUTPUT

2. Write a program that accepts an ordinary number and outputs its


equivalent Roman Numerals. The ordinary number and their equivalent
Roman numerals are given below:

Ordinary Numbers Roman Numerals

1 I
5 V

10 X

50 L

100 C

500 D
1000 M

Sample input/output dialogue

Enter a number:2968 INPUT

MMCMLXVIII OUTPUT

3. Write a program that determines if the input letter is a VOWEL or


CONSONANT. The vowels are: A E I O U. Your program must be able to
handle a capital or small input letter.
4. Write a program that accepts dates written in numerical form and then
output them as a complete form. For example, the input:
22 6 1986

Should produce the output: February 26, 1986


5. Write program that examines the value of variable called temp. Then
display the following messages, depending on the value assigned to temp.
Temperature Message

Less than 0 ICE

Between 0 and 100 WATER

Exceeds 100 STREAM

6. Write a program that determines the class of the Ship depending on its class
ID (identifier). Here are the criteria. The class ID serves as the input data and
the Ship class as the output information.
Class ID Ship Class

B or b Battleship

C or c Cruiser

D or d Destroyer

F or f Frigate

7. The National Earthquake Information Center has the following criteria to


determine the earthquake’s damage. Here are the given Richter scale
criteria and their corresponding characterization. The richer scale serves as
the input data and the characterization as output information.
Richter Number (n) Characterization
N <5.0 Little or no damage
5.0>=n<5.5 Some damage
5.5>=n<6.5 Serious damage
6.5>=n<7.5 Disaster
Higher Catastrophe

8. Write a program that computes and assesses the tuition fee of the students
in one trimester, based on the given mode of payment below:
Plan (key) Discount (-) or Interest (+)
Cash (1) 10% discount
Two- Installment (2) 5% discount
Three- Installment (3) 10% interest

The target—user must use the key in selecting or choosing the mode of
payment. The first input data is the is the tuition fee, and the second input
data is the mode of payment.

Sample input/ output dialogue:


Enter tuition fee: 20,000 Input data
(Press 1 for Cash, 2 for Two-Installment, 3 for Three – Installment)
Enter mode of payment : 2 Second input data
Your total tuition fee is: 21,000 Output data

9. Write a program that accepts an input grade in percentile form and output
its grade equivalent; based on the given range of percentile and grade
equivalent table below:
Range Grade
98-100 1.00
95-97 1.25
92-94 1.50
89-91 1.75
85-88 2.00
82-84 2.25
80-81 2.50
77-79 2.75
75-76 3.00
Other “Out-of-
grades Range”

10. Write a “scissors-rock-paper” game, commonly known as “jack n poy” in


the Philippines. Two players will input the first equivalent letter. For example,
s for scissors, r for rock, and p for paper, then display the winner and the
basis of winning such as: “paper cover rock”, rock breaks scissors”, and
scissors cut paper”, or nobody wins. Capital or small letter should be
accepted by your program.

You might also like