TranceAddict Forums

TranceAddict Forums (www.tranceaddict.com/forums)
- Chill Out Room
-- Calling all C++ nerds :)
Pages (2): [1] 2 »


Posted by PSi on Oct-12-2001 21:12:

Exclamation Calling all C++ nerds :)

Guys plz help me out with this lab...i need help desperately because i have a low brain cell count so please HELP


This lab is a matter of life and death for me!!!!!


http://www2.mtroyal.ab.ca/~cjefferi...ssign/lab_3.htm


Posted by Eugene on Oct-12-2001 21:21:

I refuse to help you because you just called me a "nerd"


Posted by Fraggle on Oct-13-2001 04:20:

hmm...well i flunked c++!!!

heheehhe


anyway...prolly some &^%$%# recursive solution will do it very simply


Posted by SmackdowN on Oct-13-2001 07:13:


"I'll be back"


Posted by hypronix on Oct-13-2001 07:22:

dude, I think I can help U with part A, I mean it is pretty easy. but I don't understand everything the lab asks for, I can write a program that does the shit (to make the two means)
the thing is that I have an example version of C++ (Borland C++ Lite) so U wouldn't be able to use the .exe file.
plus, a lil C++ practice wouldn't kill... tell me if U want me to start working on it (but I can start it on Monday only)


Posted by Tranzmit on Oct-14-2001 01:11:

I know everything about pc's (I'm a technician) but nothing about programming, sorry. I never could be bothered with it as it wasn't my interest, i was always fascinated by CPU archtecture and chipset design and 3D API's and GPU's instead LOL!!!

Sorry about that!


Posted by trancaholic on Oct-14-2001 02:42:

Please don't take this the wrong way, but...
The problem seem rather trivial. If you have a working compiler environment I can't see how you can fail at this. If, however, you have no knowledge of how to do simple arithmetics such as sqrt(int), and you're already giving up at this challenge, then you're probably in the wrong class, and further pursuit of this career will result in frustration and inferiority-problems.
You're entitled to deem me a stupid prejudist, but judging from the difficulty level of this problem, I guess you're at your first year of programming experience and if you think this is an overwhelming problem there's other aspects of computer science that might appeal more to you.

Though, if you have other reasons for solving this problem, than passing some programming-course, I'll be more than happy to help you out, but if this is your motive, you really ought to solve it yourself.


Posted by phasedout on Oct-14-2001 23:19:

for the first part of inputing the numbers into an array, i would use a do while

do {
blahblahblah
}while(x!=999);

but of course there are a whole set of different ways to go about that first part


Posted by jzmhed1 on Oct-15-2001 05:39:

quote:
Originally posted by trancaholic
Please don't take this the wrong way, but...
The problem seem rather trivial. If you have a working compiler environment I can't see how you can fail at this. If, however, you have no knowledge of how to do simple arithmetics such as sqrt(int), and you're already giving up at this challenge, then you're probably in the wrong class, and further pursuit of this career will result in frustration and inferiority-problems.
You're entitled to deem me a stupid prejudist, but judging from the difficulty level of this problem, I guess you're at your first year of programming experience and if you think this is an overwhelming problem there's other aspects of computer science that might appeal more to you.

Though, if you have other reasons for solving this problem, than passing some programming-course, I'll be more than happy to help you out, but if this is your motive, you really ought to solve it yourself.


dont listen to this guy, djpsi. i bombed c++ the first time i took it with a D. then i took it at a community college and got an A+. the moral of the story: It's all about how good the teacher is.

anyway, here you go. learn from it, godammit.

#include
#include
#include

