Lab 11 Solution

$30.00

Category: Tag:

Description

SPECIFICATIONS

  • I have provided an unchangeable cscd240Lab11.c file. Your task is to write the functions.

  • You will need to create a structure named Stock.

  • The Stock structure will only contain

char symbol[10];

char companyName[100];

double currentPrice;

  • The menu portion will contain:

    1. Print the array sorted by symbol

    2. Print the array sorted by company name

    3. Print the array sorted by current price

    4. Quit

  • You must verify range of the menu.

  • The input will come from a file, name entered by the user. You must ensure the file opens.

  • There is nothing tricky here, no hidden agenda, just trying to get you to work with structures.

  • You must write your own sort, you can’t use qsort or any built in sort.

FILE STRUCTURE

symbol

company name

current price

TO TURN IN

Submit a zip file of Lab11

  • Containing your C files and H file(s)

  • My Makefile

  • Your input file(s)

  • Include an output captures from running your program named cscd240lab11output.txt.

  • NOTE: nothing dynamic here so no valgrind

Your zip will be named your last name first letter of your first name lab11.zip (Example: steinerslab11.zip)

SAMPLE RUN

Please choose from the following

  1. Sort by Symbol

  1. Sort by Company Name

  1. Sort by Price

  1. Quit

Choice –> 1

Google – GOOG – 721.110000

Hillenbrand Inc – HI – 30.650000

Microsoft – MSFT – 53.240000

Charles Schwab – SCHW – 31.370000

Please choose from the following

  1. Sort by Symbol

  1. Sort by Company Name

  1. Sort by Price

  1. Quit

Choice –> 2

Charles Schwab – SCHW – 31.370000

Google – GOOG – 721.110000

Hillenbrand Inc – HI – 30.650000

Microsoft – MSFT – 53.240000

Please choose from the following

  1. Sort by Symbol

  1. Sort by Company Name

  1. Sort by Price

  1. Quit

Choice –> 3

Hillenbrand Inc – HI – 30.650000

Charles Schwab – SCHW – 31.370000

Microsoft – MSFT – 53.240000

Google – GOOG – 721.110000

Please choose from the following

  1. Sort by Symbol

  1. Sort by Company Name

  1. Sort by Price

  1. Quit

Choice –> 4

all done


error: Content is protected !!