1. Create a perl program. Use a hash to store all Province Code and Province Name of Canada. Then print them.
Output should be as shown below:
PE-Prince Edward Island
BC-British Columbia
NB-New Brunswick
ON-Ontario
QC-Quebec
MB-Manitoba
NS-Nova Scotia
BC-British Columbia
NB-New Brunswick
ON-Ontario
QC-Quebec
MB-Manitoba
NS-Nova Scotia
2. Create a perl program that use a hash to store all Week day code and Week day. Then print them. Output should be as shown below:
M - Monday
T - Tuesday
W - Wednesday
H - Thursday
F - Friday
S - Saturday
U - Sunday
3. Write a program that simulates rolling five dice. Assign values between 1 and 6 to five different variables and display all five on the screen as well as the sum of the five numbers. Output should be as shown below.
Die 1 -- 5
Die 2 -- 3
Die 3 -- 1
Die 4 -- 1
Die 5 -- 6
Sum is 16.
Comments
Post a Comment