Hey everyone,
I have programmed for many years now, and I never got deep into C++, so i'm going back to it. I bought a book with some extra practice problems in the back, yet they don't seem to have any answers. If someone could give me the code for these 3 problems, I could compare it to mine to see what i got. Thanks!
Write a program that will generate a random number larger than 10,000 and then output the digits as words. For example, 345678’s output would be:
The Value is: 345678
Three Four Five Six Seven Eight
Write a program that creates a scrolling message display with characters entering from the right. For example, the message: Vote Yes!’s output would be:
Vote Yes!
ote Yes! V
te Yes! Vo (and so on)
A fast food restaurant charges $3.50 for a burger, $1.50 for fries, $1.75 for a drink or a combo meal for which includes all three items for $6.25.
Create a program that allows the cashier to enter their name and calculates the bill. They should be asked if they are purchasing a combo or individuals item. They should be asked how many combo meals and/or individual items should be purchased
Once everything is entered, the program should write out a “receipt” in which the user (cashier) should enter the money he was given. Once that is done, the program should calculate the change that needs to be given.
I think that to be honest you ought to at least say that you have no idea what you are doing. I don't think it is possible to be an experienced programmer and not realize that these problems are trivially easy -- introductory CS 101 stuff.
A good way to not make friends on the forums is to lie to us and ask for free work.
Since I'm feeling really generous right now...
1) This problem has two parts. The first part is to be able to split a number into individual digits. The second part is using arrays to store the individual digits and to lookup the digit's name.
2) This is an array shift problem. You'll need to figure out how to shift all the stuff in an array one place to the left, and put what was the first value in the last position.
3) This problem also comes in two parts. For the first part you need a menu, which allows the user to choose menu items and to choose to finish (and pay). The second part is simply to keep track of the user's choices and print them out, plus the sum total (arrays again).