|
 |
|
 |
06-24-2005, 01:39 PM
|
#1 (permalink)
|
|
Registered User
Join Date: Dec 2004
Posts: 43
|
Will someone give some simple c++ tests?
I'm not good with making programs up, though I should, I'll have to work on that later. But can someone make up a couple simple programs that I must figure out how to code? Don't write the code but let me figure out how to make it. Thanx .
|
|
|
06-24-2005, 11:40 PM
|
#2 (permalink)
|
|
[code][/code] enforcer
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
|
Make me a simple bubblesort program. Then implement it in such a way so the client programmer can choose whether he wants to sort by ascending order or sort by descending order.
- Forward the results to standard iostream.
- Initialize a std::string array.
- Let the sorter sort arrays.
- Don't implement anything that has nothing to do with this assignment. No menu's etc.
- Use descriptive names.
- Implement app in your namespace, e.g.
Code:
namespace slashdot
{
}
__________________
|
|
|
06-27-2005, 04:17 PM
|
#3 (permalink)
|
|
Registered User
Join Date: Jun 2005
Posts: 3
|
Reverse Polish Notation is a way of writing mathematical notation in which the operators go after the arguments, which does not require parentheses. For example, 3 5 + simplifies to 8, and 4 7 * simplifies to 28. If you write 1 2 3 + +, first the 2 3 + simplifies to 5, then 1 5 + simplifies to 6. The quadratic formula, normally written (-b + sqrt(b*b - 4*a*c)) / (2 * a), would be written as
b b * a c * 4 * - sqrt b - 2 a * /
RPN calculators use a stack to evaluate their expressions, and a basic four-function RPN calculator can be written in one line of Perl. Write one in C++. Search on the Web for more information.
I first read this recommendation in a response to an Ask Slashdot question, by the way :-)
|
|
|
06-27-2005, 10:06 PM
|
#4 (permalink)
|
|
[code][/code] enforcer
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
|
No, I gave slashdot this task for a good reason. It is *exactly* the same task I give profesional junior coders. From there we'll build up something. The whole purpose is to see what design is all about. My assignment is the first step out of a few.
__________________
|
|
|
07-10-2005, 12:48 PM
|
#5 (permalink)
|
|
Registered User
Join Date: Dec 2004
Posts: 43
|
thats too advance for me. Maybe a simple game or something would do better. But if you give me a good reason why I should go ahead and try to make your program tell me, and I'll be on my way.
|
|
|
07-10-2005, 01:46 PM
|
#6 (permalink)
|
|
[code][/code] enforcer
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
|
Do you know how to make basic classes?
__________________
|
|
|
07-18-2005, 10:41 AM
|
#7 (permalink)
|
|
Registered User
Join Date: Dec 2004
Posts: 43
|
Actual Val (is Val alright?) I don't think I know how to make classes. I have only been read somewhere around 120 pages in C++ for dummies and a couple sources online. So ya, I'm not pro C++ haxer yet. Maybe a simpler test. I'm not sure what to tell you other then I've only goten up to pointer variables.
|
|
|
07-19-2005, 02:36 AM
|
#8 (permalink)
|
|
[code][/code] enforcer
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
|
Make code that removes the first encountered substring from a C-style string.
I want you to explain every line of code. You need to prove you'understand char* handling.
Like this:
char* theString = "Life is hard, then you die.";
remove_substring(theString, "hard");
//theString = "Life is, then you die."
__________________
|
|
|
07-22-2005, 06:12 AM
|
#9 (permalink)
|
|
Registered User
Join Date: Dec 2004
Posts: 43
|
Ok sry if I am complaining to much, but those seem to hard for me. Heres what I have read so far...
Initializing variables, boolean statements, functions, loops, pointers, pointer variables (I think), and now I'm am reading on classes. There may be a couple more I am missing, but I am sure it can be filled in easily.
|
|
|
07-22-2005, 06:59 AM
|
#10 (permalink)
|
|
Java fanboy
Join Date: Aug 2003
Posts: 1,161
|
That second example is really pretty simple - you should be able to do it with only the programing elements you said you've covered.
|
|
|
07-23-2005, 09:42 AM
|
#11 (permalink)
|
|
[code][/code] enforcer
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
|
Quote:
|
Originally Posted by slashdot
Ok sry if I am complaining to much, but those seem to hard for me. Heres what I have read so far...
Initializing variables, boolean statements, functions, loops, pointers, pointer variables (I think), and now I'm am reading on classes. There may be a couple more I am missing, but I am sure it can be filled in easily.
|
Learn the ways of:
strcat, strcpy, strncpy, strncat
I do this for a purpose you know. If you don't know about functions then no problem whatsoever. Just make everything work in main().
__________________
|
|
|
07-23-2005, 11:54 AM
|
#12 (permalink)
|
|
Registered User
Join Date: Dec 2004
Posts: 43
|
Hey you know what I just got past those in my book the other day. I'll take a crack at your quiz alright? I'll be back with it in a day or a day and half.. thanx for taking some time to make a quiz for me!
|
|
|
08-04-2005, 01:25 PM
|
#13 (permalink)
|
|
mike
Join Date: Jan 2005
Location: Ottawa, ON
Posts: 79
|
Quote:
|
Originally Posted by Rashakil Fol
Reverse Polish Notation is a way of writing mathematical notation in which the operators go after the arguments, which does not require parentheses. For example, 3 5 + simplifies to 8, and 4 7 * simplifies to 28. If you write 1 2 3 + +, first the 2 3 + simplifies to 5, then 1 5 + simplifies to 6. The quadratic formula, normally written (-b + sqrt(b*b - 4*a*c)) / (2 * a), would be written as
b b * a c * 4 * - sqrt b - 2 a * /
RPN calculators use a stack to evaluate their expressions, and a basic four-function RPN calculator can be written in one line of Perl. Write one in C++. Search on the Web for more information.
I first read this recommendation in a response to an Ask Slashdot question, by the way :-)
|
If you want the answer just open chapter 4 of "The C Programming Language"
Also if he's new to programming thats probably way over his head.
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -8. The time now is 11:59 PM.
|
Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
|
 |
|