EEGR-409, C Language Programming, Assignment #9

1.   Write a routine which continually prompts the user for a byte and performs the specified task.

For example;

   unsigned char val;

   printf("Enter a byte in hex: ");
   scanf("%x", &val);

   // now do the task

AA B  YYY ZZ

 AA is a character	00 - 'a', 01 -'b', 10 - 'y', 11 - 'z'
 B is whether lower or upper case
 YYY is the number of times to print the character (0 - 7)
 ZZ is the number of  $ between each character

2  Consider the following pole-zero constellation.  Evaluate the magnitude at 150 logarithmically
spaced points over the range of 10 to 10Krads.   Write this to a file and use spreadsheet to plot.

3.

Consider an array of strings.   Write a function to alphabetze the array.

    char names[80][6] = {"Washington", Jackson", "Jefferson, "Monroe", "Adams", "FDR"};

    alphabetize(names, num_names);

    // Now, the names should be ordered as Adams, FDR, Jackson, Jefferson, Monroe, Washington

4.

typedef struct E
{
   long id;
   char name[25];
   char tel[15]
   float wage;
} EMPLOYEE;


EMPLOYEE table[7] =
       {{1001, "Daphne Borromeo", "410-883-9880", 8.92},
        {1011, "Tammy Merriweather", "212-888-1212", 9.98},
        {1140, "Doris Perl", "301-555-1567", 7.78},
        {2045, "Barbara Wong", "410-444-2109", 7.88},
        {2945, "Diane Goegel", "213-949-3000", 9.95},
        {3300, "Irene Borreponi", "213-999-1345", 7.02},
        {4011, "Verinca Ockert", "802-256-7761", 10.80}};

Develop the following functions.

void print_table(EMPLOYEE table[], int num);
int find_id(EMPLOYEE table[], int num, int id);
int find_name(EMPLOYEE table[], int num, char name[]);
void alphabetize_table(EMPLOYEE table[], int num);

5.  Develop a program to integrate sin(x) / x at 100 points over the range of 0.0 to 4 * PI.  Write
the x and y values to a file and then use spreadsheet to plot the result.