anyone can help me with this?

here is the problem. (im sorry guys i don't know anything about programming lol)

Objectives
to compile and run a program contating repetition structures.

Assignment
Plan and code a program utilizing one or more repetition structures to solve the following problem:
After caffeine is absorbed into the body, 13% is eliminated from the body each hour. Assume a person drinks a cup of coffee or caffeinated beverage and that the caffeine is absorbed immediately into the body. Write a program to calculate the following values:

The amount of caffeine in the body X hours after the person drinks the coffee.

Input
The type of drink, the amount of caffeine and how many hours they want to see the output for.
Test data: 16oz Starbucks coffee 310mg of caffene Show 10 hours
5-hr energy drink 245mg Show 7 hours
Black tea 47mg Show 5 hours
red bull 80mg show 12hours


Output
A listing of caffeine remaining each hour until the user's limit is reached. Remember to set the precision to something reasonable.

Note
Adequately check entered data for validity. Use adequate test data to process all valid data and representative data to show how your programs handles invalid data. Caffeine must not be greater than 350, hours must be a positive number not greater than 14.

Label all output clearly. Be sure your output file contains user prompts and what was entered by the user in addition to the results of your program processing.

Be sure to include adequate error handling in your program and error data when you run the program to demonstrate error handling.
> (im sorry guys i don't know anything about programming lol)
Why are you still on the course then?

It might be a true statement if this were day 1 of the course, and the tutor just dumped the homework on you and left the room.

But otherwise, you will have been told things (if you were paying attention) that would help you with this assignment.

Surely you can manage the basic "cout a prompt, cin a value" type interaction.
It would be a start, and show good faith on your part that you're trying to solve the assignment.

> 13% is eliminated from the body each hour.
Do you know enough math to subtract 13% from a value?
they said it is prerequisite to have an background knowledge in c++. And the main topic of our course is based on word, excel, ppt etc. So basically, i do not know anything sir.
So you joined a course with a prerequisite you know you didn't have, and now you're hoping to wing it?

Find out from your tutor how much more C++ you're expected to know.
You'd better tell them you don't know anything and figure out a plan to work around that.

I doubt anyone here is interested in just handing you complete code so you can "pass" the C++ segments of the course for you.

don't know anything

Reminds me following: my son attended a Delphi course at school and asked to help. I had absolutly no clue about neither Windows nor Delphi. I only had the online Help of Delphi and a PDF of a manual. In addition I have my way to dig fast into a new subject: neglect all you do not understand at once and go ahead until you are stopped by your ignorance. Then you have plenty of time to go about it.

Within one week I gave my son the result, a 4-banger. He refused to present it at school, it was too obviously not his own work. So imagine, you get a solution from this formum, sophisticated and perfectly satisfying the stipulated objectives and assignment, and your tutor asks you to explain -- you are ... let's say: in trouble.

My suggestion: take this 4-banger www.stehlin.net/hpclub/Aristo/4-banger.zip
or Free42 -- http://thomasokken.com/free42/
Both are simulations but may help to calculate this and that, even caffeine in your body.

But to meet this
Objectives
to compile and run a program contating repetition structures
it would be the absolute solution: Take the C++ source of V41 and compile it (must the source be completely yours?). As result you have an "emulator", a system on the PC that runs the original firmware of an HP-41C, CV, or CX. So it is
a program contating repetition structures
-- its main loop is the simulation of CPU cycles.
What would be more convenient to calculate values than a valuable pocket calculator? Find the source here: http://www.hp41.org/LibView.cfm?Command=Author&AuthorID=3201
May i ask where are you studying rn? I have the same homework like you just posted. And i still trying to figure it out. :\
i think you're from Manila right? I just saw your nickname on facebook and it said, you're from Manila.
Topic archived. No new replies allowed.