Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.
Help with problem in C
Name: Nick Date: January 10, 2003 at 10:45:02 Pacific OS: win98 CPU/Ram: p2/128
Comment:
I need help with one of my homework review problems.
If a child bought 147 cans of beans for his family, and could only carry 45 cans at a time, how many trips home must he take?
Name: Don Arnett Date: January 10, 2003 at 11:12:51 Pacific
Reply:
How many beans are in each can??
0
Response Number 2
Name: kev Date: January 10, 2003 at 13:00:41 Pacific
Reply:
Uhh... This doesn't seem to be that hard of a problem...
147/45 = 3.2666 which rounds to 4 trips.
Make a 'cans' variable and a 'carrying' variable and divide 'cans' by 'carrying'. Then ceil the answer since you can't make .2666 of a trip - you either make the trip or you don't.
Summary: Thanks, that really helped me fixed that problem. Now I have another problem with another class. I made a random class to generate random numbers for the problems on my arithmetic program, Im trying ...
Summary: Hi, I was wandering if anybody here could help me out with a programming assigment i have to do. I'm not asking for the total solution, I really want to learn this stuff, but i need some help with ...
Summary: Hello, do you know where I can find the source code in C that calculates a 16-bit CCITT SDLC CRC? It uses the polynomial X**16 + X**12+X**5+1. Thanks. ...