i need someone to finish this for \$15

hey guys I coded this by myself and I only have 1 hour to turn in. I am really too slow to code it. Here is the assignment. I coded first assignment. I need someone to code it second assignment. And person who code it must have Paypal account so i can send the payment.

Here is the code
 ``1234567891011121314151617181920212223242526272829303132`` ``````#include using namespace std; int main std; { // Declare variable for time double time; // Declare variable for distance double distance; // Declare variable for Gravity Constant and set equal to 9.81m double g=9.81; // Start the experiment cout << "Drop your Barometer/n"<< endl; // Promt user for time in seconds it took for barometer to hit cout << "How long did it take (in seconds) for barometer to hit ground" << endl; // Take input and perform math cin >> time; // Perform the math to calculate distance distance=0.5*g*time*time; // Display to user the total distance cout << "The height of the building is " << distance << " meters." << endl; return 0; } ``````

here is the second assignment which is continuing the first one.
what's your prof got against Jimmy Carter?
huh?
here's a bit you may could use:
 ``12345678910111213141516171819202122232425262728`` ``````unsigned short int user_choice_1; // (you could use bool) cout << "Will you be working in:\n" << "1.) Metric\n" << "2.) Imperial\n" << "Choice? "; cin >> user_choice_1; switch (user_choice_1) { case 1: // do metric stuffs case 2: // imperial units bleh } // OR if (user_choice_1 == 1) { // do metric stuffs } else if (user_choice_1 == 2) { // do imperial stuffs } else { cout << "Invalid input. You fails.\n"; }``````
LOL calm down missy

If you get input from the users like I gave example ^
`cin >> variable`
assign it to a couple maybe "unsigned short int"s like input_1, input_2
then use the if(){} structure to execute the desired code..

 ``12345678910111213141516171819202122232425262728`` ``````double answer; if (input_1 == 1) // returns true for metric choice { if (input_2 == 1) // returns true for height choice { // get input, do math and display metric height } else if (input_2 == 2) // returns true for time choice { // get metric input, do math and display time } else { cout << "Invalid input\n"; } else if (input_1 == 2) // returns true for imperial choice { if (input_2 == 1) { // get input, do math and display imperial height } else if (input_2 == 2) { // get imperial input, do math and display time } else { cout << "Invalid input\n"; } } else { cout << "Invalid input\n"; }``````

This should be all using stuff yall have gone over in class, I would think... wouldn't wanna get u in trouble ;3

You may have to resign yourself to not having it done in a half hour or whatever.. but won't you feel better knowing you made it yourself? I'll help you as much as I can but don't have paypal and am not really interested in your \$15.. after all won't you be needing that for someone's mom?

edit: aww yall should have left her post up there. now my joke doesn't make sense / looks weird
Last edited on
 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123`` ``````#include #include using std::cin; using std::string; using std::cout; using std::endl; int choice() { std::stringstream oss; int user_choice_1 = 0; // (you could use bool) do { oss.str(""); oss.clear(); cout << "Will you be working in:\n" << "1.) Metric\n" << "2.) Imperial\n" << "Choice? "; string str; getline(cin, str); oss << str; } while (!(oss >> user_choice_1) || (user_choice_1 > 2) || (user_choice_1 < 1)); return user_choice_1; } int mode() { std::stringstream oss; int user_choice_2 = 0; // (you could use bool) do { oss.str(""); oss.clear(); cout << "What mode will you want?:\n" << "1.) Height in terms time?\n" << "2.) Time in terms of height?\n" << "Choice? "; string str; getline(cin, str); oss << str; } while (!(oss >> user_choice_2) || (user_choice_2 > 2) || (user_choice_2 < 1)); return user_choice_2; } int main() { int c = choice(); int m = mode(); // Declare variable for time double time; // Declare variable for distance double distance; // Declare variable for Gravity Constant and set equal to 9.81m const double g = 9.81; cout << "Drop your Barometer\n"; // Promt user for time in seconds it took for barometer to hit cout << "How long did it take (in seconds) for barometer to hit ground?" << endl; cin >> time; // Take input and perform math distance = g * time * time * 0.5; cout << "Your building is " << distance << " meters tall.\n"; switch (c) { case 1: switch(m) { case 1: cout <<"The barometer fell at a rate of " << distance/time << " m/s\n"; break; case 2: cout << "It took the barometer " << time << " seconds to fall\n"; break; } break; case 2: switch(m) { case 1: cout <<"The barometer fell at a rate of " << (distance * 3.28084) / time << " f/s\n"; break; case 2: cout << "It took the barometer " << time << " seconds to fall"; break; } break; default: break; } cout << "\n\tNow, you do realize that barometers are filled with mecury,\n\tright? Call the EPA NOW!\n\n"; return 0; }``````

E: Didn't really understand what you mean by time in terms of height...all I got from that was that you are looking for velocity but since I already had velocity in there, I just printed time again.
Last edited on
yeah it looks like they haven't even learned functions from the op'ed code..

I bet professor would give her an F for copying code.. would be nervous about using all your pretty getline() calls and input validating loops. muy nice tho..
Last edited on
katie dear, have any code written?
Topic archived. No new replies allowed.