Go Back   Honda-Tech > Community Forums > General Discussion and Debate
Sign in using an external account
Register Forgot Password?
Search


Welcome to Honda-Tech!
Welcome to Honda-Tech.com.

You are currently viewing our forums as a guest, which gives you limited access to view most discussions and access our other features. By joining our community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join the Honda-Tech community today!


Reply
 
 
 
submit to reddit
 
Thread Tools Search this Thread
Old 01-27-2006, 02:25 PM   #1
Lifter2012
Member
Garage is empty, add now
 
Lifter2012's Avatar
 
Join Date: Jan 2003
Location: On The Beach in, FL
Posts: 1,203
iTrader Rating: (0)
Default Can a C/C++ Programmer please help me?!?!?!?!

Hey anyone who has knowledge is programming in C or C++ I really need some help!! ASAP. i've got a couple questions about some very BASIC stuff, like first 2 weeks of learning from scratch so if anyone can help let me know, i might even pay you! lol seriously Click the image to open in full size. Click the image to open in full size.
__________________
2000 Integra Type R #896 SOLD 2/13/07
Lifter2012 is offline   Reply With Quote
Old 01-27-2006, 02:35 PM   #2
Ceres
Garage is empty, add now
 
Ceres's Avatar
 
Join Date: Jul 2004
Location: CA
Posts: 154
iTrader Rating: (0)
Default

I've taken couple of classes post up the problem I'm sure theres a lot of ppl here who can help you out
Ceres is offline   Reply With Quote
Old 01-27-2006, 02:38 PM   #3
TTM
Member
Garage is empty, add now
 
TTM's Avatar
 
Join Date: Oct 2004
Location: North UT
Posts: 1,355
iTrader Rating: (0)
Default

havnt done it in a while but in my prime i was not half bad
__________________
i have a vitamin B complex
-Steve
TTM is offline   Reply With Quote
Old 01-27-2006, 02:42 PM   #4
funz0rzies
Honda-Tech Member
Garage is empty, add now
 
funz0rzies's Avatar
 
Join Date: Feb 2005
Location: CA
Posts: 794
iTrader Rating: (0)
Default

cout << "wwwwwwwwwha"

geez i hated that class...if it's basic, i might be able to help also
funz0rzies is offline   Reply With Quote
Old 01-27-2006, 02:55 PM   #5
Lifter2012
Member
Garage is empty, add now
 
Lifter2012's Avatar
 
Join Date: Jan 2003
Location: On The Beach in, FL
Posts: 1,203
iTrader Rating: (0)
Default Re: (funz0rzies)

i'm jus gonna list some of the problems i have to do, i'm gettin them but it takes me forever and 100 tries each lol. anyone can help with which ever one or ones they want, thatd be awesome!!!

10012: Declare a numerical variable precise and initialize it to the value 1.09388641.

10247: Write a declaration of a variable named count that can be used to hold numbers like 9 and -1 and -4.

10248: Write a declaration for a variable rate_of_pay that can hold values like 11.50 or 12.75.

10249: Write a declaration of a variable named number_of_children that can be used to hold the number of children in a family.

10250: Write a declaration for a variable hits that can hold the number of times a baseball player has hit the ball in a baseball game.

10251: Write a declaration for a variable temperature that can hold the current outdoor temperature, measured to the half degree (like 98.6 or 31.5).

10252: Write a declaration for two integer variables, age and weight.

10253: Write a declaration for two variables, price and cost, that can hold numbers with decimal places.

10254: Write a declaration for an integer variable area and a variable price that can hold numbers with decimal places.

10255: Write a declaration for variables length, width, and area that can hold values like 13.5 and 14.6.

10256: Write a declaration for a variable channel that can hold TV channel numbers (1 to 900) and a variable hours_recorded that can hold the number of hours of TV recorded (numbers like 1.0 or 3.5).

10257: Write a statement that declares an int variable age and initializes it to 15.

10258: Write a statement that declares two int variables, named num and val and initializes each to 5.

10259: Write a statement that declares and initiallizes two integer variables. Call the first one age and initialize it to 15, and call the second one weight and initialize it to 90.

10260: Declare a variable miles_run and initialize it to 3.75.

10261: Write declaration statements to declare and initialize two variables: one is an integer variable named age, initialized to 18, and the other variable, named weight, is initialized to 114.5.

10262: Write statements to declare and initialize two variables: one, named element_number can hold any of the integer values 1 through 118; the other, named atomic_weight can hold the atomic weight of the given element; atomic weights are values like 3.76.