int main()
{
int n = 0;
double x;
double h = 0;
double hsum = 0;
double gmean;
double hmean;
double sum = 0;

while(x!=999){
// if ( x==999)
// break;
cout << "Enter a number ( 999 to end )\n";
cin >> x;
sum+= x;

h = 1.0 / x;
hsum+= h;

if( x != 999)
n++;

}
gmean = pow( sum - 999, 1.0/n );
hmean = n / hsum;

cout << "The geometric mean is " << setprecision(2)
<< setiosflags( ios::fixed | ios::showpoint ) << gmean << endl;
cout << "The harmonic mean is " << setprecision(2)
<< setiosflags( ios::fixed | ios::showpoint ) << hmean << endl;


Posted by Coup on Oct-15-2001 06:10:

*head explodes*


Posted by trancaholic on Oct-15-2001 08:20:

quote:
Originally posted by jzmhed1


dont listen to this guy, djpsi. i bombed c++ the first time i took it with a D. then i took it at a community college and got an A+. the moral of the story: It's all about how good the teacher is.

anyway, here you go. learn from it, godammit.

Source here...



IMO the gain from being handed full solutions is no match for putting things together for yourself from small examples in your textbook/teaching material. It's like peeing your pants when it's freezing: It will provide you with warmth for a while, but suddenly it will make you more cold than before. Again IMO.


Posted by Cru54d3r on Oct-15-2001 11:46:

quote:
It's like peeing your pants when it's freezing: It will provide you with warmth for a while, but suddenly it will make you more cold than before. Again IMO.

HAhah! Nice1

Crusader


Posted by PSi on Oct-15-2001 16:03:

Thumbs up

You guys are awesome...i love this forum !!!!!


thnx ppl for everthing

Peace Psi


Posted by phasedout on Oct-16-2001 00:38:

nice code jzmhead, while on subject, does anyone here have a Power Macintosh compiler?
I have code written on a PC, compiled using borland c++ and visual c++, but there are only 2 PCs in the lab and they are sorry 486's loaded with ONLY dos, all the rest of the computers there are those new g3 macs and stuff.
also if i post my code up here, can some one help me make it shorter...because its kinda long for a simple program.


Posted by hypronix on Oct-16-2001 00:56:

nice code...
personally I would have used a vector (if U call it like this.. U know, v[1], v[2]..) and about the sums and geometric means... even if U use float or double or whatever, the code might fail at some numbers...

anyway, great job jzmhed1, neat and clean code!


Posted by jzmhed1 on Oct-16-2001 03:37:

quote:
Originally posted by trancaholic


IMO the gain from being handed full solutions is no match for putting things together for yourself from small examples in your textbook/teaching material. It's like peeing your pants when it's freezing: It will provide you with warmth for a while, but suddenly it will make you more cold than before. Again IMO.


i couldnt agree with you more, trancaholic. youre absolutely right. but he said it was a matter of life and death, and who am i to let him die?? plus, if he chooses to copy the code and not learn anything from it, he'll learn his lesson soon enough, know wha im sayin?


quote:
Originally posted by hypronix

nice code...
personally I would have used a vector (if U call it like this.. U know, v[1], v[2]..) and about the sums and geometric means... even if U use float or double or whatever, the code might fail at some numbers...

anyway, great job jzmhed1, neat and clean code!


yeah, i would have used vectors too, except that i don't know how far along the class is in the book and since it's still early in the semester, i doubt that they're at that point yet. Dont want djpsi's teacher to get all suspicious or nuthin.


Posted by sothis on Oct-16-2001 04:17:

seriously, what is the point in taking this class if you are just going to copy someone else's code and learn zero?

the very first time i took a class on c++ and got through it for that reason, i didnt learn shit. i had to retake the class, because the next one overwhelmed me. programming is not exactly something you can fake your way through the whole time.

i would have rather seen people give ideas with pseudocode, etc.. than spelling it all out (with EXACT code)... because now this person will learn zero. again. why take a class if thats all you are going to get out of it? and why would fellow people in the computer industry support that kind of "learning", knowing how hard it is?


Posted by Coup on Oct-16-2001 13:00:

well i agree with some people but i cant remember the names and the computers are too slow at school to find them again! lol! well if it is a matter of life and death then yeah, help with the answers but if u just copy and paste them into ur work then fool you, looks good getting 10/10 all thro the course getting others to do it, but when u get 2/10 on the exam and have wasted a year then ur a tosser! lol! IMO if it really is urgent to save ur ass then yeah, ask for help but try and understand the answer just put in front of you, but stick at shit right until u do have to ask and if u have to ask on everything then maybe ur on the wrong course. basically i agree with tranceaholic, being bailed out once is ok i guess, but as long as uve learnt from the answers given then its a worth while thing.


Posted by FoXford on Oct-16-2001 14:31:

holy crap..ive looked in2 vb and c++ before but it just scares me ...i cant understand how u can get it 2 do exactly ehat u want..how do u no what 2 type in?its not like the computer understands english so its like learning another language just 2 tell a computer what 2 do..v.scary:S......its very good of u ppl 2 help this guy out like this..ive just started a course on vb in a college in leicester..its ok atm but if like some of u r calling that stuff psi had problems with easy then.....*as coup wsaid *head explodes*


Posted by hypronix on Oct-16-2001 21:48:

quote:
Originally posted by jzmhed1
yeah, i would have used vectors too, except that i don't know how far along the class is in the book and since it's still early in the semester, i doubt that they're at that point yet. Dont want djpsi's teacher to get all suspicious or nuthin.


yeah, that's true also. especially if this is his first year.
again, I have to ask the same question as the others, why did you djpsi take this course? I mean programming is not that easy (hell, it's not easy at all, and if U don't like it..) wasn't there anything else easier? like textiles or... (jokin'... my gf was forced to take textiles, but not in university, in high...)

