Design and write a C program that performs the following functionality: 1. Read your student number on the command line when you call the program executable. Example: testq 1.exe 201314493 2. Check if...


Please include a DETAILED ALGORITHM OF THE CODE


Design and write a C program that performs the following functionality:<br>1. Read your student number on the command line when you call the program executable.<br>Example: testq 1.exe 201314493<br>2. Check if sufficient number of input arguments have been entered.<br>3. If insufficient number of input arguments have been entered, write an error message and<br>exit the program by returning minus (negative) one (-1);<br>4. Copy the student number into a string array and determine its length.<br>5. Prompt the user for their first and last name. Store these values.<br>6. Loop through each number in the student number and determine if the digit is even or odd.<br>For example, in the above example, the first and second digits are even (20), and the third<br>and fourth digits are odd (13).<br>7. If the number is even, then convert the number to the next odd number. For example, if the<br>number is 2, then add one to the number to make it an odd number, 2+1 = 3.<br>8. Hint: check the remainder to determine if a number is even (0) or odd (1)<br>9. If the digit is odd, then store the number as it currently is. For example, (3) will remain (3)<br>10. After you have checked all the digits in the student number array, print the first name, last<br>name and the odd version of the student number as shown below:<br>Captain Africa - the odd version of your student number is: 311315593<br>11. Return zero (0) and exit the function.<br>12. Add the detailed algorithm design steps in the Word document<br>13. Write and compile your code<br>14. Copy the code from IDE into IDE into Notepad to remove formatting and then copy and<br>paste from Notepad into the Word document.<br>

Extracted text: Design and write a C program that performs the following functionality: 1. Read your student number on the command line when you call the program executable. Example: testq 1.exe 201314493 2. Check if sufficient number of input arguments have been entered. 3. If insufficient number of input arguments have been entered, write an error message and exit the program by returning minus (negative) one (-1); 4. Copy the student number into a string array and determine its length. 5. Prompt the user for their first and last name. Store these values. 6. Loop through each number in the student number and determine if the digit is even or odd. For example, in the above example, the first and second digits are even (20), and the third and fourth digits are odd (13). 7. If the number is even, then convert the number to the next odd number. For example, if the number is 2, then add one to the number to make it an odd number, 2+1 = 3. 8. Hint: check the remainder to determine if a number is even (0) or odd (1) 9. If the digit is odd, then store the number as it currently is. For example, (3) will remain (3) 10. After you have checked all the digits in the student number array, print the first name, last name and the odd version of the student number as shown below: Captain Africa - the odd version of your student number is: 311315593 11. Return zero (0) and exit the function. 12. Add the detailed algorithm design steps in the Word document 13. Write and compile your code 14. Copy the code from IDE into IDE into Notepad to remove formatting and then copy and paste from Notepad into the Word document.
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here