online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
// Project 2: Stats Starter Code // The libraries have already been included for you! #include<iostream> #include<vector> using namespace std; /* First, we must define the functions we will be using. We know that we need to calculate the maximum, minimum, range, and mean, so you should write functions for each of these calculations. We also need to include a function that checks if the vectors are in ascending order. Keep in mind that we want all of these to return an int exxept for the last one, which should return a bool. */ // Maximum function - The base syntax has been provided for you for this one. int max(vector<int> v_in){ // Here, v_in is the input vector // your code here to calculate the maximum value // Hint: a foor loop and if statement may be useful here! return max_val; // outputs the maximum value; max_val should hold the largest number in the vector } // Minimum function - try the rest on your own! // Range function // Here, we need the max and min values using the funtions you just defined in order to calculate the range. // Mean function // Ascending function - should check to see if a vector is in ascending order /* Now that we have written all of the functions we will need, it's time to write the main code. */ int main(){ // Initialize the two vectors here - the first has been started for you vector<int> vec_one = // finish initializing it yourself // Create variables with the each of the values you need (you will call your functions here): // First vector variables int max_one = max(vec_one); // This one has been completed for you // Second vector variables // Now let's output our results! - This has been started for you // First Vector cout << "The first vector has the following properties:" << endl; cout << "max: " << max_one << endl; // Second Vector cout << "The second vector has the following properties:" << endl; return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue