473,386 Members | 1,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

C++ puzzle

Write a program that allows users type in an emoticon and displays the
description of the emoticon on the screen. For example, using the
table above, if the user enters :C your program should display "Very
Sad Smiley" on the screen.
The program should allow the user enter as many emoticons as they wish
(one at a time, of course). The user will indicate that they want to
finish by entering "-_-" (i.e. the ‘bored' emoticon).
You can decide which emoticons will be supported by your program.
However, if an emoticon entered by a user is not one of the entries in
your list you should provide a mechanism to allow the user add it to
the list if they want to. To add an entry the user must provide the
emoticon and a description.
You should allow for up to 150 entries in the list. Assume the
emoticon can be up to 10 characters long and the descriptions up to 50
characters long. It would be helpful if your solution allowed these
values (i.e. 150, 10, 50) to be altered easily.
Jul 19 '05 #1
5 6541
"Jason" <ja*********@yahoo.com> wrote...
Write a program that [...]


Do your own homework.
Jul 19 '05 #2
On Mon, 17 Nov 2003 06:55:00 -0800, Jason wrote:
Write a program that allows users type in an emoticon and displays the
description of the emoticon on the screen. For example, using the
table above, if the user enters :C your program should display "Very
Sad Smiley" on the screen.
The program should allow the user enter as many emoticons as they wish
(one at a time, of course). The user will indicate that they want to
finish by entering "-_-" (i.e. the ‘bored' emoticon).
You can decide which emoticons will be supported by your program.
However, if an emoticon entered by a user is not one of the entries in
your list you should provide a mechanism to allow the user add it to
the list if they want to. To add an entry the user must provide the
emoticon and a description.
You should allow for up to 150 entries in the list. Assume the
emoticon can be up to 10 characters long and the descriptions up to 50
characters long. It would be helpful if your solution allowed these
values (i.e. 150, 10, 50) to be altered easily.


Homework hints:

Make a struct cointaining to strings, one for emoticons and one for the
corresponding description.

For extra credit use std::string

Make a list of the structs. For extra credit use a vector instead of an
array of length 150.

Read input. Search the list if you find the emoticon output the result if
not ask for a description and make a new entry in the list.

For extra credit make the program store the list in a file and read it
when starting.

--
NPV

"the large print giveth, and the small print taketh away"
Tom Waits - Step right up

Jul 19 '05 #3

"Jason" <ja*********@yahoo.com> wrote in message
news:b3**************************@posting.google.c om...
Write a program that allows users type in an emoticon and displays the
description of the emoticon on the screen.


Yes, I obeyed your orders Sir! What else can I do to please you?

How darn stupid do you take us for that we do your homework. Posting just
the assignment without any comment of yourself or some code where you tried
and probably failed might be considered even beyond rudeness!

Chris
Jul 19 '05 #4
On Mon, 17 Nov 2003 17:31:56 +0000, Jon Bell wrote:
For extra credit use a map instead of an array or vector, to make the
searching trivial. ;-)


Pity that threads and GUI libraries are offtopic, we could have mad him
have a nice pointy clicky interface on the thing, and images for the
smilys. Or perhaps he should use a database backend for efficient
searching from multiple clients one the list grows to a few thousand
elements?

--
NPV

"the large print giveth, and the small print taketh away"
Tom Waits - Step right up

Jul 22 '05 #5
"Chris Theis" <Ch*************@nospam.cern.ch> wrote in message news:<bp**********@sunnews.cern.ch>...
"Jason" <ja*********@yahoo.com> wrote in message
news:b3**************************@posting.google.c om...
Write a program that allows users type in an emoticon and displays the
description of the emoticon on the screen.
Yes, I obeyed your orders Sir! What else can I do to please you?

How darn stupid do you take us for that we do your homework. Posting just
the assignment without any comment of yourself or some code where you tried
and probably failed might be considered even beyond rudeness!


Pipe down. If you don't wanna do it, don't. If you do, do.

Chris

Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Developwebsites | last post by:
Hi all, I've made a sliding puzzle game in shockwave which works just fine, except I dont know how to have it solve itself. the URL is: http://members.aol.com/rglukov/games/selfsolve.htm ...
42
by: Frank Buss | last post by:
I've setup a challenge, mainly for C++, Java and Lisp, but every other language is welcome: http://www.frank-buss.de/challenge/index.html There is nothing to win, but I hope there will be some...
1
by: xavier vazquez | last post by:
I have a problem with a program that does not working properly...when the program run is suppose to generate a cross word puzzle , when the outcome show the letter of the words overlap one intop of...
0
by: xavier vazquez | last post by:
have a problem with a program that does not working properly...when the program run is suppose to generate a cross word puzzle , when the outcome show the letter of the words overlap one intop of the...
5
by: ashish0799 | last post by:
HI I M ASHISH I WANT ALGORYTHMUS OF THIS PROBLEM Jigsaw puzzles. You would have solved many in your childhood and many people still like it in their old ages also. Now what you have got to do...
3
by: oncue01 | last post by:
Word Puzzle Task You are going to search M words in an N × N puzzle. The words may have been placed in one of the four directions as from (i) left to right (E), (ii) right to left (W), (iii) up...
6
by: Phoe6 | last post by:
Hi All, I would like to request a code and design review of one of my program. n-puzzle.py http://sarovar.org/snippet/detail.php?type=snippet&id=83 Its a N-puzzle problem solver ( Wikipedia page...
2
by: Gio | last post by:
I'm getting K&R (it's on the way), should I also get the Answer Book? And while I'm there, should I get the Puzzle Book? Or should I save the Puzzle Book for when I'm more advanced? - Gio ...
4
by: honey777 | last post by:
Problem: 15 Puzzle This is a common puzzle with a 4x4 playing space with 15 tiles, numbered 1 through 15. One "spot" is always left blank. Here is an example of the puzzle: The goal is to...
5
by: dmf1207 | last post by:
Hi All! I'm new to javascript and need a little help with a simple puzzle im trying to design. I have a 600x100 pixel picture that I have sliced into 6 100x100 rectangles making a table of of 6...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.