Answered step by step
Verified Expert Solution
Link Copied!

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 4 Bytes: The size of the array, the total number of elements within the array
Second 4 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 1: NAME name
(First Name(50), Middle Initial(1), Last Name(70))
(First and Last name sentence case)
(middle initial will be uppercase followed by a period if a middle initial exists)
Field 2: char gender(1)
(upper case, domain: M, F, O, or U)
Field 3: int favoriteNumber
(between 0 and 999)
Field 4: float weight
(between 10.0 and 999)
You will have VOTER struct and a NAME struct, NAME will be a field in the VOTER struct
1. The program will load the VOTERS array from the binary file in to a DISJOINT MEMORY ARRAY.
2. 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.
3. The program will correct all names for sentence case if necessary.
4. The program will correct the gender (if the gender is not an M, F, or O, then you must set it to U.
5. The program will then pretend to simulate 5003-digit lottery drawings. You will notify the user how many times
their favorite number matched a drawing.
6. SKINNY people->(Males that weight <125 pounds)(Females that weight <100 pounds)(the other O or U that
weight <115 Pounds)
7. FIT people->(Males that weight >=125 and <=225 pounds)(Females that weight >=100 pounds and <=150
pounds)(the other O or U that weight >=115 and <=200 pounds)
8. FAT People->(Males that weight >225 pounds)(Females that weight >150 pounds)(the other O or U that weight >
200)
9. 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 4445400 FAT
Wilma Flintstone F 2346122 FIT
Alex Trabek M 3324100 SKINNY
10. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions

Question

Define Administration and Management

Answered: 1 week ago

Question

Define organisational structure

Answered: 1 week ago

Question

Define line and staff authority

Answered: 1 week ago

Question

Define the process of communication

Answered: 1 week ago

Question

Explain the importance of effective communication

Answered: 1 week ago