代写C++代码 代做C++程序 C++辅导 C++教学

C++网络家教 远程写代码 在线Debug 讲解答疑 不是中介,本人直接写

微信: ittutor QQ: 14061936 Email: ittutor@qq.com

导航

Convert your Matlab statistics functions to C.

Place all of the function in a single file (as this makes it much easier for me to grade). Convert the top-level routine (e.g., my_stats) to be the main (driver) routine. The main will call (exercise) all of the functions and display the output. Read the file "number_list.txt" to populate the list vector/array.

It will be easiest if you convert the routines one at a time.
mean    (my_mean)
maximum (my_max)
minimum (my_min)
range   (my_range)
median  (my_median)
mode    (my_mode)
variance (my_var)
standard deviation (my_std)

Make all of the functions return a double.
Have the mode return only a single mode.
The variance and standard deviation may be for the full population or a sample (to match Matlab use the one for a sample).

If you made use of some of the Matlab functions such as "sum", you will have to replace them with the appropriate code; better yet, replace this kind of function with one of your own much like you did previously with the "sort" function.

The squareroot function is in the standard math library (#include <math.h>).

I will download the file, compile it and then link (build) it to create the executable. I will then run the executable and look at your output to see if it outputs the values I expect.


Write a C function that will find a word (the short string) inside of a longer string. The function should return the position (within the long string) of the first letter of the word. Return a negative one (-1) if the word does not appear in the string.

Name the function "findword". The short string should appear as the first argument  (i.e., "w" below). The prototype for the function is

       intfindword(char w[], char s[]);

(You may use names other than "w" and "s".)

For example:

"world" appears in position 6 of "hello world!" (i.e., return a 6)

"hi" does not appear in "hello world!" (i.e., return a -1)


相关推荐