Sei sulla pagina 1di 12

The gem cannot be polished without friction, nor man perfected without trials MP1

Create a program that will let the user input letters and numbers. Then the program will display the
designated ascii code for each inputted letters and numbers. Then you will get the sum and average. The
program must loop. The program must count how many times the user inputted. Restriction is a must. :)
OUTPUT:
Enter String: MaAn23
Ascii Code: [M]=77 [a]=97 [A]=65 [n]=110 [2]=50 [3]=51
Sum is: 450
Average: 75
Do you want to enter again?: N
Number of times you input numbers: 1
MP2
Create a program that will let the user input 6 numbers ONLY. If user inputted greater than 6 numbers there
will be a default message "6 NUMBERS ONLY!" but still the program will still loop unless the user wants to
exit the program. After that, the program must get the sum and average of the 6 numbers. Then when the
user wants to exit the program, the program must count how many times the user inputted numbers.
Restriction is a MUST..
OUTPUT:
Enter 6 NUMBERS: 123456
SUM is: 21
Average: 3.5
Do you want to enter again?: N
Number of times you input numbers: 1
Create a program that will let the user input numbers. If the ascii value of the number is ODD, the program
will display both the inputted number, the Ascii Code of the number and a message, " Ascii Value is Odd "
but if the number is even, the program will display both the inputted number, the ascii code of the inputted
number and a message, " Ascii Value is Even ". After that the program will get the sum and average of the
inputted numbers NOT the ascii value okay? :) xD The program must count how many times the user
inputted. Restriction is a MUST. :)
OUTPUT:

PREPARED BY: DARREL LAD PONTERES

0926-643-6755

The gem cannot be polished without friction, nor man perfected without trials Enter Numbers: 123456
[1]=49 Ascii Value is Odd
[2]=50 Ascii Value is Even
[3]=51 Ascii Value is Odd
[4]=52 Ascii Value is Even
[5]=53 Ascii Value is Odd
[6]=54 Ascii Value is Even
Sum is: 21
Average: 3.5
Do you want to enter again?: N
Number of times you input numbers: 1
MP3
Create a program that will display the hidden message. Restriction is a must. Every special characters has
a designated LETTERS. Restriction is a MUST! :)
'!'=A, '@'=B, '#'=C, '$'=D, '%'=E, '^'=F , '&'=G, '*'=H , '('=I , ')'=J, '-'=K, '_'=L, '+'=M, '='=N, '{'=O, '}'=P, ':'=Q,
';'=R, '|'=S, '>'=T, '<'=U, '?'=V, '/'=W, '['=X, ']'=Y, '.'=Z '~'=SPACE
OUTPUT:
Enter Message: &{$ @_%|| ]{< -%%} (> <} &{{$_<#Hidden Message=_________________________
MP4
Make a quiz program.. atleast 5 questions.. every question has 10points.. if the user choose a
wrong answer points-5.. and if the user got 50points(perfect) a bonus question will appear to get
another 50points... a total of 100points.. restriction is a must and the program will loop till the user
wants to play..(if u want to add highscore then add it :) )SAMPLE OUTPUT(SAMPLE)
Q1)Who invented flourescent lamp?
a)Agapito Flores c)Franz Maglunogb)Julius Endaya d)Christian BenipayoAnswer: A
Correct!! You have 10 points now
(sample lng ulit sa Q2Q3 pra mkta nyo ung smay pointing system :D)
Q2)Who invented flourescent lamp?
a)Agapito Flores c)Franz Maglunog
<p>b)Julius Endaya d)Christian Benipayo</p> Answer: A
Correct!! You have 20 points now
Q2)Who invented flourescent lamp?

PREPARED BY: DARREL LAD PONTERES

0926-643-6755

The gem cannot be polished without friction, nor man perfected without trials a)Agapito Flores c)Franz Maglunog
b)Julius Endaya d)Christian Benipayo
Answer: C
Sorry the correct answer is A) Agapito Flores
Your score is deducted by 5.. 15Points
goodluck :)
MP5
A. Currency Converter v1 Michelle wants to know how much her money (in Philippine peso) can
get her these days if she lived in another country. Currently, the US Dollar, the Euro, the
Japanese Yen, the British Pound and the Swiss Franc are the five major world currencies in use.
Your task is to create a program (currency.c) that converts Philippine peso to those 5 major
world currencies. Follow the screen format below. Remember, the peso amount WILL COME
FROM THE USER. DO NOT HARDCODE THIS VALUE. Assume that the input is a non-negative
value.
Note:
Use
this
website
for
exchange
rates:
http://www.exchangerates.org/MajorRates.aspx
Sample
Screen
Output:
**********CURRENCY
CONVERT**********
Please input an amount in Peso: 1.00
Converting... Done!
In US Dollars: 0.02
In Euro: 0.01
In Japanese Yen: 1.93
In British Pound: 0.01
In Swiss Franc: 0.02
Thank You

