Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 MTS Please submit these programs by : on by: uploading the c files to the MTS Moodle. You only need to submit the c file for each assignment. Your assignments are: Write a program to calculate:
rsin alpha xx 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 alpha Hint : You can get sin x using the function sin x from math. h Hint : Be careful at x In question on assignment 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 then inverses. txt should contain and the noinverses.txt should contain The program would print a message to the screen saying: The numbers.txt file had numbers with inverses and number without. Hint : Your program should use fopen, fscanf, fprintf and fclose. Hint : As with the first program, you will probably want to use an array. You can assume that numbers. txt contains at most. numbers.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started