C++ into psuedo code?

Im having trouble making this code into psuedo code, any help would be appriciated

#include <iostream>

using namespace std;

void getArray(double arValues[10])

{

cout << "Please enter 10 numbers :" << endl;

for (int i = 0; i < 10; i++)

cin >> arValues[i];

}

void printArray(double arValues[10])

{

cout << "Numbers in array :" << endl;

for (int i = 0; i < 2; i++)

{

for (int j = 0; j < 5; j++)

cout << arValues[i * 5 + j] << " ";

cout << endl;

}

}

double getAverage(double arValues[10])

{

double dsum = 0;

for (int i = 0; i < 10; i++)

dsum += arValues[i];

return dsum / 10;

}

int main()

{

// array

double arValues[10];

// get 10 numbers from user

getArray(arValues);

// print array

printArray(arValues);

// calculate average and print it

cout << "Average of Array : " << getAverage(arValues);

return 0;

}

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2024 QUIZLS.COM - All rights reserved.