MP6
create a prigram that will display a histogram of each of the digits in given number. for
example
enter a number: 726
7 *******
2 **
6 ******
MP7
create a script that accept time in 24-hour notation(assume input is from 0 to 2359 only)
and output them in 12 hour notation.
example:
0000 12:00 a.m
0900 9:00 a.m
1200 12:00 p.m
1430 2:30 p.m
MP8
write a script that will display the given number with commas. for example
number is 12345, the script should display 12,345. note that although the given number
is always non negative, it is possible

PREPARED BY: DARREL LAD PONTERES

0926-643-6755

The gem cannot be polished without friction, nor man perfected without trials for the number to be less than 4 digits or even or even more than 6 digits.

1. Create a program that determines the network provider given an 11-digit mobile
phone number.
If the number starts with 0917 or 0916, the program displays GLOBE .
If the number starts with 0918 or 0920, the program displays SMART.
If the number starts with 0922 or 0923, the program displays SUN.
If the number starts with numbers other than those mentioned, display
Unknown provider
2. Write a program to give some information about yourself. It should produce something like
the following:
NAME: your name
MAJOR:
OTHER COMPUTER COURSE TAKEN:
OCCUPATION:
3. Write a program to find the average of the four values 4, 42, 16.7, and .0045.
Variables:
V1, v2, v3, v4
Average
Output
The four numbers are:
4 42 16.7 0.0045
The average is:
15.676126

4. Write a program that produces a bill and coin breakdown for an amount of money. Initialize
the amount in the float variable known as dollars and use the cents variable to keep track
of the amount not yet converted to bills and coins. You will have to make use of integer
arithmetic and the remainder in this program.

Variables
dollars
cents

(float)
(int)

PREPARED BY: DARREL LAD PONTERES

0926-643-6755

The gem cannot be polished without friction, nor man perfected without trials Output
The coin breakdown for 7.73 dollars is:
Dollar bills:

Fifty cents:

Twenty cents:

Ten cents:

Five cents:

One cents:

5. Write a program that accepts two numbers from the keyboard and prints the following
information.
Variables
first
second

Output
First number? 7
Second number? 2
The second number goes into first 3 times
with a remainder of 1.
The quotient is 3.5.
6. Write a program to print out a customer bill for Ajax Auto Repair. The parts and labor
charges are input and a 6 percent sales tax is charged on parts but not on labor. Your
program should display the following information.

Variables
Parts
Labor
SalesTax
Total
Output
PARTS? 104.50
LABOR? 182.15

PREPARED BY: DARREL LAD PONTERES

0926-643-6755

The gem cannot be polished without friction, nor man perfected without trials AJAX AUTO REPAIR
SERVICE INVOICE
PARTS

$104.50

LABOR

182.15

SALES TAX

6.27

TOTAL

$292.92

7. Write a program that will accept keyboard input of various coins and return the total value.

Variables
input
total

( value from keyboard)


(to accumulate the value of the inputs)

Output
Fifty cents?

Twenty cents? 1
Ten cents? 1
Five cents?

One cents?
3
Your total is: $ 1.93.

8. Write a program that accepts a number of seconds from the keyboard and converts it into
days, hours, minutes, and seconds. Use integer arithmetic and the remainder operator.
Variables
seconds
Output
How many seconds? 106478
Days: 1
Hours: 5
Minutes:
Seconds:

34
38

9. Write a program to compare two numbers with executions similar to the following.

PREPARED BY: DARREL LAD PONTERES

0926-643-6755

The gem cannot be polished without friction, nor man perfected without trials Variables
Number1, number2
Outputs
Enter two numbers 48 52.33
52.33 is greater than 48.
Outputs
Enter two numbers 88 88
They are equal.

