Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Imagine, that you work for Facebook and you are to write a program that will estimate emotional state of some user. The only information you have about the user is the latest message he posted (a message is just some string). You know that people use smileys (for example, :-) or :-( ) a lot in their communications and you have the following idea: you want to count how many open and closed parentheses does the message contain and then if there are more open parentheses '(', then the person is sad
and if the message contains more closed parentheses ')', then the user is happy. But unfortunately, not all messages have enough parentheses to make a conclusion which will be trustworthy. If the message has less than 5 parentheses (total), you cannot make a good conclusion on user's mood.
So, to implement this idea you need to write a Java program, that asks user to enter a message (a message is just a string, one line of text that can contain spaces). Then your program should count how many open '(' and closed ')' parentheses does the message contain. If the total number of parentheses (open and closed together) is less than 5, then you need to print back the message "User's mood cannot be determined.", otherwise if the message contains more open parentheses '(' you need to print back the message "The user is sad.", if there are more closed parentheses ')' you need to print a message "The user is happy.", and _nally if you have the same number of open and closed parentheses you need to print "The user is calm."

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91226453
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Can someone help me with traceroute of massachusettsnbspuse

Can someone help me with traceroute of massachusetts  Use traceroute to trace the route from your home or work computer to your university's website. Show the traceroute output. What networks were encountered along the w ...

Describe the structure of an inverted index in information

Describe the structure of an inverted index in Information retrieval?

On a single diagram illustrate the following using the uml

On a single diagram, illustrate the following using the UML notation for objects, links and messages. (a) An object of class Window, with no attributes shown; (b) An object of class Rectangle with attributes length and w ...

The system development team at the xyz company is working

The system development team at the XYZ Company is working on developing a new customer order entry system. In the process of designing the new system, the team has identified the following data entity attributes: Invento ...

Please do it in c programrevisit the matrix addition

Please do it in C program Revisit the matrix addition function Write the program so that it would not need to take a third pointer for the result matrix Instead, have the function return a pointer to the results matrix P ...

The data reflects student enrollment at a college in

The data reflects student enrollment at a college in Southern California. Traditional math pathwayAccelerated math pathwayRow totalsFemale12441161360Male1054541108Column totals22981702468 We want to determine if the prob ...

Question provide a real-world example or describe a

Question: Provide a real-world example or describe a hypothetical situation in which a legitimate organization used spam in an effective and nonintrusive manner to promote a product or service. Need 300-350 words APA sta ...

Once considered pure science fiction artificial

Once considered pure science fiction, artificial intelligence (AI) is being relied on more and more in today's world. Artificial intelligence deals with algorithms based on complex data sets. If you had to tell story rep ...

Qestion what is your understanding of the term computer

Question: What is your understanding of the term "computer"? Why do we call it computer? Is that what it does? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow the APA ...

The following few machines are given informal

The following few machines are given informal descriptions. Decide whether they are of CISC or of RISC design, and provide a short description of why. a) Machine A has over 300 instructions, many of which are executed at ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As