Answered step by step
Verified Expert Solution
Link Copied!
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 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

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students explore these related Databases questions