ECE 272 Organization of Computers Fall 2022ECE 2220 System Programming Concepts2 of 2 Program 2 –Data Types – Covid Shots For this project, each student is to write a menu-driven program called p2.c...

1 answer below »
needs to be in c language. with comments and well organized


ECE 272 Organization of Computers Fall 2022ECE 2220 System Programming Concepts2 of 2 Program 2 –Data Types – Covid Shots For this project, each student is to write a menu-driven program called p2.c that allows the user to enter and display data about Covid-19 shot manufacturers and data associated with each shot: · Storage types · Formatted input and output · Processing a menu · Handling uninitialized data · Verifying valid input Program Operation The program should have the following input options in a menu which perform the following tasks: · Enter Company Information · Enter Shot Information · Enter Shot Application · Display all Data · Clear all Data · Quit The specific format of the menu and its display is not specified, but it must be straight-forward and readable. The programmer must decide how to efficiently ask the user to enter which of the above commands is to be performed. Input The program should keep track of the following values for a single Company entered: · Company Name – A string with a maximum of 32 characters. · Company Country – A string up to 32 characters. · Company Phone Number – A twelve-digit number input and displayed as nn—###-###-####, where nn can be one or two digits. · Company E-mail Address – A string up to 32 characters. · Shot Cost in US Dollars – A decimal point number from $0.00 to $999,999.99. · Recommended Shot Doses – An integer from 1 to 255. · Recommended Shot Dosage – A decimal number from 0.1 to 100.0 mL. · FDA Approval – Stored as a one or zero. · Total Shot Doses Sold – An integer from 0 to 100 billion. · Total Shot Sales – A decimal number from 0 to $9,999,999,999,999.99. · Total Shot Injuries – An integer from 0 to 4 billion. · Total Shot Deaths – An integer from 0 to 1 billion. Notes: Initially, all quantities are to be initialized as an “unknown value” and should be denoted as such when displayed. It’s up to the programmer to decide what values to store to represent unknown values. All variables should use the smallest types required to store each value. An error message should be displayed if an invalid option is chosen. For the options requiring data input, the program should prompt for the appropriate data when the option is selected. If the corresponding data input is invalid, an error message should be given explaining the problem. Upon completing any option (except “Quit”), the program should redisplay the menu. For the pharmaceutical company’s country, the program should prompt the user to input the first letter of the country. After a single letter is entered, the program should display all countries beginning with that letter along with the abbreviations for those countries while prompting the user to enter the abbreviation for the desired country. The abbreviations to be used can be found at https://travel.state.gov/content/travel/en/us-visas/visa-information-resources/fees/country-acronyms.html For the company’s e-mail address, the program should check to ensure an ampersand (@) and a period (.) are present in the address string. The program should continue to take input commands until “Quit” is entered, upon which it should terminate. Note that a line feed (0x10) may be left in the stdin input buffer and must be removed for the input loop to function properly. Notice that certain string inputs may contain spaces, therefore fgets and not scanf should be used. Output The program should only display data if that option is selected. When it is selected, the program should print all data indicating which—if any—data is unknown or uninitialized. When displaying the data, two calculated values should also be displayed which are equal to the number of injuries per does and number of deaths per dose displayed as percentages. The country name for the abbreviation displayed, not the abbreviation. FDA approval should be displayed as “Yes” or “No”. Further Considerations Your program should be structured neatly, easily readable, and well commented. Furthermore, variable and function names should be such that the software is as “self-commenting” as possible. Creation and Submission Work must be completed by each individual student, and only that student. Students must not use code from another student or copied from a book or internet source. Students must not allow other students to copy from their code or make it possible for students to do so by making their code available to be copied. Sharing of code will not be tolerated and will be tested for. Any such act of cheating will result in failing the class and may result in dismissal from the University. Use the following line to compile your program gcc -Wall -g p2.c -o p2 [-lm] The code you submit must compile using the –Wall flag and no compiler errors or warnings should be printed. To receive credit for this assignment your code must compile and at a minimum perform some required function. Code that does not compile or crashes before performing some required function will not be accepted or graded. All students must do a final check on one of the CES Ubuntu machines to verify that gcc using Ubuntu shows no warning messages before submitting your project. Submit your program on Canvas before midnight on Monday, February 7th. MP1 grading criteria Name:Final score: ECE 222 MP1 grading criteria Late Deduction: Correctness 50 points Compiles Compiler warnings Runs Requires fix Errors when reading code Array boundary violation Correct input format Correct output format A series of test scripts are run against your code. Code design 25 points No global variables Named constants Header files Structured design Deviations from required design Documentation 25 points Comment block at top of each file Purpose Assumptions Known bugs Function comments Inline comments Meaningful names
Answered 2 days AfterFeb 04, 2022

Answer To: ECE 272 Organization of Computers Fall 2022ECE 2220 System Programming Concepts2 of 2 Program 2...

Vaibhav answered on Feb 07 2022
113 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here