-
programmig help!
the shipping clerk at rinky dooflingy company is faced with the following problem. dooflingies are very delicate and must be shiped in special containers. these containers are available in four sizes huge, large, medium, small, which can hold 50, 20, 5, and 1 dooflingies, respectively. write a program that reads the number of dooflingies to be to be shipped and print the number of huge, large, medium, and small containers needed to send shipment in the minimum nuber of containers and with the minimum amount of wasted space. use named constants for the number of dooflingies each type of container can. teh output should be similar to the following:
huge 21; large 2; medium 1; small 3
-
well im not gonna do your homework for you, but here is the basic idea....
Code:
void main()
{
int huge=0,large=0,medium=0,small=0,doofs=0;
cin>>doofs;
while(doofs>0)
{
if(doofs>50)
{
huge++;
doofs-=50;
}
else if(doofs>20)
{
large++;
doofs-=20;
}
// etc....
}
}
hope that helps... first time using the code block... hope it comes out right....
-
dean is faced with the following problem. He has a homework assignment he's not sure how to do.
Seriously, do you think someone is just going to write that for you? I'm not trying to be mean about it or anything but at least ask some specific questions so we know you attempted it. Better yet, show us the source from your attempt.
-
Code:
#include <iostream>
int main()
{
std::cout << "huge 21; large 2; medium 1; small 3" << std::endl;
return 0;
}
-
>void main()
void main() is wrong. See the FAQ for why:
Programming FAQ
-
My appologies all, i didnt realize giving someone a nudge on a hw assignment was so taboo... i will refrain from such nudges in the future...
~Craw
-
Giving a nudge isn't bad usually. It's just that he directly copied and pasted the problem. I mean, he doesn't even type anything else. No greetings, no where do I start, nothing. That's just disrepectful if you ask me. It's as if he was expecting someone to jump at the chance to program that for him.
-
Welcome!
Welcome to the board, dean.
Please read the Homework Announcment. Programmers generally like the process of solving problems and puzzles, and we want you to enjoy the experience of finding a solution. So, ask questions like "How do I get started?", "I'm stuck on...", "I'm getting an error when I..."
Programming is somewhat of a creative process. There is more than one solution to a programming assignment. Allow yourself plenty of time. You can easily spend a couple of hours writing a short program that would take less than 5 minuites to key-in, if you were just copying someone else's "answer".
While you're at it, read the Forum Guidelines. You'll find some tips that will help you get better responses. i.e. Use descriptive subject lines... something more specific than "programming help". :)