| | |
homework help please
![]() |
homework(original function names in () )
i have done most of the job allready, but i can't seem to make it do exactelly what the program should.
My job is to make a program that asks numbers of busses(10,27,33,36) and the departure(valjus) times and save them into a txt document and then how many minutes has passed from the last departure(valjus) of the same buss. and also the program should check that the time(minutes and hours) are in the normal range from 0-24 h and 0-60 minutes and also it should check that the buss number entered is exacetelly the same number as given in the program.
It currently makes a txt document and saves the times, but i can't make the program calculate the time between(vahe) the departure(valjus) of the same number buss, it just doesn't do that. also, when i close the program window and start inserting the times and numbers again, it for some reason prints out the wrong time, but the new inserted buss number. my program doesn't brake, when '0' is entered as the buss number . i don't know what i'm doing wrong...
can you help me.
i have added my homework as well.
i have done most of the job allready, but i can't seem to make it do exactelly what the program should.
My job is to make a program that asks numbers of busses(10,27,33,36) and the departure(valjus) times and save them into a txt document and then how many minutes has passed from the last departure(valjus) of the same buss. and also the program should check that the time(minutes and hours) are in the normal range from 0-24 h and 0-60 minutes and also it should check that the buss number entered is exacetelly the same number as given in the program.
It currently makes a txt document and saves the times, but i can't make the program calculate the time between(vahe) the departure(valjus) of the same number buss, it just doesn't do that. also, when i close the program window and start inserting the times and numbers again, it for some reason prints out the wrong time, but the new inserted buss number. my program doesn't brake, when '0' is entered as the buss number . i don't know what i'm doing wrong...
can you help me.
i have added my homework as well.
also i have a problem with my project, i need to get some info from a xml file and compare and print out few things.
everything is working fine, but the smallest countries area is 315,6 and every other area is a normal number like 12345 or something like that.
my problem is that that i can't get the 0,6 out from the xml, only the 315(i actually need 315+0,6)
what should i do?
should i just find the coma and then add the value after the coma or something else, but i have no idea how to put this into c++
i added my code and the xml file
everything is working fine, but the smallest countries area is 315,6 and every other area is a normal number like 12345 or something like that.
my problem is that that i can't get the 0,6 out from the xml, only the 315(i actually need 315+0,6)
what should i do?
should i just find the coma and then add the value after the coma or something else, but i have no idea how to put this into c++
i added my code and the xml file
•
•
Join Date: Jul 2005
Posts: 1,885
Reputation:
Solved Threads: 299
•
•
•
•
i can't make the program calculate the time between(vahe) the departure(valjus) of the same number buss
1) you can transform hours and minutes to seconds, subtract the number of seconds from one time to the other and then convert back into hours and minutes.
2) Do routine math using base 60.
•
•
Join Date: Apr 2006
Posts: 26
Reputation:
Solved Threads: 0
>> my program doesn't brake, when '0' is entered as the buss number
Because you break from the for loop, but not from the
while loop.
I suggest a flag like "tocont"
Because you break from the for loop, but not from the
while loop.
I suggest a flag like "tocont"
C++ Syntax (Toggle Plain Text)
tocont = 1; while ( tocont ) { for(int i=0;i<4;i++) { if(nr==0) { tocont = 0; break; } } }
•
•
•
•
Originally Posted by dude543
>> my program doesn't brake, when '0' is entered as the buss number
Because you break from the for loop, but not from the
while loop.
I suggest a flag like "tocont"
C++ Syntax (Toggle Plain Text)
tocont = 1; while ( tocont ) { for(int i=0;i<4;i++) { if(nr==0) { tocont = 0; break; } } }
If you understand the language you're using, then you should have no problem running through the code by hand or in your head to see what happens, given some particular program. So do that.
All my posts may be redistributed under the GNU Free Documentation License.
9559449000 - lol you don't need modular exponentiation when using such small numbers
9559449000 - lol you don't need modular exponentiation when using such small numbers
•
•
•
•
Originally Posted by Rashakil Fol
If you understand the language you're using, then you should have no problem running through the code by hand or in your head to see what happens, given some particular program. So do that.
if did understand the code i wouldn't be her and asking but helping others...please don't make me feel even more miserable then i allready am
![]() |
Similar Threads
- Need help with Computer Science homework (Computer Science)
- We only give homework help to those who show effort (Computer Science)
- Dynamic memory allocation homework (C++)
- Homework Help!! Priority Queue ?? (Computer Science)
Other Threads in the C++ Forum
- Previous Thread: I Need Help!!
- Next Thread: Elementry C++.. little help for mods
Views: 1404 | Replies: 9
| Thread Tools | Search this Thread |
Tag cloud for C++
6 algorithm array arrays assignment beginner binary c++ c/c++ calculator char class classes code command compile compiler constructor conversion convert count data delete dll dynamic encryption error file files forms fstream function functions game givemetehcodez graph gui helpwithhomework homework http iamthwee ifstream input int lazy linker list loop loops map math matrix memory network newbie number object objects opengl operator output parameter path pointer pointers problem program programming project random read recursion recursive reference simple sockets sort spoonfeeding string strings struct student studio template templates text time tree variable vc++ vector video visual void win32 window windows winsock wordfrequency wxwidgets