10. Adams County (country code A) has a 7 percent sales tax rate; the rest of the state a 6
percent rate. Write a program to print out the amount owed on purchase including sales
tax, given the amount of the purchase and the county.
Variables
Purchase
County
TaxRate
Outputs
AMOUNT OF PURCHASE? 100
COUNTY? A
TOTAL BILL: 107.00
AMOUNT OF PURCHASE? 100
COUNTY? D
TOTAL BILL: 106.00

11. Write a program to assign grade points according to a letter score. An A is 4 grade points; B
is 3; C is 2; D is 1; and F is 0. Use the else if construct.
Variables
grade
grade_points

Output
Letter grade: B

PREPARED BY: DARREL LAD PONTERES

0926-643-6755

The gem cannot be polished without friction, nor man perfected without trials Grade point: 3
Letter grade: D
Grade point: 1

12. Write a program to assign a letter grade given a numeric score: 90 or above is an a; 80, B;
70, C; 60, D; and below 60, F. The program should continue to accept until a negative
number is input. The program should continue to accept values until a negative number is
input. The program should print how many of each letter grade was assigned after the
input is completed. Use else if construct in construct in your program. (restriction is a must)

Variables
score

(score input)

a_s, b_s, c_s, d_s, f_s

(counters for letter grades)

Output
SCORE? 92
THE GRADE IS A
:
SCORE? 1
1

As

Bs

Cs

Ds

13. Write a program to create a multiplication table for all combinations of two numbers from 1
to 8.

Variables
Multiplier
Multiplicand

PREPARED BY: DARREL LAD PONTERES

0926-643-6755

The gem cannot be polished without friction, nor man perfected without trials -

Output

10

12

14

16

12

15

18

21

24

12

16

20

24

28

32

10

15

20

25

30

35

40

12

18

24

30

36

42

48

14

21

28

35

42

49

56

16

24

32

40

48

56

64

Display the total sum of diagonal values

Display the total sum of even numbers

Display the total sum of odd numbers

PREPARED BY: DARREL LAD PONTERES

0926-643-6755

The gem cannot be polished without friction, nor man perfected without trials 13. Write a program to produce the following output. Use nested for loops.

Output

A
A

14. Write a scissors-rock-paper game, commonly known as jack n poy.


two players will input the first equivalent letter. For example S for scissor, R for rock, and P
for paper.
Then

display

the

winner

and

the

basis

of

winning

such

as

paper covers rock, rock beats scissor, and scissor cut paper, or nobody wins. Capital or
small letter should be accepted by your program. (this program must loop)

PREPARED BY: DARREL LAD PONTERES

0926-643-6755

The gem cannot be polished without friction, nor man perfected without trials 15. Write a program which produces the given sequences nos(in alternate arrangement) using
the

three

looping

statements.

1,5,2,4,3,3,4,2,5,1

16. Write a function printpattern that take in two value parameters chartype of character type and
row of type integer. For example if chartype is an "*" and row = 4 then the output becomes
****
***
**
*

PREPARED BY: DARREL LAD PONTERES

0926-643-6755

The gem cannot be polished without friction, nor man perfected without trials -

HORROR MP
Ang Terminal ng mga Van sa Alabang Town Center
The life of the passenger vans and the commuters can be described via these four
major functionalities:
[1]
[2]
[3]
[4]

Van arrives
Passenger arrives
Passenger boards van
Van leaves

Each van has the following properties: Plate Number, Driver, Passenger Limit
Let letters represent passenger vans and numbers represent passengers.
Flow of van and passengers is as follows:
If event 1 happens, then a van arrives at the terminal, starting with label A. There
can only be one passenger van at the terminal at a time. Hence, if event 1
happens while there is still a van at the terminal, a message saying Terminal is
full should be displayed. The next van that arrives at the terminal should be
labeled as B and so on.
If event 2 happens, a passenger arrives at the terminal, starting with label 1. If
there is a van at the terminal, then the passenger boards the van automatically
(event 3). Otherwise, the passenger waits in a queue. Once a van arrives, the
passengers in the queue will automatically load the van.
A van automatically leaves the terminal (event 4) if the number of passengers
who have boarded is equal to the passenger limit of the van.
The following information must be displayed at all times: current van label and
passenger list.
(restriction is a must)

PREPARED BY: DARREL LAD PONTERES

0926-643-6755

Potrebbero piacerti anche