Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

CS508 Assignment No 02 Fall 2020 Solution / Discussion Due Date: 14-12-2020

Problem Statement:

Punctuation is the system of signs or symbols, given to a reader to show how a sentence is constructed and how it should be read and makes the meaning clear.


You are required to write a program in SNOBOL4 which will count the total number of punctuation characters in a string.  


  • At start, take a string as input from user.
  • Print that string on top of the console screen.
  • Design a pattern which should contain punctuation marks as given below.
  • Create a loop using 'go to field', which will match characters of string with pattern.
  • If any character in string is matched and not repeated then store it in a variable by using concatenation, increment the counter by 1, and move to the next character.
  • At end, simply print the counter and stored characters on console with appropriate message.

For example, if input string is            

Good Morning! Mr. ABC, have your breakfast?

Then your program must print on console,   

Found 4 punctuation marks (i.e. ! . , ?) in the given string.

However, in case, there is no punctuation mark in the input string then following message should be displayed.

Found no punctuation mark in the given string.



It is required to make sure that the program should count only one for same punctuation marks if repeated twice or more. For example, the program must count 4 punctuation marks for string "Yesterday, rain-fog; today, frost-mist. But how fascinating each."


For compilation purpose, you can use any online compiler, like



Punctuation Marks:


Punctuation Mark


Punctuation Mark





Quotation Mark


Left Parentheses




Right Parentheses








Question Mark




Exclamation Mark



Sample Output:

Views: 2274

Replies to This Discussion

#cs508assignment2solutionfall2020 #cs508assignmentsolution2020
CS508 Assignment 2 Solution Fall 2020 | CS508 Assignment Solution 2020

CS508 Assignment No 2 Solution Fall 2020


Looking For Something? Search Below

Top Trends 

Latest Activity

Hania Khalid Shariff is now a member of Virtual University of Pakistan
4 hours ago
saba zulfqar and Mr Siren Head are now friends
7 hours ago
Zeeshan Riaz left a comment for Saima
14 hours ago
Profile IconShehzad Ali, Sehar and Saima joined Virtual University of Pakistan
Mr Siren Head replied to Mani Siddiqui's discussion مشکل پاسورڈ
Mr Siren Head replied to Mani Siddiqui's discussion مشکل پاسورڈ
+ I A commented on + M.Tariq Malik's page Chit Chat Wall
Mr Siren Head commented on + M.Tariq Malik's page Chit Chat Wall

VIP Member Badge & Others

How to Get This Badge at Your Profile DP


Management: Admins ::: Moderators

Other Awards Badges List Moderators Group

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service