Continuing with Strings
We are now going to start working with strings.
There are a couple of different nuances with strings that we need to learn about.
There are a couple of different nuances with strings that we need to learn about.
Scenario
A pangram is a sentence that uses every letter of the alphabet at least once.
The most popular English pangram is "The quick brown fox jumps over the lazy dog."
It contains 35 letters and each letter is used at least once.
Write code to check whether a given string is a pangram or not.
Try to write the shortest code possible. You can use the string class and arrays.
Remember not to count spaces and other special characters.
At the end of this program you should print how many times each letter has been used.
The most popular English pangram is "The quick brown fox jumps over the lazy dog."
It contains 35 letters and each letter is used at least once.
Write code to check whether a given string is a pangram or not.
Try to write the shortest code possible. You can use the string class and arrays.
Remember not to count spaces and other special characters.
At the end of this program you should print how many times each letter has been used.
Sample Output
Example input
The quick brown fox jumps over the lazy dog
Example output
Pangram
a-1
b-1
c-1
d-1
e-3
f-1
g-1
h-2
i-1
j-1
k-1
l-1
m-1
n-1
o-4
p-1
q-1
r-2
s-1
t-2
u-2
w-1
v-1
x-1
y-1
z-1
Example input
quick brown fox jumps over lazy dog
Example output
Not pangram
a-1
b-1
c-1
d-1
e-1
f-1
g-1
h-0
i-1
j-1
k-1
l-1
m-1
n-1
o-4
p-1
q-1
r-2
s-1
t-0
u-2
w-1
v-1
x-1
y-1
z-1
The quick brown fox jumps over the lazy dog
Example output
Pangram
a-1
b-1
c-1
d-1
e-3
f-1
g-1
h-2
i-1
j-1
k-1
l-1
m-1
n-1
o-4
p-1
q-1
r-2
s-1
t-2
u-2
w-1
v-1
x-1
y-1
z-1
Example input
quick brown fox jumps over lazy dog
Example output
Not pangram
a-1
b-1
c-1
d-1
e-1
f-1
g-1
h-0
i-1
j-1
k-1
l-1
m-1
n-1
o-4
p-1
q-1
r-2
s-1
t-0
u-2
w-1
v-1
x-1
y-1
z-1