Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

CC 103

Prelim Project

Rona Jean R. Paloma


BSIT-1B

1. Write a program that will input for a text and will replace :) with
smiley emoticon.

Sample Output:

Answer:
message = input(“Enter Message: “)
emoji = message.replace(“:)”, “🙂”)
print(emoji)
message = input( “Enter Message: “)
smiley = message.replace(“:)”, “🙂”)
print(smiley)

2. Write a program that will input for an amount (including the currency)
and discount (in percentage). The program will then compute for the
discount.
CC 103
Prelim Project

Sample Output:
Enter Price: $100
Percentage (Discount): 1%
Discount: $1.00

Answer:
string = input (“Enter Price: “)
price = float ( string[1:])
disc_percent= input (“Percentage (Discount): “)
disc = float (disc_percent[:-1])
disc_amount = price * (disc/100)
print (“Discount: “,”${:2f}”.format(disc_amount))

You might also like