CSC3320 Midterm 2 Solved

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: zip solution files instantly, after Payment

Securely Powered by: Secure Checkout

Description

Rate this product

Questions 1-3 are 20pts each. Question 4 is 40pts
All programs have to be well commented. Non commented programs will receive 0 points. Comments have to be easily comprehensible and concise.

  1. Consider the array given below. Write a C program that must be able to sort the elements in the array. You must use pointers in your code to work with the arrays. The sort functionality must be implemented as a separate function named “sort_numeric()”

    Array for your evaluation

    [10, 0.25, -2342, 12123, 3.145435, 6, 6, 5.999, -2, -5, -109.56] If given user input A or a: sort in Ascending order
    If given user input D or d: sort in Descending order

  2. Considerthelistofnamesgivenbelow.WriteaCprogramthatwillfirstcreate a string array that will contain this list and then sort the elements in the array as per alphabetical order. You must use pointers in your code to work with the arrays. The sort functionality must be implemented as a separate function named “sort_alphabetic()”. The program can be case insensitive (i.e. capital or small letters are treated the same).

    List for your evaluation

    Systems Programming Deep Learning Internet Things Robotics Course

    If given user input A or a: sort in alphabetical order (a comes first)
    If given user input D or d: sort in reverse alphabetical order(z comes first)

  1. Repeat Question 1 or Question 2, considering that the number of elements can potentially increase. That is, the size of the array will be unknown at the start of the program. Note that the requirement of using pointers still holds.

    Show proof of evaluation of your program being able to work for more than 10 entries. Show 5 evaluation trials in your submission. You can pick any number of entries between 10 and 30 for your trials.

    (Hint: To solve this, use dynamic memory allocation, where you will NOT treat the input array as a known or finite size. Allocate memory space (e.g. malloc()) as and when the number of elements in the list increases).

  2. UsingCprogrammingandusingStructuresorUnionsinyourprogram,builda COVID vaccine registration form where any user can register by filling in their First Name, Last Name, Date of Birth (mm/dd/yyyy), Sex, Dose number (1 or 2), Date of previous dose, Type of vaccine (Pfizer, Moderna, Johnson&Johnson), Residential zipcode.

    Upon registration, the system must output a 8 letter alphanumeric code that will be unique to that user. The code is generated as <First letter of First Name><First Letter of Last Name><current age of user -as of registration date><First letter of Vaccine type><last 3 numbers of zipcode>

    Add functionality in your program such that it will display all the user’s information on the screen (one item in each line).

    Show an evaluation trial for registering at least 10 users. For registration, ,for relevant questions, users must choose values based on the options provided (e.g. sex; options must be Male/Female/Do not wish to identify)

    (Hint: Write a program that contains main(), register(), generate_code() and retrieve() functions, at the least).

  • Midterm2-gag2yu.zip