Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Disjoint Dynamic Structure assignment: Voter You will write a C program menu drive program that will input data from a binary file named input.bin which
Disjoint Dynamic Structure assignment: Voter
You will write a C program menu drive program that will input data from a binary file named input.bin which should be located in the
SRC folder. The binary file will have the following layout:
First Bytes: The size of the array, the total number of elements within the array
Second Bytes: The effective size of the array, the total number of elements that have data
Remaining Bytes: The data from the Disjoint Memory Array of VOTERS as follows:
Field : NAME name
First Name Middle Initial Last Name
First and Last name sentence case
middle initial will be uppercase followed by a period if a middle initial exists
Field : char gender
upper case, domain: M F O or U
Field : int favoriteNumber
between and
Field : float weight
between and
You will have VOTER struct and a NAME struct, NAME will be a field in the VOTER struct
The program will load the VOTERS array from the binary file in to a DISJOINT MEMORY ARRAY.
The program will allow the user to enter additional records until the array is full or they do not wish enter
additional records. You must provide a way for them to stop entering information.
The program will correct all names for sentence case if necessary.
The program will correct the gender if the gender is not an M F or O then you must set it to U
The program will then pretend to simulate digit lottery drawings. You will notify the user how many times
their favorite number matched a drawing.
SKINNY peopleMales that weight poundsFemales that weight poundsthe other O or U that
weight Pounds
FIT peopleMales that weight and poundsFemales that weight pounds and
poundsthe other O or U that weight and pounds
FAT PeopleMales that weight poundsFemales that weight poundsthe other O or U that weight
The program will then traverse through the array and output the information for each person
Name Gender Favorite No Times Won Weight Weight Statement
Fred A Flintstone M FAT
Wilma Flintstone F FIT
Alex Trabek M SKINNY
The program will export VOTERS information back to the binary file using the same format as specified above.
You are to upload your design tool. Your source documents c and h or you can zip everything up NOTE: You will not
need to create a MENU SYSTEM. The program just needs to follow the steps from above. You are allowed to work with
exactly one other person if you wish or do it alone.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started