assignment

hello i dont where to go but been trying, but here is the assignment


Write a program that first accepts an integer between 1 & 20 from cin.

This integer represents the number of values that will entered. We will call it N.

Then your program should allow the use to enter N integer numbers in a "built-in" array ( i.e. do not use the array or vector template).

Write a function to find the average of the values entered. The function should accept and array and N. Use a for loop with indexes.

Write a function to find the minimum value. The function should accept and array and N. The function should use a for loop using pointers. Return the minimum value via "pass by reference with pointer" instead of using the return value


here is what i got:

#include "stdafx.h"
#include <iostream>

using std::cin;
using std::cout;
using std::endl;

int main()
{
int number = 0;
cout << endl << "Enter a number: ";
cin >> number;

for (int i = 0; i <= number; i++)
{
if (i % 2 == 0 && i != 0)

{

cout << endl;
system("PAUSE");
return 0;
}
Task 1: get and number N. You do that, but do not check whether it is within [1..20]

Task 2: Get N numbers to an array. You don't do that. Yes, you do start a loop, but that iterates number+1 times and its body is most incomplete.

Task 3: calculate average in separate function. You apparently should know about functions.

Task 4 should be easy once you get that far.


Focus, think, and post with code tags, please.
yeah im behind right now in c++ and dont know how to still do stuff
Topic archived. No new replies allowed.