Design and write a C program that performs the following functionality: 1. Read your student number...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image 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: testq1.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. 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: testq1.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.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Design and write a C program that performs the following functionality: 1. Read first name and last name from the command line when you call the program executable. Example: testq2.exe Firstname...
-
Write a c program to implement phone book dictionary using Binary Search Tree which provides following operations: (a) add new entry in phone book, (b) remove entry from phone book, (c) search phone...
-
Write a C program by using function to reverse two number and sum them and reverse the result.
-
Assume that you are purchasing an investment and have decided to invest in a company in the digital phone business. You have narrowed the choice to Best Digital, Corp., and Every Zone, Inc., and have...
-
What is RFID? What are its advantages and disadvantages for a company?
-
Avalon Corporation engaged in the transactions listed in the first column of the following table. Opposite each transaction is a ratio and space to indicate the effect of each transaction on the...
-
On March 13, 1963, Ernesto Miranda was arrested for kidnapping and rape and taken to a Phoenix police station. After being identified by the complaining witness, he was questioned by two police...
-
Flight Caf is a company that prepares in-flight meals for airlines in its kitchen located next to the local airport. The companys planning budget for July appears below: In July, 17,800 meals were...
-
4. Write as a single power, then evaluate. Express answers in rational form. a) V55 -16 b) c) 284 7 18 (9) d) 2
-
The Genola Company manufactures insulated windows. Costs for March were as follows. Direct labor $53,000 Indirect labor 18,000 Salary of corporate vice president for advertising Direct materials...
-
Define the random process U(t) = A where A is uniform over [-1.1] a) Sketch a few sample realizations b) Determine its teporal autocorrelation function (defined below) c) Determine its statisitical...
-
Why are financial statements important to a business and how do they help businesses determine current financial health?
-
Compare results of the model for Adobe (ADBE) value and stock price to the actual value and stock price.What explains the differences?
-
1.Based on the Book Financial Markets and Institutions 20th Edition of Cabrera, What are the Different Private Non-Bank Financial Institutions available in the Philippines? What are their major...
-
500 kgmole/hr mutilcomponent mixture with 40% n-hexane, 30% heptanes and 30% n-octane is to be fed to a distillation column. The recovery of n-hexane in the top product is 98% and for the n-heptane...
-
Describe the complexity of managing multinational corporations and the risks they face when conducting international deals that are different from domestic deals?
-
4. Design Mod-6 synchronous down counter using T master slave FF. The counter continuously counts, starting from 0, going to 0-5-4-3-2-1-0 and then back to 5. Each FF in the clock cycle In order for...
-
Walker, Inc., is an all-equity firm. The cost of the company's equity is currently 11.4 percent and the risk-free.rate is 3.3 percent. The company is currently considering a project that will cost...
-
(a) Write a computer program that will perform the helium-atom SCF calculation of Section 14.3. Have the input to the program be 1, 2, and the initial guess for c11/c21. Do not use the Section 14.3...
-
A muon has the same charge and spin as an electron, but a heavier mass. What would be the ground-state configuration of a lithium atom with two electrons and one muon?
-
For which point groups can a molecule be optically active?
-
The business staff of the law firm Frampton, Davis & Smythe has constructed the following report that breaks down the firms overall results for last month into two business segmentsfamily law and...
-
The Excel worksheet form that appears below is to be used to recreate portions of Review Problem 1 relating to Dexter Corporation. Download the workbook containing this form from Connect, where you...
-
Millard Corporation is a wholesale distributor of office products. It purchases office products from manufacturers and distributes them in the West, Central, and East regions. Each of these regions...
Study smarter with the SolutionInn App