Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

assignment should be modifieds program to read a file input of 255 characters or

ID: 3764463 • Letter: A

Question

assignment should be modifieds program to read a file input of 255 characters or less till the program runs. do not need to make another file to make this program work. Just make a blank one with a name for the program to grab and put into the program

exception: file name entered blank, then input might be from standard which is default input as it does .

program to read a file input of 255 characters untill the program runs

This is my assignment, not sure what my professor really is asking for,

but sure that this is not working when I attempt to excute.

Your assignment is to add optional file input and output functionality to the utility program ExtractDesign.

The functionality must remain the same with the exception that input or output may be optionally redirected to files and your program shall conform to the Homework Submission Requirements.

The program shall attempt to read an input file name until the file opens successfully.

(Microsoft states that the maximum length of Windows file names is 255 characters.)

An exception is that if the file name entered is blank, then input shall be from standard (default) input as it does now.

The program shall attempt to read an output file name until the file opens successfully.

An exception is that if the file name entered is blank, then output shall be to standard (default) output as it does now.

It is fortran

Explanation / Answer

/* * Sum the odd and even numbers, respectively, from 1 to a given upperbound. * Also compute the absolute difference. * (SumOddEven.c) */ #include // Needed to use IO functions int main() { int sumOdd = 0; // For accumulating odd numbers, init to 0 int sumEven = 0; // For accumulating even numbers, init to 0 int upperbound; // Sum from 1 to this upperbound int absDiff; // The absolute difference between the two sums // Prompt user for an upperbound printf("Enter the upperbound: "); scanf("%d", &upperbound); // Use %d to read an int // Use a while-loop to repeatedly add 1, 2, 3,..., to the upperbound int number = 1; while (number sumEven) { absDiff = sumOdd - sumEven; } else { absDiff = sumEven - sumOdd; } // Print the results printf("The sum of odd numbers is %d. ", sumOdd); printf("The sum of even numbers is %d. ", sumEven); printf("The absolute difference is %d. ", absDiff); return 0; }