assignment!!!

so im still figuring it out what the hell am i doing with my life haha. i found the same homework posted here before. but anyone here who's willing to answer my homework?. any answer will be appreciated guys :(
Problem:
*cough cough
Objectives
to compile and run a program containing 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 caffeine - 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.

edit: i just copy/pasted the older post regarding the same problem.
Last edited on
anyone here who's willing to answer my homework?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
#include <cctype>
#include <limits>

int main()
{
	char answer{};
	std::cout << "Are you serious?: ";
	std::cin >> answer;

	// Ignore to the end of line
	std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');

	if (std::toupper(answer) == 'Y' )
		std::cout << "Post it in the Jobs section.\n";

	else
		std::cout << "Show what have you coded so far.\n";

	std::cout << "Good luck.\n";
}
Last edited on
> but anyone here who's willing to answer my homework?
Are you similarly clueless about C++ as the other guy?
Or do you think you can make an actual attempt at answering the question.

Because most people here (and pretty much every other forum like it) are genuinely helpful to newbies making an actual effort to work on the problem.

Yes mr @salem c . I do not know anything on c++. That's why i came here to find someone who can help(answer) me with this homework :(
if you can help me out mr @salem c , i would be grateful :()
I'm sure you would.

I could give the same code to both of you.
Then you can duke it out in front of the dean when you're both accused of plagiarism.

Perhaps the tutor will ask you some questions, and your blank expressions and "umm, err" response will tell the tale that you've no idea how the code you handed in works.

Or maybe the accusations will flow when you hand in your 2nd C++ assignment, and it looks nothing like your first one.
... I came here to find someone ...

I agree, to have something done by others is (with some exceptions) more intelligent than get it done on your own. The most demanding step is, to be so intelligent to find someone who is willing to work for you.

Until then I suggest to take the C++ source of V41 here:
http://www.hp41.org/LibView.cfm?Command=Author&AuthorID=3201
and compile it. It contains repetition structures. This fulfils 100% the objectives:
to compile and run a program containing repetition structures.

(There is no restriction in the assignment that the code must be yours?)
The emulated HP-41CX is equipped with a % function, that stands for percent. So the rest of your task is simple, like using a real pocket calculator. For sure you are intelligent enough to tell your tutor that there is no contradiction to the stipulations of the assignment.
closed account (z05DSL3A)
MikeMike, What can/have you done yourself?
Thanks to you guys, i'm done with cpp. I've dropped it from my subjects. Then i will retake it on maybe the next year?? I will start watching tuts through youtube vids. =D
i'm done with cpp

Nice. Is it possible to publish your solution of the caffeine calculator? Just as an exemplary role model.
Topic archived. No new replies allowed.