請幫我翻譯一段英文 ~~~

Write a program that finds the average, high and low values for an array of 1500 integers ranging in value from 0 to (and including) 2500.

*FillArray

is passed the integer array and total number (size) of the array. Uses the *rand() function to fill the array with values between 0 and 2500.

*AveArray

this function calculates the average of the array. It is passed the array, total number (size) and returns the average

*HighLow

this function is passed the array and the array size. It finds and returns the high and low values by reference.

Your main should declare an integer array sized to 1500. Call the three functions from main. Write the average and high and low values to the screen. Show these two data values using 4 decimal places of accuracy. Your screen output should be neatly presented.

1 個解答

• 6 年前
最佳解答

Write a program that finds the average, high and low values for an array of 1500 integers ranging in value from 0 to (and including) 2500.

*FillArray

is passed the integer array and total number (size) of the array. Uses the *rand() function to fill the array with values between 0 and 2500.

*AveArray

this function calculates the average of the array. It is passed the array, total number (size) and returns the average

*HighLow

this function is passed the array and the array size. It finds and returns the high and low values by reference.

Your main should declare an integer array sized to 1500. Call the three functions from main. Write the average and high and low values to the screen. Show these two data values using 4 decimal places of accuracy. Your screen output should be neatly presented.

編寫一個程序，發現平均而言，高值和低值為1500整數數組，值範圍從0至（並包括）2500。

* FillArray

傳遞數組的整數數組和總數量（大小）。使用* rand（）函數，以填補介於0和2500的數組的值。

* AveArray

本函數計算數組的平均值。它是通過在陣列中，總人數（大小），並返回平均值

* HIGHLOW

這個函數傳遞數組和數組的大小。它發現並參考返回高值和低值。

你的主要應該聲明一個整型數組大小為1500。從主調用這三個函數。寫的平均值和高值和低值到屏幕上。採用高精度的4位小數顯示這兩個數據值。您的屏幕輸出應該是整潔的。