but if U want to learn, tell me how much time did U spend workin' your brain on the problem before posting it here. if the total amount doesn't exceed AT LEAST 24 hours... then U didn't exactly gave it much thought (i remember my starting days, this program doesn't require 24 hours of work)


Posted by Fraggle on Oct-22-2001 15:16:

wow!!!

yeah, nice solution

good to see not all people are as stupid as myself !!!


Posted by Havesomefun on Oct-23-2001 16:52:

uhhh think you could help me with this one?
im trying to find some way of making a scheduled task that opens winamp(got that part) plays my playlist(that too) but i need some program that changes the volume. Someone told me the command is WaveOutSetVolume ... anyone think they could get me small app that will set the volume?
i dont know the language yet so its a little...impossible for me to make it


Posted by hypronix on Oct-23-2001 21:06:

quote:
Originally posted by Havesomefun
uhhh think you could help me with this one?
im trying to find some way of making a scheduled task that opens winamp(got that part) plays my playlist(that too) but i need some program that changes the volume. Someone told me the command is WaveOutSetVolume ... anyone think they could get me small app that will set the volume?
i dont know the language yet so its a little...impossible for me to make it


what R U using for this? c++?
I wish I could help, but didn't learned that far yet.. I mean I'm learning on my own, so I relly take my time on stuff, to get it right. it's kinda hard, maybe, but then... I don't have any courses in high I could take to help me, so I have to be satisfied with this for now. 2 bad!

but I'll kick some asses afterwards (hopefully.. I'm basing my future on this! )

later!


Posted by Kytracid on Oct-23-2001 21:15:

quote:
Originally posted by trancaholic


IMO the gain from being handed full solutions is no match for putting things together for yourself from small examples in your textbook/teaching material. It's like peeing your pants when it's freezing: It will provide you with warmth for a while, but suddenly it will make you more cold than before. Again IMO.


LOL well put !!!!

on the subject of C++...Sorry man I hate that language...prefere Java myself, even though it is weaker then C++.


Posted by hypronix on Oct-23-2001 21:24:

quote:
Originally posted by Kytracid


LOL well put !!!!

on the subject of C++...Sorry man I hate that language...prefere Java myself, even though it is weaker then C++.


personally I fell in love with c++ from my first #include... but everyone has their own "tastes". anyway, can U use Java for more than web-related stuff? I mean can U manipulate windows and stuff with it?


Pages (2): [1] 2 »

Powered by: vBulletin
Copyright © 2000-2021, Jelsoft Enterprises Ltd.