[solved] – Question 75737
Write a general MATLAB function for integrating experimental data using
Simpson’s 1/3 rule. Your function should check if there are an odd number of
intervals, if there are, the trapezoidal rule should be used for the last interval.
The first line of your MATLAB function should look like:
function I = Simpson(x,y)
Where the function numerically evaluates the integral of the vector of function
values ‘y’ with respect to ‘x’
Your matlab function should also include the following:
• Error check that the inputs are the same length
• Error check that the x input is equally spaced
• Warn the user (not an error, just a warning) if the trapezoidal rule has to
be used on the last interval.
Expert Answer
[solved] – Question 75741
Read a set of strings (one at a time) from a text file, input.txt. Each string begins on a new line in the input file and the number of strings is unknown. A line containing five & signs indicates the end of input data. The only additional characters, besides letters, permitted in a string, are spaces and punctuation characters (e.g. -, ’, “, .). A string may contain both uppercase and lowercase letters. Assume all input data are valid.
Expert Answer
[solved] – Question 75742
Write a program which implements stacks and queues using linked lists. You must provide the usual stack and queue operations. The use of the built-in stack and queue classes is NOT permitted. The use of the string class is NOT permitted.
Read a set of strings (one at a time) from a text file, input.txt. Each string begins on a new line in the input file and the number of strings is unknown. A line containing five & signs indicates the end of input data. The only additional characters, besides letters, permitted in a string, are spaces and punctuation characters (e.g. -, ’, “, .). A string may contain both uppercase and lowercase letters. Assume all input data are valid.
Expert Answer
[solved] – Question 75743
Write a program which implements stacks and queues using linked lists. You must provide the usual stack and queue operations. The use of the built-in stack and queue classes is NOT permitted. The use of the string class is NOT permitted.
Store each string that was read from a file in the stack as well as in the queue. The queue would have the string in the normal order and the stack would have the string in reverse order.
Expert Answer
[solved] – Question 75744
Write a program which implements stacks and queues using linked lists. You must provide the usual stack and queue operations. The use of the built-in stack and queue classes is NOT permitted. The use of the string class is NOT permitted.
For each string stored in the queue, determine if it is a palindrome by using the string in the stack (the stack contains the reversed version of the string).
Expert Answer
[solved] – Question 75745
A text file data.txt, contains at most 80 student marks in an exam. Each mark is out of 100. The last number in the file is -1 indicating that there is no more data in the file.
read all the marks in the data file and store in an array, print all the elements in the array
Expert Answer
[solved] – Question 75746
A text file data.txt, contains at most 80 student marks in an exam. Each mark is out of 100. The last number in the file is -1 indicating that there is no more data in the file.
print the percentage of elements in the array with an equal or greater mark than
o50
o70
o90
Expert Answer
[solved] – Question 75747
A text file data.txt, contains at most 80 student marks in an exam. Each mark is out of 100. The last number in the file is -1 indicating that there is no more data in the file.
reverse and print the order of the elements in the array
Expert Answer
[solved] – Question 75748
A text file data.txt, contains at most 80 student marks in an exam. Each mark is out of 100. The last number in the file is -1 indicating that there is no more data in the file.
You are required to print the average mark to an output file
Expert Answer

