Question: Final Assignment for MT 4 7 1 S Please submit these programs by 1 6 : 0 0 on 2 0 2 2 - 1

Final Assignment for MT471S Please submit these programs by 16:00 on 2022-12-16 by: - uploading the , c files to the MT471S Moodle. You only need to submit the . c file for each assignment. Your assignments are: 1. Write a program to calculate:
_0^rsin (\alpha x)/x d x
using the Simpson's rule. The program should read r and \alpha from the user and then choose the number of steps by making sure that the step size, h, satisfies h <=0.001/\alpha . Hint 1: You can get sin (x) using the function sin (x) from math. h. Hint 2: Be careful at x=0!2. In question 1 on assignment 3, we wrote a program that read a list of numbers and checked if each had a numbers had an inverse with respect to addition. In this question, you have to adapt your program to work with files. Write a program that reads the file numbers, txt which contains a list of numbers. It should make two new files: inverses.txt and noinverses . txt. The file called inverses.txt should contain all the numbers from the list that have an inverse. The file noinverses - txt should contain all the other numbers. The program should also display how many numbers are in each file. For example, if numbers.txt contains -2.00.03.22.0, then inverses. txt should contain -2.00.02.0 and the noinverses.txt should contain 3.2. The program would print a message to the screen saying: The numbers.txt file had 3 numbers with inverses and 1 number without. Hint 1: Your program should use fopen, fscanf, fprintf and fclose. Hint 2: As with the first program, you will probably want to use an array. You can assume that numbers. txt contains at most. 100 numbers.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!