r/visualbasic • VB Guru • May 04 '15

Discuss Homework questions /r/visualbasic and you.

We don't have problems answering specific questions about school work here are r/visualbasic. Hell we encourage it. What I would like to see is the full problem spelled out for me instead of just a partial question. I would also like to see what school and class this is from. I dont care if its highschool, university, online course whatever. I want to get an idea where this stuff is coming from so that I can get an idea of quality of classes and assignments.

Please place homework questions in separate threads not here.

B

13 Upvotes

5 comments sorted by

View all comments

1

u/PhotonShock May 31 '15

Problem: We often include emoticons in our text messages to indicate how we are feeling. The three consecutive characters :-) indicate a happy face and the three consecutive characters :-( indicate a sad face. Write a program to determine the overall mood of a message. Input Specification There will be on input text box that can contain between 1 and 255 characters. Output Specification The output is determined by the following rules:  If the input line does not contain any happy or sad emoticons, output none.  Otherwise, if the input line contains an equal number of happy and sad emoticons, output unsure.  Otherwise, if the input line contains more happy than sad emoticons, output happy.  Otherwise, if the input line contains more sad than happy emoticons, output sad. Sample Input 1 How are you :-) doing :-( today :-)? Output for Sample Input 1 Happy Sample Input 2 :) Output for Sample Input 2 None Sample Input 3 This :-( is str:-(:-(ange te:-)xt. Output for sample Input 3 sad

I would just like to know the coding to count the number of times a specific text appears. This is from a high school culminating task and this problem was originally from a competition.