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.

---- begin sample run ----
Drop your barometer.
How long was it until you heard a crashing sound (in seconds)? 2.5

Your building is 30.65 meters tall.

Now, you do realize that barometers are filled with mercury,
right? Call the EPA NOW!
---- end sample run ----

Procedure
---------
1. Write out your pseudocode for how you are going to implement
this program. Your pseuedocode should include a listing of the
program's inputs, outputs, and the steps it performs. Also,
during this part of the program, you'll want to identify the
proper variable types for your inputs and outputs.

2. Set out a series of test cases (at least 5). Test cases should
include a series of example inputs and the expected
outputs. (see hints for how to do the math)

3. Using your favorite text editor, type out your pseudocode and
test cases into a text file named "lab2-2-test". Submit this
file using the turnin program:

~relowe/turnin lab2-2-test

By the end of class on Wednesday 1/30/2013

4. Write your program in c++. Compile it, test it. Once it all
works create a typescript file named "lab2-2-run" which contains
the following:

- A listing of your source code. (hint: use cat)
- Running your compile command so I can see your code compiles
without errors or warnings.
- Sample runs of your program for each of your test cases.

Be sure to type exit after you have generated all your output.
Turnin your script file using:

~relowe/turnin lab2-2-test

HINTS
-----
- We want to make the program give output in meters. Therefore, our
gravitational acceleration constant is g = 9.81 m/s^2. I would
recommend creating a constant for g.

- C does not have an exponent operator, therefore t^2 should be
written as t*t.

- The above example was computed as follows (in algebra, not C++):

d = (1/2) * 9.81 * 2.5^2
= (1/2) * 9.81 * 6.25
= 30.65625

Here is the code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
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.
Part II: Improving the Barometer Drop (self lab)
================================================
The professor, angry at the loss of his favorite barometer, was less
than patient when his wayward pupil returned. "You chowder head!
That barometer has been in my family for over 4 generations!", he
said. The boy replied "Sorry, but I was so excited, I also wrote
this program to go with it." Never missing a chance to read good
C++ code (I mean, who would pass it up?) he read over the work of
his student.

"Hmmm, this code is good. Not bad for a first attempt." the
professor said. "What do you mean not bad?", the student replied.
"Well, I would prefer if it could solve more aspects of the problem
at hand. For instance, we live in the US, and thanks to the
failings of Jimmy Carter, we still use the imperial system. It
would be nice if it could work in either imperial and SI units.
Also, it would be great if it could predict the number of seconds of
a fall from a given height, as well as the final velocity of the
fall."

The student thought it over for a second and said "Well, it would be
easy enough to store some choice variable about units. But what
about the other parts?" The professor went to the board and wrote
out several formulas in almost legible handwriting. He, of course,
quickly erased them, but our intrepid student captured them! After
all, he knows that you have to be quick on the draw to capture
professorial notes!

1 2
d = --- gt
2

________
| 2d
| ----
t = \| g


v = gt

Also, he noted something about g being different in imperial units
than it is in SI units. Unfortunately, the professor was too quick
with the eraser for him to capture that one. Oh well, that's why
google was invented!


Procedure
---------
We are going to modify your barometer program from lab 2. If you
haven't finished it yet, please take this opportunity to get caught
up. I will still give you credit for it, so long as you get it done
by the end of this lab. This will be the last such extension,
though future labs will include more time.

1. Modify the design of the program from last time to account for
the change in requirements. Below is a sample run to illustrate
how the changed program should behave:

---- begin sample run ----
Will you be working in:
1.) Metric
2.) Imperial
Choice?

What mode will you want?
1.) Height in terms of time.
2.) Time in terms of height

Drop your barometer.
How long was it until you heard a crashing sound (in seconds)? 2.5

Your building is 30.65 meters tall.
The final velocity of the barometer was 24.5 m/s.

Now, you do realize that barometers are filled with mercury,
right? Call the EPA NOW!
---- end sample run ----

Note that the final velocity is always printed, and it should
display the proper units.

Submit your design by the specified due date. Be sure to include
adequate test cases in both metric and imperial units for both
modes of operation.

2. Modify your code to allow for these changes.

3. Generate a script file containing a listing of your source code
(cat), your compile line (g++), and the runs of your program for
all of your test cases. Submit it by the due date listed above.
what's your prof got against Jimmy Carter?
huh?
here's a bit you may could use:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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";
}
I would read your post for $15
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..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#include <iostream>
#include <sstream>

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.