I need help...literally
I need help...literally
Hey everyone'
I am brand new to this Basic programming and I have no idea what I am doing. I need help! My teacher doesn't help us with anything, she justs says you'll figure it out. But anyways I would be very grateful if someone would help me with this one problem in my book and please don't laugh at me I am new to this Basic programming: Thanks
Here's the problem :
Maria Maderas is thinking about starting a business selling pet rabbits. She currently has one pair of rabbits and would like to know approximately how many rabbits will be born during a given period of time. Assume that each female rabbit will reproduce every four months and that the litters will have an average of eight rabbits. Also assume that half of the rabbits are female. The program should allow Maria to enter a given number of months and then output the number of rabbits she should have by the end of that time period.
~That was out of Chapter 7 Loop Structures in QBasic Second Edition
If anyone could help me that would be wonderful! Thank you!
I am brand new to this Basic programming and I have no idea what I am doing. I need help! My teacher doesn't help us with anything, she justs says you'll figure it out. But anyways I would be very grateful if someone would help me with this one problem in my book and please don't laugh at me I am new to this Basic programming: Thanks
Here's the problem :
Maria Maderas is thinking about starting a business selling pet rabbits. She currently has one pair of rabbits and would like to know approximately how many rabbits will be born during a given period of time. Assume that each female rabbit will reproduce every four months and that the litters will have an average of eight rabbits. Also assume that half of the rabbits are female. The program should allow Maria to enter a given number of months and then output the number of rabbits she should have by the end of that time period.
~That was out of Chapter 7 Loop Structures in QBasic Second Edition
If anyone could help me that would be wonderful! Thank you!
-
- Veteran
- Posts: 109
- Joined: Thu Feb 10, 2005 12:38 pm
Let's be nice another time:
My advice with other homework is: Read your book, more then once, redo programs you've already written and try to make things yourselfs, it works...
grtz & good luck
Code: Select all
print "Number of months: ";
input "",months%
if month% =< 4 then
goto display
else
goto calculate
end if
calculate:
cmonths%=0
do
cmonths%=cmonths%+1
if cmonths%\4 = cmonths%/4 then
a%=cmonths%\4
b%=a%*8
end if
loop while cmonths%<months%
Display:
print "Rabbits by end of period: males: ";b%\2 ;" females: ";b%\2
grtz & good luck
- {Nathan}
- Veteran
- Posts: 1169
- Joined: Thu Aug 19, 2004 6:08 pm
- Location: The wetlands of central Ohio, USA
- Contact:
Seb, when you said to do:
You do realize that you could have done
Instead? Also, I THINK that that makes it without a question mark, but if it doesnt then just change the "," after the string to a ";".
Code: Select all
print "Number of months: ";
input "",months%
Code: Select all
INPUT "Number of months: ", months%
- matt2jones
- Veteran
- Posts: 80
- Joined: Sat Feb 19, 2005 8:29 am
- Location: elsewhere
- Contact:
Seriously, don't write up guys homework for them. That helps no-one. If they're teacher is seriously as incompetant as they say, the whole class will fail and something will be done about it, so if you help a few, the teacher will think she's teaching it fine and the students are fork up, and the whole class will suffer (speaking from personal experiance).
And if the teacher is good and the person is lazy you've just shown them how easy it is to get by exploiting other people... And the world we live in does not need more people learning that particular lesson.
Assuming they're going through the book chronolgicly (which doesn't alway happen), they've been doing this for a while. Unless loops are the first area of difficulty (and I doubt that from the preamble), posting up code with no-explanation will not help anyone understand, and will just encourage the people your trying to help, to copy.
And if the teacher is good and the person is lazy you've just shown them how easy it is to get by exploiting other people... And the world we live in does not need more people learning that particular lesson.
Assuming they're going through the book chronolgicly (which doesn't alway happen), they've been doing this for a while. Unless loops are the first area of difficulty (and I doubt that from the preamble), posting up code with no-explanation will not help anyone understand, and will just encourage the people your trying to help, to copy.
Do not mistake Apathy for feeling Content.
http://www.disjointed.cjb.net - Short Storys
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic
http://www.disjointed.cjb.net - Short Storys
http://matt2jones.deviantart.com - Random Art
http://www.freewebs.com/matt2jones - WebComic
You're right there. Say, Jackie... What do you actually not understand of programming? 'cause have you thought to yourselfs:"Is this want I want to do?"
I learned Basic without any book at first. I only had this build-in manual (a.k.a. help) of Qbasic v1.1. Later on I had a couple of books and tried to do things.
grtz
Seb
I learned Basic without any book at first. I only had this build-in manual (a.k.a. help) of Qbasic v1.1. Later on I had a couple of books and tried to do things.
grtz
Seb
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact: