CS508 Modern Programming Languages Assignment No 02 Spring 2021 Solution / Discussion
Share the Assignment Questions & Discuss Here....
Stay touched with this discussion, Solution idea will be uploaded as soon as possible in replies here before the due date.
Jin logo nay mil kar quiz karana ha wo CS508 ka wo mujy PM kar day kindly
hona ha add
In English language, there are twenty-six alphabets. Which are further divided into five vowels (a, e, i, o, u) and twenty-one consonants (remaining alphabets).
You are required to write a program in SNOBOL4 which will count the total number of vowels and consonants in a string.
For example, if input string is
A quick brown fox jumps over the lazy dog.
Then your program must print on console,
Found 11 vowels: A u i o o u o e e a o
Found 22 consonants: q c k b r w n f x j m p s v r t h l z y d g
However, in case, there is no vowel or consonant in the input string then following message should be displayed.
Found no vowel. or Found no consonant.
It is required to make sure that the program should count for both small and capital characters. For example, the program must count 6 vowels and 11 consonants for string "THIS is a SAMPLE text". Furthermore, spaces and punctuation marks (! . , ; : ? etc.) should not be counted.
For compilation purpose, you can consult any online compiler, like
Vowels and Consonants:
a, e, i, o, u
b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, z
Fig. Sample Output
Assignment File, Please provide Idea Solution.
i need Idea Solution of assignment #2 cs508 and cs411
Any Idea Solution? Just 2 Days Remaining!
STRING = INPUT
OUTPUT = "INPUT STRING: " STRING
P1 = ( 'A' | 'I' | 'O' | 'U' | 'E' | 'a' | 'i' | 'e' | 'o' | 'u' ) . V
P2 = ( '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' | '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' ) . c
S1 = ''
S2 = ''
C1 = 0
C2 = 0
L1 STRING P1 = :F(L2)
S1 = S1 ' ' V
C1 = C1 + 1 :S(L1)
L2 STRING P2 = :F(L3)
S2 = S2 ' ' C
C2 = C2 + 1 :S(L1)
L3 OUTPUT = ' FOUND ' C1 ' VOWELS ' S1
OUTPUT = ' FOUND ' C1 ' CONS ' S2