Join us at IRC!
Imagination is more valuable than knowledge - Albert Einstein
Wednesday, May 23, 2012
Navigation
Members Online
Total Online: 31
Web Spiders: 16
Guests Online: 30
Members Online: 1

Registered Members: 70170
Newest Member: bahmx
Latest Articles
View Thread

HellBound Hackers | Events | General

Author

c++ questions

Rever
Member



Posts: 40
Location:
Joined: 24.05.07
Rank:
Newbie
Posted on 25-01-08 01:01
1) What's the difference between int and double?

2) Why does 12% 5 = 2?

- thanks


"Insert signature here"
www.myspace.com/serdal
Author

RE: c++ questions

yours31f
Second to one



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Satan
Posted on 25-01-08 01:05
int = intager == a whole # (e.g. 2)

double = a decimal (e.g. 11.1)


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.



yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: c++ questions

Futility
Member



Posts: 715
Location: USA
Joined: 17.12.07
Rank:
God
Posted on 25-01-08 01:07
You might want to try researching a little by yourself before posting but, since I'm ecstatic that I know the answer, I'm going to try and help.


1) What's the difference between int and double?

int is only real counting numbers. IE: 1,2,3,4 etc
dbl is all the numbers in between. IE: 1.2, 1.3, 1.4 etc

2) Why does 12% 5=2?

% is the way C++ displays modulous. I don't really know how to explain it other than saying it's the remainder. 5 goes into 12 2 times (10) with 2 left over. Thus 12% 5=2. If you know any VB, it is the same as MOD.

Hope I helped. If I'm wrong about modulous, feel free to correct me. (I don't think I am)


Futility91@hotmail.com Futility91 http://mycampearth.com/
Author

RE: c++ questions

yours31f
Second to one



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Satan
Posted on 25-01-08 01:09
ya cuz the first part is almost exactly what i said.


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.



yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: c++ questions

Rever
Member



Posts: 40
Location:
Joined: 24.05.07
Rank:
Newbie
Posted on 25-01-08 01:20
Okay, thanks.

so if I was using " double a, double b; " then it would mean a and b have a decimal in them?

These are the problems I have and the answers. But I don't know how they got them.

12% 5 = 2

20 % 10 = 0

20 % 21 = 20


"Insert signature here"
www.myspace.com/serdal
Author

RE: c++ questions

yours31f
Second to one



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Satan
Posted on 25-01-08 01:21
as far as i can tell it should be

12% 5 = 2

20 % 10 = 0

20 % 21 = 1 <--- only thing i could see wrong


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.



yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: c++ questions

Rever
Member



Posts: 40
Location:
Joined: 24.05.07
Rank:
Newbie
Posted on 25-01-08 01:23
I'm studying for my final tomorrow and there's the question and an answer key.

It says 20 but the 0 was written sloppy and looks like a 1 turned into a 0. I don't know...

So why do first two come out to equal that?


"Insert signature here"
www.myspace.com/serdal
Author

RE: c++ questions

Rever
Member



Posts: 40
Location:
Joined: 24.05.07
Rank:
Newbie
Posted on 25-01-08 01:25
Nevermind I just understood it.

thanks again :p


"Insert signature here"
www.myspace.com/serdal
Author

RE: c++ questions

Futility
Member



Posts: 715
Location: USA
Joined: 17.12.07
Rank:
God
Posted on 25-01-08 01:27
...Didn't I just explain this? Ok, I'm sure it was unclear and/or confusing.
% finds the remainder- the leftovers, if you will.
5 goes into 12 how many times?
2.
5*2=10.
12-10=2.
12%5=2.

@Yours3lf
Maybe-just maybe, I started writing my answer before you, but took the time to be thorough and check my spelling, allowing you to post your crap before me? Nah, that's not possible. I must have just copied your beautiful answer.




Futility91@hotmail.com Futility91 http://mycampearth.com/
Author

RE: c++ questions

yours31f
Second to one



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Satan
Posted on 25-01-08 01:28
your welcome. if you need anymore help pm. (i took a class in java and css ,just wish that it wouldv'e been with js)


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.



yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: c++ questions

Zephyr_Pure
Member



Posts: 2402
Location:
Joined: 15.09.06
Rank:
God
Posted on 25-01-08 02:02
yours31f wrote:
as far as i can tell it should be

20 % 21 = 1 <--- only thing i could see wrong


Why on earth would the remainer of 20 divided by 21 be 1? 21 goes into 20... 0 times, with a remainder of 20.

Other than that, decent explanations on double vs. int and modulus... as a further course of action, I would suggest a book on beginning C++.



I still check PMs from time to time.




Our responses were moronic, why shouldn't he follow suit? - Futility
Author

RE: c++ questions

yours31f
Second to one



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Satan
Posted on 25-01-08 02:09
oh good catch i missed that lol


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.



yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: c++ questions

ynori7
Future Emperor of Earth



Posts: 1481
Location: #valhalla
Joined: 08.10.07
Rank:
Diabolical
Posted on 25-01-08 03:36
like someone mentioned before, use google first before asking for help. these questions could have easily been answered with a simple google search.

also, i'm curious as to why you waited until the day before the final to understand these simple concepts. what class is this final for?




ynori7 http://halls-of-valhalla.org
Author

RE: c++ questions

dex_poet
Member



Posts: 367
Location:
Joined: 25.11.07
Rank:
Wiseman
Posted on 25-01-08 04:12
Go to the microsoft home page. Then browse to the C++ video training. They start off with basic syntax and basic logic.

Better get to work if your final is in C++...

EDIT: whoops. I thought you said somewhere it was C++, but it turns out it was Zephyr_Pure's post. microsoft will still get you through what you need though.




Edited by dex_poet on 25-01-08 04:21
Author

RE: c++ questions

Uber0n
Member



Posts: 1963
Location: Sweden‭‮
Joined: 13.06.06
Rank:
God
Posted on 25-01-08 06:43
Zephyr_Pure wrote:
Why on earth would the remainer of 20 divided by 21 be 1? 21 goes into 20... 0 times, with a remainder of 20.


Thanks, now I didn't have to explain this myself :p



http://uber0n.webs.com/
Nope http://uber0n.webs.com/
Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.