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.
#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";
}
> 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.
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 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.
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.
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