In the declaration, initialize the variables to the values for oxygen, which is element number 8 and has an atomic weight of 15.9994.
__________________
2000 Integra Type R #896 SOLD 2/13/07
Lifter2012 is offline   Reply With Quote
Old 01-27-2006, 03:18 PM   #6
Lifter2012
Member
Garage is empty, add now
 
Lifter2012's Avatar
 
Join Date: Jan 2003
Location: On The Beach in, FL
Posts: 1,203
iTrader Rating: (0)
Default Re: (Lifter2012)

i have some of these but i wanna make sure they are right before i submit them !!
__________________
2000 Integra Type R #896 SOLD 2/13/07
Lifter2012 is offline   Reply With Quote
Old 01-27-2006, 03:37 PM   #7
fluxion
amin n'rangwa edanea
Garage is empty, add now
 
fluxion's Avatar
 
Join Date: Jun 2003
Location: Austin, TX
Posts: 2,897
iTrader Rating: (0)
Default Re: (Lifter2012)

just post what you have...i dont wanna look like an idiot explaining something as trivial as variable declaration/initialization to someone who already knows
__________________
96 Accord LX Coupe - F22B2 - I/H/C/E/Pulleys - Sold =*(
09 Civic EX Coupe with Navi

Ai, like gold fall the leaves in the wind... long years numberless as the wings of trees. The days have passed like swift draughts of sweet mead in lofty halls beyond the West, beneath the blue vaults of Varda, wherein, the stars tremble in the song of her voice, wholly and queenly. Who now shall refill the cup for me? - The Lament of Galadriel
fluxion is offline   Reply With Quote
Old 01-27-2006, 03:44 PM   #8
Lifter2012
Member
Garage is empty, add now
 
Lifter2012's Avatar
 
Join Date: Jan 2003
Location: On The Beach in, FL
Posts: 1,203
iTrader Rating: (0)
Default Re: (fluxion)

Quote:
Originally Posted by fluxion
just post what you have...i dont wanna look like an idiot explaining something as trivial as variable declaration/initialization to someone who already knows
i DONT know lol thats the problem, like i have a slight idea but when it actually comes to writing the code i get lost. for exemple:

10012: Declare a numerical variable precise and initialize it to the value 1.09388641.


I have: char precise;
char precise = '1.09388641';

which it tells me is wrong. Our analysis of your code:
*
Suggestion: To handle data of that sort requires a floating-point data type.


another ex: 10247
Write a declaration of a variable named count that can be used to hold numbers like 9 and -1 and -4.

my answer: const int count 9,-1,-4;

but both of these are wrong and i'm lost Click the image to open in full size.
__________________
2000 Integra Type R #896 SOLD 2/13/07
Lifter2012 is offline   Reply With Quote
Old 01-27-2006, 03:46 PM   #9
Flitch
Junior Member
Garage is empty, add now
 
Flitch's Avatar
 
Join Date: Jan 2005
Location: NoVA
Posts: 129
iTrader Rating: (0)
Default Re: (Lifter2012)

Quote:
Originally Posted by Lifter2012
i'm jus gonna list some of the problems i have to do, i'm gettin them but it takes me forever and 100 tries each lol. anyone can help with which ever one or ones they want, thatd be awesome!!!

10012: Declare a numerical variable precise and initialize it to the value 1.09388641.

10247: Write a declaration of a variable named count that can be used to hold numbers like 9 and -1 and -4.

10248: Write a declaration for a variable rate_of_pay that can hold values like 11.50 or 12.75.

10249: Write a declaration of a variable named number_of_children that can be used to hold the number of children in a family.

10250: Write a declaration for a variable hits that can hold the number of times a baseball player has hit the ball in a baseball game.

10251: Write a declaration for a variable temperature that can hold the current outdoor temperature, measured to the half degree (like 98.6 or 31.5).

10252: Write a declaration for two integer variables, age and weight.

10253: Write a declaration for two variables, price and cost, that can hold numbers with decimal places.

10254: Write a declaration for an integer variable area and a variable price that can hold numbers with decimal places.

10255: Write a declaration for variables length, width, and area that can hold values like 13.5 and 14.6.

10256: Write a declaration for a variable channel that can hold TV channel numbers (1 to 900) and a variable hours_recorded that can hold the number of hours of TV recorded (numbers like 1.0 or 3.5).

10257: Write a statement that declares an int variable age and initializes it to 15.

10258: Write a statement that declares two int variables, named num and val and initializes each to 5.

10259: Write a statement that declares and initiallizes two integer variables. Call the first one age and initialize it to 15, and call the second one weight and initialize it to 90.

10260: Declare a variable miles_run and initialize it to 3.75.

10261: Write declaration statements to declare and initialize two variables: one is an integer variable named age, initialized to 18, and the other variable, named weight, is initialized to 114.5.

10262: Write statements to declare and initialize two variables: one, named element_number can hold any of the integer values 1 through 118; the other, named atomic_weight can hold the atomic weight of the given element; atomic weights are values like 3.76.

In the declaration, initialize the variables to the values for oxygen, which is element number 8 and has an atomic weight of 15.9994.
Double precise = 1.09388641

Int count

Double rate_of_pay

Int number_of_children

Int hits

Double Temperature

Int age, weight
__________________
Netbux Referral - <A HREF="http://netbux.org/?r=120939
" TARGET="_blank">http://netbux.org/?r=120939
</A>
Flitch is offline   Reply With Quote
Old 01-27-2006, 03:48 PM   #10
Flitch
Junior Member
Garage is empty, add now
 
Flitch's Avatar
 
Join Date: Jan 2005
Location: NoVA
Posts: 129
iTrader Rating: (0)
Default Re: (Flitch)

Doubles are for anything with decimal points
Ints are for whole numbers
Chars are for characters
and Const is for anything that WILL NEVER CHANGE.

I've done a few basic ones, you can figure out the rest.
__________________
Netbux Referral - <A HREF="http://netbux.org/?r=120939
" TARGET="_blank">http://netbux.org/?r=120939
</A>
Flitch is offline   Reply With Quote
Old 01-27-2006, 03:59 PM   #11
fluxion
amin n'rangwa edanea
Garage is empty, add now
 
fluxion's Avatar
 
Join Date: Jun 2003
Location: Austin, TX
Posts: 2,897
iTrader Rating: (0)
Default Re: (Lifter2012)

Quote:
Originally Posted by Lifter2012
i DONT know lol thats the problem, like i have a slight idea but when it actually comes to writing the code i get lost. for exemple:

10012: Declare a numerical variable precise and initialize it to the value 1.09388641.


I have: char precise;
char precise = '1.09388641';

which it tells me is wrong. Our analysis of your code:

Suggestion: To handle data of that sort requires a floating-point data type.


another ex: 10247
Write a declaration of a variable named count that can be used to hold numbers like 9 and -1 and -4.

my answer: const int count 9,-1,-4;

but both of these are wrong and i'm lost Click the image to open in full size.
int count;

it can already hold a signed integer value, he didnt ask you to initialize it so you're done. it will indeed hold values like 9, -1, -4

and char data types only hold a single 8bit character, they dont store numbers (well..they'll store a sngle digit, but it wont be treated as a number)

looks like you're just getting lost in the wording and havent really looked up what data types should be used for what. you cant just wing it, there's precise rules involved. it's easy stuff though, it'll take you 10 minutes to read enough to breeze through these...seriously, i promise.
__________________
96 Accord LX Coupe - F22B2 - I/H/C/E/Pulleys - Sold =*(
09 Civic EX Coupe with Navi

Ai, like gold fall the leaves in the wind... long years numberless as the wings of trees. The days have passed like swift draughts of sweet mead in lofty halls beyond the West, beneath the blue vaults of Varda, wherein, the stars tremble in the song of her voice, wholly and queenly. Who now shall refill the cup for me? - The Lament of Galadriel
fluxion is offline   Reply With Quote
Old 01-27-2006, 04:06 PM   #12
Flitch
Junior Member
Garage is empty, add now
 
Flitch's Avatar
 
Join Date: Jan 2005
Location: NoVA
Posts: 129
iTrader Rating: (0)
Default Re: (fluxion)

Quote:
Originally Posted by fluxion
int count;

it can already hold a signed integer value, he didnt ask you to initialize it so you're done. it will indeed hold values like 9, -1, -4

and char data types only hold a single 8bit character, they dont store numbers (well..they'll store a sngle digit, but it wont be treated as a number)

looks like you're just getting lost in the wording and havent really looked up what data types should be used for what. you cant just wing it, there's precise rules involved. it's easy stuff though, it'll take you 10 minutes to read enough to breeze through these...seriously, i promise.
Exactly

Don't forget to add semi-colon's to the ones I've done.
__________________
Netbux Referral - <A HREF="http://netbux.org/?r=120939
" TARGET="_blank">http://netbux.org/?r=120939
</A>
Flitch is offline   Reply With Quote
Old 01-27-2006, 04:12 PM   #13
nickG
Garage is empty, add now
 
Join Date: Jun 2004
Location: Annapolis, MD USNA c/o 2008, usa
Posts: 727
iTrader Rating: (0)
Send a message via AIM to nickG
Default Re: (Lifter2012)

Quote:
Originally Posted by Lifter2012

i DONT know lol thats the problem, like i have a slight idea but when it actually comes to writing the code i get lost. for exemple:

10012: Declare a numerical variable precise and initialize it to the value 1.09388641.


I have: char precise;
char precise = '1.09388641';

which it tells me is wrong. Our analysis of your code:
*
Suggestion: To handle data of that sort requires a floating-point data type.


another ex: 10247
Write a declaration of a variable named count that can be used to hold numbers like 9 and -1 and -4.

my answer: const int count 9,-1,-4;

but both of these are wrong and i'm lost Click the image to open in full size.
double precise;
precise=1.09388641;

int count;

dont you have a book or anything????

wait till you start doing loops and matrices....

i took C last semester..it sucked
nickG is offline   Reply With Quote
Old 01-27-2006, 04:14 PM   #14
Flitch
Junior Member
Garage is empty, add now
 
Flitch's Avatar
 
Join Date: Jan 2005
Location: NoVA
Posts: 129
iTrader Rating: (0)
Default Re: (nickG)

Quote:
Originally Posted by nickG
double precise;
precise=1.09388641;

int count;

dont you have a book or anything????

wait till you start doing loops and matrices....

i took C last semester..it sucked
Hahaha, I love C++. I just hated doing the big complex Private and Public ****.
__________________
Netbux Referral - <A HREF="http://netbux.org/?r=120939
" TARGET="_blank">http://netbux.org/?r=120939
</A>
Flitch is offline   Reply With Quote
Old 01-27-2006, 04:14 PM   #15
Lifter2012
Member
Garage is empty, add now
 
Lifter2012's Avatar
 
Join Date: Jan 2003
Location: On The Beach in, FL
Posts: 1,203
iTrader Rating: (0)
Default Re: (Flitch)

wow thanks guys, yea literally after reading what you both wrote i finished all of them in less than 5 minutes haha. my teacher didn't explain it very well i guess. theres only 2 i'm stock on, the rest i got 100%!!!

10256:
Write a declaration for a variable channel that can hold TV channel numbers (1 to 900) and a variable hours_recorded that can hold the number of hours of TV recorded (numbers like 1.0 or 3.5).

mine:
int channel;
channel = 1 to 900;
double hours_recorded;
hours_recorded = 1.0 or 3.5;

i dont know what to do with the numbers??


10262:
Write statements to declare and initialize two variables: one, named element_number can hold any of the integer values 1 through 118; the other, named atomic_weight can hold the atomic weight of the given element; atomic weights are values like 3.76.

In the declaration, initialize the variables to the values for oxygen, which is element number 8 and has an atomic weight of 15.9994.

how do i do a code when it has values through another, like the first one i posted 1 to 900??
__________________
2000 Integra Type R #896 SOLD 2/13/07
Lifter2012 is offline   Reply With Quote
Old 01-27-2006, 04:18 PM   #16
nickG
Garage is empty, add now
 
Join Date: Jun 2004
Location: Annapolis, MD USNA c/o 2008, usa
Posts: 727
iTrader Rating: (0)
Send a message via AIM to nickG
Default Re: (Lifter2012)

Quote:
Originally Posted by Lifter2012
wow thanks guys, yea literally after reading what you both wrote i finished all of them in less than 5 minutes haha. my teacher didn't explain it very well i guess. theres only 2 i'm stock on, the rest i got 100%!!!

10256:
Write a declaration for a variable channel that can hold TV channel numbers (1 to 900) and a variable hours_recorded that can hold the number of hours of TV recorded (numbers like 1.0 or 3.5).

mine:
int channel;
channel = 1 to 900;
double hours_recorded;
hours_recorded = 1.0 or 3.5;

i dont know what to do with the numbers??


10262:
Write statements to declare and initialize two variables: one, named element_number can hold any of the integer values 1 through 118; the other, named atomic_weight can hold the atomic weight of the given element; atomic weights are values like 3.76.

In the declaration, initialize the variables to the values for oxygen, which is element number 8 and has an atomic weight of 15.9994.

how do i do a code when it has values through another, like the first one i posted 1 to 900??
you dont have to do anything with the numbers..it says it has to be able to hold values..ie an integer (whole number) or a double...
it seems like youre just declaring variable and initializing them...this is just to get you to recognize when you need to use an int or a double

int channel;

double hours_recorded;

int element_number=8;

double atomic_weight=15.9994;
nickG is offline   Reply With Quote
Old 01-27-2006, 04:19 PM   #17
Flitch
Junior Member
Garage is empty, add now
 
Flitch's Avatar
 
Join Date: Jan 2005
Location: NoVA
Posts: 129
iTrader Rating: (0)
Default Re: (Lifter2012)

Quote:
Originally Posted by Lifter2012
wow thanks guys, yea literally after reading what you both wrote i finished all of them in less than 5 minutes haha. my teacher didn't explain it very well i guess. theres only 2 i'm stock on, the rest i got 100%!!!

10256:
Write a declaration for a variable channel that can hold TV channel numbers (1 to 900) and a variable hours_recorded that can hold the number of hours of TV recorded (numbers like 1.0 or 3.5).

mine:
int channel;
channel = 1 to 900;
double hours_recorded;
hours_recorded = 1.0 or 3.5;

i dont know what to do with the numbers??


10262:
Write statements to declare and initialize two variables: one, named element_number can hold any of the integer values 1 through 118; the other, named atomic_weight can hold the atomic weight of the given element; atomic weights are values like 3.76.

In the declaration, initialize the variables to the values for oxygen, which is element number 8 and has an atomic weight of 15.9994.

how do i do a code when it has values through another, like the first one i posted 1 to 900??
The only way to really limit a variable is to use If statements. Which I don't think you've gotten to that point yet.

Anyways, here is an example.


int channel;
double hours_recorded;
cin &gt;&gt; channel;
If (channel &gt; 1)
----- If (channel &lt; 900)
----------- (Do whatever)
----- Else
----------- Null;
Else
-----Null;

Do the same with the other variable.

The -----'s are just for tabbing purposes. Really, you just have to declare them and be able to hold the said values. Limited involes the IF statements which I just posted.
__________________
Netbux Referral - <A HREF="http://netbux.org/?r=120939
" TARGET="_blank">http://netbux.org/?r=120939
</A>
Flitch is offline   Reply With Quote
Old 01-27-2006, 04:20 PM   #18
nickG
Garage is empty, add now
 
Join Date: Jun 2004
Location: Annapolis, MD USNA c/o 2008, usa
Posts: 727
iTrader Rating: (0)
Send a message via AIM to nickG
Default Re: (Flitch)

i dont think he has to actually restrict the variables, just allow them to be able to hold values 1-900...
nickG is offline   Reply With Quote
Old 01-27-2006, 04:23 PM   #19
Lifter2012
Member
Garage is empty, add now
 
Lifter2012's Avatar
 
Join Date: Jan 2003
Location: On The Beach in, FL
Posts: 1,203
iTrader Rating: (0)
Default Re: (nickG)

phuckin awesome guys!!!! i got it all now!!! seriously i thought i was going to be here all phuckin night. i really appreciate everyones help, i might be back in a week or so with some new ones for ya guys haha but seriously thanks everyone. you saved my friday night and also from failing, now i know how to do these Click the image to open in full size. Click the image to open in full size. Click the image to open in full size.
__________________
2000 Integra Type R #896 SOLD 2/13/07
Lifter2012 is offline   Reply With Quote
Old 01-27-2006, 04:27 PM   #20
Flitch
Junior Member
Garage is empty, add now
 
Flitch's Avatar
 
Join Date: Jan 2005
Location: NoVA
Posts: 129
iTrader Rating: (0)
Default Re: (nickG)

Quote:
Originally Posted by nickG
i dont think he has to actually restrict the variables, just allow them to be able to hold values 1-900...
Exactly, but when he hits that point...he'll know how Click the image to open in full size.
__________________
Netbux Referral - <A HREF="http://netbux.org/?r=120939
" TARGET="_blank">http://netbux.org/?r=120939
</A>
Flitch is offline   Reply With Quote
 
 
 
submit to reddit
Reply

Tags
109388641, area, cost, declaration, declare, initialize, length, named, numerical, precise, price, temperature, variable, variables, width, write

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT -8. The time now is 06:42 AM.



2008 Copyright, InternetBrands Inc.
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

Honda and the Honda marquee are registered trademarks of the American Honda Motor Company, Inc. Neither American Honda Motor Company nor its subsidiaries or affiliates shall bear any responsibility for Honda-Tech.com content, comments, or advertising. Honda-Tech.com is not affiliated with American Honda Motor Company in any way. American Honda Motor Company does not sponsor, support, or endorse Honda-Tech.com in any way. Copyright/trademark/sales mark infringements are not intended or implied.
Emails & Contact Details