SlideShare a Scribd company logo
{c}
Problem: Run For Charity (charityrun.c)
Charity Runs are a popular way for organizations to raise awareness and get fit at the same time.
However, these events can be tough to organize. The Princess Half Marathon Weekend, for
example, has as many as 40,000 runners raising money and awareness for the Children’s Miracle
Network Hospitals. People can run both 5ks and 10ks and there’s even a children’s race.
After nearly a semester of C programming, you've decided that you'd like to donate your skills
to create a program that organizes the typical activities for charity run weekend. In particular,
your program will help manage the following:
1) Individual Registration
2) Team Registration
3) Running Events
4) Donation Totals
Your program will log the number of teams and individual who are signed up for the different
races, process the racing events to see who has the fastest times, and track the total amount of
money raised by teams and individuals for charity.
Header Specification
To facilitate grading, include in your header comment which portions of the assignment you
have completed. You must complete all portions in order to earn full credit, but partial credit is
available for completing some of the steps. The primary steps are as follows:
(1) Processing Individual Registrations
(2) Processing Team Registrations
(3) Processing the running events
(4) Calculating total donations
If your comment is accurate, meaning that you pass the appropriate tests cases corresponding to
your choice, you'll earn 10 points. If your comment is roughly accurate, meaning that you
sincerely attempted the items you listed, and most of them work minus a tiny bug, then you'll
get 5 of these points. If your comment isn't accurate to a reasonable degree, you'll get 0 of these
points.
The reason this is here is because it's very important to communicate to others accurately what
you've accomplished and what is left to accomplish. This sort of honesty and ability to appraise
your own work is a critical skill in a job.
Program Details
Individual RegistrationDetails
There are a two registration windows: early registration and regular registration. Prices for
registering early and regularly will be given. Each individual will have a unique number and
must be processed separately to record their name, age, running event, and donations raised. The
maximum number of runners for our program will be 10000.
Team RegistrationDetails
Teams may be created and registered to sign up several participators at once. Teams may only
sign up during early registration, have between 5 and 50 members, and must pay the team
registration fee for every member on the team. Teams should be recorded with their name and
number of members. Each member of the team still needs to be recorded with their name, age,
running event, and donations raised. We can organize at most 200 teams.
Running EventsDetails
There will be three running events: a 5k race, a 10k race, and a marathon race. For each race,
your program will receive the running time for each participant in the race. For the 5k and the
10k you should print the runner with the fastest time. For the marathon, your program will need
to check times against the required qualifying times to see which runners qualify for more
marathon races. These qualifying times vary by age group.
Total Donation Details
After all the races are run we want to recognize the participants who raised the most money for
charity. Print the team that raised the most money for the event along with the amount raised.
Then for each team, print the team member who raised the most money along with the amount
raised. For the individuals, print the top individual who raised the most money along with the
amount raised. Finally, print the total amount raised for the event. All donations and registration
fees will be donated directly to charity.
Implementation Restrictions
You must use the following constants:
#define TEAMS 200
#define RUNNERS 10000
#define LENGTH 20
#define TEAMSIZE 50
You must use the following structures to store information:
struct person {
char name[LENGTH];
int number;
int age;
int event;
float money;
float time;
};
struct team {
char name[LENGTH];
int nummembers;
float money;
struct person members[TEAMSIZE];
};
It is not sufficient to simply have the structures in your program, you must use them store
information and process operations for the program.
Though function prototypes will not be provided, it is expected that you follow good
programming design and create several functions with well-specified tasks related to the solution
of this problem. Make sure to pay very careful attention to parameter passing.
Input Specification
The first line of the file contains the following three values, separated by spaces:
Cost of early registration for individuals (in dollars), Cost of regular registration for individuals
(in dollars), and the cost of team registration (in dollars). These will be positive real numbers to
two decimal places.
The second line of the file will contain one positive integer representing the number of early
individuals and teams who are registering. Every registration will start with either TEAM or
INDV for a team registration or individual registration respectively.
Lines that begin with INDV will be followed by four values, separated by spaces:
The individual’s name, their age, their chosen running event, and the amount of
donations they have raised. The first is a string, the second is a positive integer, the third is an
integer from the set {5, 10, 42}, and the fourth is a positive real number.
Lines that begin with TEAM will be followed by two values, separated by spaces: the name of
the team and the number of team members (k). This will be followed by k lines organized the
same as the individual registration above.
After early registration completes, normal registration can begin. This will be represented by one
positive integer (m) representing the number of regular registrations. All teams must use early
registration. This will be followed by m lines each with four values. These are the same values
that are present in individual registration: The team member’s name, their age, their chosen
running event, and the amount of donations they have raised. The first is a string, the second is a
positive integer, the third is an integer from the set {5, 10, 42}, and the fourth is a positive real
number.
After registration, the running events can occur. Every registered participant will be listed with
their number (assigned as part of registration) and the time it took them to run the race in minutes
represented as a real number.
This will be followed by 10 lines of qualifying times based on age groups. They will be
specified:
STARTINGAGE ENDINGAGE TIME
where starting age and ending age are integers, and the qualifying time is a real number
representing minutes.
Output Specification
For an individual registering for an event print a line of the form:
X registered for the Y race! They have been assigned the number Z.
where X is their name and Y is the event they are registering for. Y is represented by an integer
{5, 10, 42} in the input file. Replace it with “5k” for the first integer, “10k” for the second
integer, and “marathon” for the third integer in this print statement. Z is their unique runner
number. These numbers should start at 1 and count up to a max of 10000.
For a team registering print a line with one of the form:
X team registered for the event. They have Y members:
where X is the team name and Y is their number of members. Follow this with Y lines of the
same form as the individuals: one for each member of the team.
For the 5k race and the 10k race, output a single line of the following form:
Xk race: Y had the fastest time with Z.Z minutes!
where X is either 5 or 10 respectively, Y represents the name of the fastest runner and Z
represents their time.
For the marathon race, print out all the runners who times meet the qualifying times:
X qualified in the marathon run with a time of Y.Y minutes!
where X represents the name of the fastest runner and Y represents their time.
For the team that raised the most money, output a single line of the following form:
The X team raised the most money with a team donation of $Y.YY!
where X is the team name and Y is the amount they raised.
For each team, print out the person that raised the most with a single line of the following form:
X raised the most money on team Y with a donation of $Z.ZZ!
where X is the person’s name, Y is the team name, and Z is the amount they raised.
For the individual that raised the most money, output a single line of the following form:
X raised $Y.YY!
where X is the person’s name and Y is the amount they raised.
End with the total amount raised by the event:
The runners raised $X.XX for charity!
Sample Input/Output
Four sets of input and output are provided with the assignment, showing the different portions of
the assignment. You should try to complete race01 first, then proceed to race02, and so forth.
Each test file is labeled as raceXX.txt for input and raceXX.out for output. Out files can be
opened in notepad and other unformatted text editors.
Deliverables
A single source file named charityrun.c turned in through WebCourses.
Restrictions
Although you may use other compilers, your program must compile in gcc and run in
Code::Blocks. Your program should include a header comment with the following information:
your name, course number, section number, assignment title, and date. Make sure you include
comments throughout your code describing the major steps in solving the problem.
Make sure to use good programming style, including use of appropriate constants, good variable
names and good use of white space.
Grading Details
Your programs will be graded upon the following criteria:
1) Your correctness
2) Your programming style and use of white space. Even if you have a plan and your program
works perfectly, if your programming style is poor or your use of white space is poor, you could
get 10% or 15% deducted from your grade.
3) Compatibility – You must submit C source files that can be compiled and executed in a
standard C Development Environment. If your program does not compile, you will get a sizable
deduction from your grade.
4) Header Comment - In your header comment, you must state which portions of the assignment
you have implemented. Your choices are as follows:
(1) Processing Individual Registrations
(2) Processing Team Registrations
(3) Processing run events
(4) Calculating total donations
If your comment is accurate, meaning that you pass the appropriate tests cases corresponding to
your choice, you'll earn 10 points. If your comment is roughly accurate, meaning that you
sincerely attempted the items you listed, and most of them work minus a tiny bug, then you'll
get 5 of these points. If your comment isn't accurate to a reasonable degree, you'll get 0 of these
points.
The reason this is here is because it's very important to communicate to others accurately what
you've accomplished and what is left to accomplish. This sort of honesty and ability to appraise
your own work is a critical skill in a job.
INPUT #1:
25.5 35.75 21
5
INDV Emily 30 5 10
INDV Karla 27 10 25.6
INDV Martin 45 5 33.75
INDV Lucas 23 42 100
INDV Hayley 34 42 27.43
7
George 50 10 90.3
Evelyn 47 5 15.4
Linus 55 10 22.8
Charlie 40 42 150.75
Lucy 24 10 14.89
Leah 42 5 23.45
Thomas 29 5 10.6
OUTPUT #1:
INPUT #2:
25.5 35.75 21
7
INDV Emily 30 5 10
INDV Karla 27 10 25.6
INDV Martin 45 5 33.75
TEAM OATS 5
Maria 22 5 15.62
Caleb 41 10 20.5
Micahel 30 42 18.75
Lily 33 10 31.15
Charlotte 29 5 25.8
INDV Lucas 23 42 100
INDV Hayley 34 42 27.43
TEAM RAINBOW 3
Lawrence 56 5 33.75
David 55 5 33.75
Josie 60 5 33.75
7
George 50 10 90.3
Evelyn 47 5 15.4
Linus 55 10 22.8
Charlie 40 42 150.75
Lucy 24 10 14.89
Leah 42 5 23.45
Thomas 29 5 10.6
OUTPUT #2:
INPUT #3:
25.5 35.75 21
7
INDV Emily 30 5 10
INDV Karla 27 10 25.6
INDV Martin 45 5 33.75
TEAM OATS 5
Maria 22 5 15.62
Caleb 41 10 20.5
Michael 30 42 18.75
Lily 33 10 31.15
Charlotte 29 5 25.8
INDV Lucas 23 42 100
INDV Hayley 34 42 27.43
TEAM RAINBOW 3
Lawrence 56 5 33.75
David 55 5 30.15
Josie 60 5 13.79
7
George 50 10 90.3
Evelyn 47 5 15.4
Linus 55 10 22.8
Charlie 40 42 150.75
Lucy 24 10 14.89
Leah 42 5 23.45
Thomas 29 5 10.6
1 40
2 75
3 35
4 30
5 80
6 200
7 82
8 32
9 230
10 213
11 37
12 25
13 33
14 78
15 31
16 82
17 235
18 77
19 36
20 29
18 34 215
35 39 220
40 44 225
45 49 235
50 54 240
55 59 250
60 64 265
65 69 280
70 74 295
75 79 310
OUTPUT #3:
INPUT #4:
25.5 35.75 21
7
INDV Emily 30 5 10
INDV Karla 27 10 25.6
INDV Martin 45 5 33.75
TEAM OATS 5
Maria 22 5 15.62
Caleb 41 10 20.5
Michael 30 42 18.75
Lily 33 10 31.15
Charlotte 29 5 25.8
INDV Lucas 23 42 100
INDV Hayley 34 42 27.43
TEAM RAINBOW 3
Lawrence 56 5 33.75
David 55 5 30.15
Josie 60 5 13.79
7
George 50 10 90.3
Evelyn 47 5 15.4
Linus 55 10 22.8
Charlie 40 42 150.75
Lucy 24 10 14.89
Leah 42 5 23.45
Thomas 29 5 10.6
1 40
2 75
3 35
4 30
5 80
6 200
7 82
8 32
9 230
10 213
11 37
12 25
13 33
14 78
15 31
16 82
17 235
18 77
19 36
20 29
18 34 215
35 39 220
40 44 225
45 49 235
50 54 240
55 59 250
60 64 265
65 69 280
70 74 295
75 79 310
OUTPUT #4:
Solution
Program:-
#define _CRT_SECURE_NO_WARNINGS
//different header files are defined
#include
#include
#include
#include
// defined according to the question
#define TEAMS1 200
#define RUNNERS1 10000
#define LENGTH1 20
#define TEAMSIZE1 50
FILE *ifp1;
void information1(int);
struct person1
{
// diffrerent varibles are defined
char name1[LENGTH1];
char lname1[LENGTH1];
int number1;
int age1;
int event1;
float money1;
float time1;
}
person1;
struct team1
{
//needed variables are defined
char name1[LENGTH1];
float money1;
struct person1 members1[TEAMSIZE1];
}
team1;
int main()
{
ifp1 = fopen("input.txt", "r");
int choice1, flag1 = 0, idx1 = 0, idx2 = 0;
fscanf(ifp1, "%d", &choice1);
while (!feof(ifp1))
{
information1(++idx1);
}
fclose(ifp1);
getchar();
getchar();
return 0;
}
void information1(int idx1)
{
if (idx1 < 6) // conditional if else statement is used
fscanf(ifp1, "%f", &person1.money1);
fscanf(ifp1, "%d", &person1.age1); // pass int data type for person’s age
fscanf(ifp1, "%s", person1.name1); // pass char datatype for person’s name
fscanf(ifp1, "%d", &person1.event1); // pass int data type for person’s event
fscanf(ifp1, "%s", person1.lname1);
if (person1.event1 == 42)
printf(" %s register for marathon race! they have been assigned number1 is %d.",
person1.name1, idx1);//print
else // conditional statement if else
printf(" %s register for %dk race! they have been assigned number1 is %d.", person1.name1,
person1.event1, idx1);
} // print
INPUT #1:
25.5 35.75 21
5
INDV Emily 30 5 10
INDV Karla 27 10 25.6
INDV Martin 45 5 33.75
INDV Lucas 23 42 100
INDV Hayley 34 42 27.43
7
George 50 10 90.3
Evelyn 47 5 15.4
Linus 55 10 22.8
Charlie 40 42 150.75
Lucy 24 10 14.89
Leah 42 5 23.45
Thomas 29 5 10.6
OUTPUT #1:
INPUT #2:
25.5 35.75 21
7
INDV Emily 30 5 10
INDV Karla 27 10 25.6
INDV Martin 45 5 33.75
TEAM OATS 5
Maria 22 5 15.62
Caleb 41 10 20.5
Micahel 30 42 18.75
Lily 33 10 31.15
Charlotte 29 5 25.8
INDV Lucas 23 42 100
INDV Hayley 34 42 27.43
TEAM RAINBOW 3
Lawrence 56 5 33.75
David 55 5 33.75
Josie 60 5 33.75
7
George 50 10 90.3
Evelyn 47 5 15.4
Linus 55 10 22.8
Charlie 40 42 150.75
Lucy 24 10 14.89
Leah 42 5 23.45
Thomas 29 5 10.6
OUTPUT #2:
INPUT #3:
25.5 35.75 21
7
INDV Emily 30 5 10
INDV Karla 27 10 25.6
INDV Martin 45 5 33.75
TEAM OATS 5
Maria 22 5 15.62
Caleb 41 10 20.5
Michael 30 42 18.75
Lily 33 10 31.15
Charlotte 29 5 25.8
INDV Lucas 23 42 100
INDV Hayley 34 42 27.43
TEAM RAINBOW 3
Lawrence 56 5 33.75
David 55 5 30.15
Josie 60 5 13.79
7
George 50 10 90.3
Evelyn 47 5 15.4
Linus 55 10 22.8
Charlie 40 42 150.75
Lucy 24 10 14.89
Leah 42 5 23.45
Thomas 29 5 10.6
1 40
2 75
3 35
4 30
5 80
6 200
7 82
8 32
9 230
10 213
11 37
12 25
13 33
14 78
15 31
16 82
17 235
18 77
19 36
20 29
18 34 215
35 39 220
40 44 225
45 49 235
50 54 240
55 59 250
60 64 265
65 69 280
70 74 295
75 79 310
OUTPUT #3:
INPUT #4:
25.5 35.75 21
7
INDV Emily 30 5 10
INDV Karla 27 10 25.6
INDV Martin 45 5 33.75
TEAM OATS 5
Maria 22 5 15.62
Caleb 41 10 20.5
Michael 30 42 18.75
Lily 33 10 31.15
Charlotte 29 5 25.8
INDV Lucas 23 42 100
INDV Hayley 34 42 27.43
TEAM RAINBOW 3
Lawrence 56 5 33.75
David 55 5 30.15
Josie 60 5 13.79
7
George 50 10 90.3
Evelyn 47 5 15.4
Linus 55 10 22.8
Charlie 40 42 150.75
Lucy 24 10 14.89
Leah 42 5 23.45
Thomas 29 5 10.6
1 40
2 75
3 35
4 30
5 80
6 200
7 82
8 32
9 230
10 213
11 37
12 25
13 33
14 78
15 31
16 82
17 235
18 77
19 36
20 29
18 34 215
35 39 220
40 44 225
45 49 235
50 54 240
55 59 250
60 64 265
65 69 280
70 74 295
75 79 310
OUTPUT #4:

More Related Content

Similar to {c}Problem Run For Charity (charityrun.c)Charity Runs are a pop.pdf

Hyperion step by step guide
Hyperion step by step guideHyperion step by step guide
Hyperion step by step guide
chalasani kamesh
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2
Animesh Chaturvedi
 
HSN - The Political Network
HSN - The Political NetworkHSN - The Political Network
HSN - The Political Network
HFT
 
System Analysis & Design (NCC Education)
System Analysis & Design (NCC Education)System Analysis & Design (NCC Education)
System Analysis & Design (NCC Education)
Md. Mahbub Alam
 
If switch structure
If switch structureIf switch structure
If switch structure
M Sagheer Malik
 
C Programming
C ProgrammingC Programming
C Programming
Prince Kumar
 
EPF E Return FAQ
EPF E Return FAQEPF E Return FAQ
EPF E Return FAQ
Santosh Chinera
 
Can I Buy An Essay Now Oelbert Gymnasiumoelbert
Can I Buy An Essay Now Oelbert GymnasiumoelbertCan I Buy An Essay Now Oelbert Gymnasiumoelbert
Can I Buy An Essay Now Oelbert Gymnasiumoelbert
Angela Gibbs
 
CIS 115 Inspiring Innovation/tutorialrank.com
 CIS 115 Inspiring Innovation/tutorialrank.com CIS 115 Inspiring Innovation/tutorialrank.com
CIS 115 Inspiring Innovation/tutorialrank.com
jonhson110
 
Freelance Academy Virtual Platform Plan.pptx
Freelance Academy Virtual Platform Plan.pptxFreelance Academy Virtual Platform Plan.pptx
Freelance Academy Virtual Platform Plan.pptx
obeidhamza
 
January 5, 2018: Colorado Coach Connection -
January 5, 2018: Colorado Coach Connection -January 5, 2018: Colorado Coach Connection -
January 5, 2018: Colorado Coach Connection -
ICF Colorado
 
May 5, 2018: Colorado Coach Connection
May 5, 2018: Colorado Coach ConnectionMay 5, 2018: Colorado Coach Connection
May 5, 2018: Colorado Coach Connection
ICF Colorado
 
Luxury ventures corporation_eng
Luxury ventures corporation_engLuxury ventures corporation_eng
Luxury ventures corporation_engOleg Ivaniloff
 
CIS 115 Effective Communication - tutorialrank.com
CIS 115  Effective Communication - tutorialrank.comCIS 115  Effective Communication - tutorialrank.com
CIS 115 Effective Communication - tutorialrank.com
Bartholomew18
 
Induction Session (LC Islamabad) - Summer Exchange Recruitment 2014
Induction Session (LC Islamabad) - Summer Exchange Recruitment 2014Induction Session (LC Islamabad) - Summer Exchange Recruitment 2014
Induction Session (LC Islamabad) - Summer Exchange Recruitment 2014
Tahira Naseem
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
Abir Hossain
 
December 20, 2017: Colorado Coach Connection
December 20, 2017: Colorado Coach ConnectionDecember 20, 2017: Colorado Coach Connection
December 20, 2017: Colorado Coach Connection
ICF Colorado
 
January 20, 2018: Colorado Coach Connection
January 20, 2018: Colorado Coach Connection January 20, 2018: Colorado Coach Connection
January 20, 2018: Colorado Coach Connection
ICF Colorado
 

Similar to {c}Problem Run For Charity (charityrun.c)Charity Runs are a pop.pdf (19)

Hyperion step by step guide
Hyperion step by step guideHyperion step by step guide
Hyperion step by step guide
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2
 
HSN - The Political Network
HSN - The Political NetworkHSN - The Political Network
HSN - The Political Network
 
System Analysis & Design (NCC Education)
System Analysis & Design (NCC Education)System Analysis & Design (NCC Education)
System Analysis & Design (NCC Education)
 
If switch structure
If switch structureIf switch structure
If switch structure
 
C Programming
C ProgrammingC Programming
C Programming
 
EPF E Return FAQ
EPF E Return FAQEPF E Return FAQ
EPF E Return FAQ
 
Can I Buy An Essay Now Oelbert Gymnasiumoelbert
Can I Buy An Essay Now Oelbert GymnasiumoelbertCan I Buy An Essay Now Oelbert Gymnasiumoelbert
Can I Buy An Essay Now Oelbert Gymnasiumoelbert
 
CIS 115 Inspiring Innovation/tutorialrank.com
 CIS 115 Inspiring Innovation/tutorialrank.com CIS 115 Inspiring Innovation/tutorialrank.com
CIS 115 Inspiring Innovation/tutorialrank.com
 
Freelance Academy Virtual Platform Plan.pptx
Freelance Academy Virtual Platform Plan.pptxFreelance Academy Virtual Platform Plan.pptx
Freelance Academy Virtual Platform Plan.pptx
 
January 5, 2018: Colorado Coach Connection -
January 5, 2018: Colorado Coach Connection -January 5, 2018: Colorado Coach Connection -
January 5, 2018: Colorado Coach Connection -
 
May 5, 2018: Colorado Coach Connection
May 5, 2018: Colorado Coach ConnectionMay 5, 2018: Colorado Coach Connection
May 5, 2018: Colorado Coach Connection
 
End term
End term End term
End term
 
Luxury ventures corporation_eng
Luxury ventures corporation_engLuxury ventures corporation_eng
Luxury ventures corporation_eng
 
CIS 115 Effective Communication - tutorialrank.com
CIS 115  Effective Communication - tutorialrank.comCIS 115  Effective Communication - tutorialrank.com
CIS 115 Effective Communication - tutorialrank.com
 
Induction Session (LC Islamabad) - Summer Exchange Recruitment 2014
Induction Session (LC Islamabad) - Summer Exchange Recruitment 2014Induction Session (LC Islamabad) - Summer Exchange Recruitment 2014
Induction Session (LC Islamabad) - Summer Exchange Recruitment 2014
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
 
December 20, 2017: Colorado Coach Connection
December 20, 2017: Colorado Coach ConnectionDecember 20, 2017: Colorado Coach Connection
December 20, 2017: Colorado Coach Connection
 
January 20, 2018: Colorado Coach Connection
January 20, 2018: Colorado Coach Connection January 20, 2018: Colorado Coach Connection
January 20, 2018: Colorado Coach Connection
 

More from armcomputers

Homework 3 P11Is this relation a function    (Write either Yes.pdf
Homework 3 P11Is this relation a function    (Write either Yes.pdfHomework 3 P11Is this relation a function    (Write either Yes.pdf
Homework 3 P11Is this relation a function    (Write either Yes.pdf
armcomputers
 
i have a runable code below that works with just guessing where the .pdf
i have a runable code below that works with just guessing where the .pdfi have a runable code below that works with just guessing where the .pdf
i have a runable code below that works with just guessing where the .pdf
armcomputers
 
Find Tukey-Kramer resultsa. Group 1 to Group 2 Different Not D.pdf
Find Tukey-Kramer resultsa. Group 1 to Group 2 Different  Not D.pdfFind Tukey-Kramer resultsa. Group 1 to Group 2 Different  Not D.pdf
Find Tukey-Kramer resultsa. Group 1 to Group 2 Different Not D.pdf
armcomputers
 
Female copperhead snakes have the ability to reproduce both sexually.pdf
Female copperhead snakes have the ability to reproduce both sexually.pdfFemale copperhead snakes have the ability to reproduce both sexually.pdf
Female copperhead snakes have the ability to reproduce both sexually.pdf
armcomputers
 
Explain some of the commonly held misconceptions about cloning. Why .pdf
Explain some of the commonly held misconceptions about cloning. Why .pdfExplain some of the commonly held misconceptions about cloning. Why .pdf
Explain some of the commonly held misconceptions about cloning. Why .pdf
armcomputers
 
Describe nN when the number of positive divisors of n is i) p2 for .pdf
Describe nN when the number of positive divisors of n is i) p2 for .pdfDescribe nN when the number of positive divisors of n is i) p2 for .pdf
Describe nN when the number of positive divisors of n is i) p2 for .pdf
armcomputers
 
Describe one derived trait in humans (Homo sapiens).SolutionThe.pdf
Describe one derived trait in humans (Homo sapiens).SolutionThe.pdfDescribe one derived trait in humans (Homo sapiens).SolutionThe.pdf
Describe one derived trait in humans (Homo sapiens).SolutionThe.pdf
armcomputers
 
Consider the table below How many featuresattributes are in this s.pdf
Consider the table below  How many featuresattributes are in this s.pdfConsider the table below  How many featuresattributes are in this s.pdf
Consider the table below How many featuresattributes are in this s.pdf
armcomputers
 
Chickens vary in color. Black and white color variation can be traced.pdf
Chickens vary in color. Black and white color variation can be traced.pdfChickens vary in color. Black and white color variation can be traced.pdf
Chickens vary in color. Black and white color variation can be traced.pdf
armcomputers
 
write a program that given a list of 20 integers, sorts them accordi.pdf
write a program that given a list of 20 integers, sorts them accordi.pdfwrite a program that given a list of 20 integers, sorts them accordi.pdf
write a program that given a list of 20 integers, sorts them accordi.pdf
armcomputers
 
Why is the 16S rRNA gene a preferred marker for the identification, .pdf
Why is the 16S rRNA gene a preferred marker for the identification, .pdfWhy is the 16S rRNA gene a preferred marker for the identification, .pdf
Why is the 16S rRNA gene a preferred marker for the identification, .pdf
armcomputers
 
Why do SSDs benefit from a scheduler like noopSolutionThe def.pdf
Why do SSDs benefit from a scheduler like noopSolutionThe def.pdfWhy do SSDs benefit from a scheduler like noopSolutionThe def.pdf
Why do SSDs benefit from a scheduler like noopSolutionThe def.pdf
armcomputers
 
which of the following types of orgnisms possess the enzyme catalase.pdf
which of the following types of orgnisms possess the enzyme catalase.pdfwhich of the following types of orgnisms possess the enzyme catalase.pdf
which of the following types of orgnisms possess the enzyme catalase.pdf
armcomputers
 
Which of the five factors of production is most important for creati.pdf
Which of the five factors of production is most important for creati.pdfWhich of the five factors of production is most important for creati.pdf
Which of the five factors of production is most important for creati.pdf
armcomputers
 
What is the good producing business What is the good producing.pdf
What is the good producing business What is the good producing.pdfWhat is the good producing business What is the good producing.pdf
What is the good producing business What is the good producing.pdf
armcomputers
 
What is the future of PKI Acceptance of PKI solutions—and product s.pdf
What is the future of PKI Acceptance of PKI solutions—and product s.pdfWhat is the future of PKI Acceptance of PKI solutions—and product s.pdf
What is the future of PKI Acceptance of PKI solutions—and product s.pdf
armcomputers
 
An easy temperament is best characterized asoptionshigh so.pdf
An easy temperament is best characterized asoptionshigh so.pdfAn easy temperament is best characterized asoptionshigh so.pdf
An easy temperament is best characterized asoptionshigh so.pdf
armcomputers
 
A protein that was isolated by a team of university scien4sts is sus.pdf
A protein that was isolated by a team of university scien4sts is sus.pdfA protein that was isolated by a team of university scien4sts is sus.pdf
A protein that was isolated by a team of university scien4sts is sus.pdf
armcomputers
 
A laser beam strikes one end of a slab of material of length L = 42..pdf
A laser beam strikes one end of a slab of material of length L = 42..pdfA laser beam strikes one end of a slab of material of length L = 42..pdf
A laser beam strikes one end of a slab of material of length L = 42..pdf
armcomputers
 
4. Communicate Carla gathered 328 sea-shells. Daniel gathered 176 .pdf
4. Communicate Carla gathered 328 sea-shells. Daniel gathered 176 .pdf4. Communicate Carla gathered 328 sea-shells. Daniel gathered 176 .pdf
4. Communicate Carla gathered 328 sea-shells. Daniel gathered 176 .pdf
armcomputers
 

More from armcomputers (20)

Homework 3 P11Is this relation a function    (Write either Yes.pdf
Homework 3 P11Is this relation a function    (Write either Yes.pdfHomework 3 P11Is this relation a function    (Write either Yes.pdf
Homework 3 P11Is this relation a function    (Write either Yes.pdf
 
i have a runable code below that works with just guessing where the .pdf
i have a runable code below that works with just guessing where the .pdfi have a runable code below that works with just guessing where the .pdf
i have a runable code below that works with just guessing where the .pdf
 
Find Tukey-Kramer resultsa. Group 1 to Group 2 Different Not D.pdf
Find Tukey-Kramer resultsa. Group 1 to Group 2 Different  Not D.pdfFind Tukey-Kramer resultsa. Group 1 to Group 2 Different  Not D.pdf
Find Tukey-Kramer resultsa. Group 1 to Group 2 Different Not D.pdf
 
Female copperhead snakes have the ability to reproduce both sexually.pdf
Female copperhead snakes have the ability to reproduce both sexually.pdfFemale copperhead snakes have the ability to reproduce both sexually.pdf
Female copperhead snakes have the ability to reproduce both sexually.pdf
 
Explain some of the commonly held misconceptions about cloning. Why .pdf
Explain some of the commonly held misconceptions about cloning. Why .pdfExplain some of the commonly held misconceptions about cloning. Why .pdf
Explain some of the commonly held misconceptions about cloning. Why .pdf
 
Describe nN when the number of positive divisors of n is i) p2 for .pdf
Describe nN when the number of positive divisors of n is i) p2 for .pdfDescribe nN when the number of positive divisors of n is i) p2 for .pdf
Describe nN when the number of positive divisors of n is i) p2 for .pdf
 
Describe one derived trait in humans (Homo sapiens).SolutionThe.pdf
Describe one derived trait in humans (Homo sapiens).SolutionThe.pdfDescribe one derived trait in humans (Homo sapiens).SolutionThe.pdf
Describe one derived trait in humans (Homo sapiens).SolutionThe.pdf
 
Consider the table below How many featuresattributes are in this s.pdf
Consider the table below  How many featuresattributes are in this s.pdfConsider the table below  How many featuresattributes are in this s.pdf
Consider the table below How many featuresattributes are in this s.pdf
 
Chickens vary in color. Black and white color variation can be traced.pdf
Chickens vary in color. Black and white color variation can be traced.pdfChickens vary in color. Black and white color variation can be traced.pdf
Chickens vary in color. Black and white color variation can be traced.pdf
 
write a program that given a list of 20 integers, sorts them accordi.pdf
write a program that given a list of 20 integers, sorts them accordi.pdfwrite a program that given a list of 20 integers, sorts them accordi.pdf
write a program that given a list of 20 integers, sorts them accordi.pdf
 
Why is the 16S rRNA gene a preferred marker for the identification, .pdf
Why is the 16S rRNA gene a preferred marker for the identification, .pdfWhy is the 16S rRNA gene a preferred marker for the identification, .pdf
Why is the 16S rRNA gene a preferred marker for the identification, .pdf
 
Why do SSDs benefit from a scheduler like noopSolutionThe def.pdf
Why do SSDs benefit from a scheduler like noopSolutionThe def.pdfWhy do SSDs benefit from a scheduler like noopSolutionThe def.pdf
Why do SSDs benefit from a scheduler like noopSolutionThe def.pdf
 
which of the following types of orgnisms possess the enzyme catalase.pdf
which of the following types of orgnisms possess the enzyme catalase.pdfwhich of the following types of orgnisms possess the enzyme catalase.pdf
which of the following types of orgnisms possess the enzyme catalase.pdf
 
Which of the five factors of production is most important for creati.pdf
Which of the five factors of production is most important for creati.pdfWhich of the five factors of production is most important for creati.pdf
Which of the five factors of production is most important for creati.pdf
 
What is the good producing business What is the good producing.pdf
What is the good producing business What is the good producing.pdfWhat is the good producing business What is the good producing.pdf
What is the good producing business What is the good producing.pdf
 
What is the future of PKI Acceptance of PKI solutions—and product s.pdf
What is the future of PKI Acceptance of PKI solutions—and product s.pdfWhat is the future of PKI Acceptance of PKI solutions—and product s.pdf
What is the future of PKI Acceptance of PKI solutions—and product s.pdf
 
An easy temperament is best characterized asoptionshigh so.pdf
An easy temperament is best characterized asoptionshigh so.pdfAn easy temperament is best characterized asoptionshigh so.pdf
An easy temperament is best characterized asoptionshigh so.pdf
 
A protein that was isolated by a team of university scien4sts is sus.pdf
A protein that was isolated by a team of university scien4sts is sus.pdfA protein that was isolated by a team of university scien4sts is sus.pdf
A protein that was isolated by a team of university scien4sts is sus.pdf
 
A laser beam strikes one end of a slab of material of length L = 42..pdf
A laser beam strikes one end of a slab of material of length L = 42..pdfA laser beam strikes one end of a slab of material of length L = 42..pdf
A laser beam strikes one end of a slab of material of length L = 42..pdf
 
4. Communicate Carla gathered 328 sea-shells. Daniel gathered 176 .pdf
4. Communicate Carla gathered 328 sea-shells. Daniel gathered 176 .pdf4. Communicate Carla gathered 328 sea-shells. Daniel gathered 176 .pdf
4. Communicate Carla gathered 328 sea-shells. Daniel gathered 176 .pdf
 

Recently uploaded

Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 

Recently uploaded (20)

Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 

{c}Problem Run For Charity (charityrun.c)Charity Runs are a pop.pdf

  • 1. {c} Problem: Run For Charity (charityrun.c) Charity Runs are a popular way for organizations to raise awareness and get fit at the same time. However, these events can be tough to organize. The Princess Half Marathon Weekend, for example, has as many as 40,000 runners raising money and awareness for the Children’s Miracle Network Hospitals. People can run both 5ks and 10ks and there’s even a children’s race. After nearly a semester of C programming, you've decided that you'd like to donate your skills to create a program that organizes the typical activities for charity run weekend. In particular, your program will help manage the following: 1) Individual Registration 2) Team Registration 3) Running Events 4) Donation Totals Your program will log the number of teams and individual who are signed up for the different races, process the racing events to see who has the fastest times, and track the total amount of money raised by teams and individuals for charity. Header Specification To facilitate grading, include in your header comment which portions of the assignment you have completed. You must complete all portions in order to earn full credit, but partial credit is available for completing some of the steps. The primary steps are as follows: (1) Processing Individual Registrations (2) Processing Team Registrations (3) Processing the running events (4) Calculating total donations If your comment is accurate, meaning that you pass the appropriate tests cases corresponding to your choice, you'll earn 10 points. If your comment is roughly accurate, meaning that you sincerely attempted the items you listed, and most of them work minus a tiny bug, then you'll get 5 of these points. If your comment isn't accurate to a reasonable degree, you'll get 0 of these points. The reason this is here is because it's very important to communicate to others accurately what you've accomplished and what is left to accomplish. This sort of honesty and ability to appraise your own work is a critical skill in a job. Program Details Individual RegistrationDetails There are a two registration windows: early registration and regular registration. Prices for
  • 2. registering early and regularly will be given. Each individual will have a unique number and must be processed separately to record their name, age, running event, and donations raised. The maximum number of runners for our program will be 10000. Team RegistrationDetails Teams may be created and registered to sign up several participators at once. Teams may only sign up during early registration, have between 5 and 50 members, and must pay the team registration fee for every member on the team. Teams should be recorded with their name and number of members. Each member of the team still needs to be recorded with their name, age, running event, and donations raised. We can organize at most 200 teams. Running EventsDetails There will be three running events: a 5k race, a 10k race, and a marathon race. For each race, your program will receive the running time for each participant in the race. For the 5k and the 10k you should print the runner with the fastest time. For the marathon, your program will need to check times against the required qualifying times to see which runners qualify for more marathon races. These qualifying times vary by age group. Total Donation Details After all the races are run we want to recognize the participants who raised the most money for charity. Print the team that raised the most money for the event along with the amount raised. Then for each team, print the team member who raised the most money along with the amount raised. For the individuals, print the top individual who raised the most money along with the amount raised. Finally, print the total amount raised for the event. All donations and registration fees will be donated directly to charity. Implementation Restrictions You must use the following constants: #define TEAMS 200 #define RUNNERS 10000 #define LENGTH 20 #define TEAMSIZE 50 You must use the following structures to store information: struct person { char name[LENGTH]; int number; int age; int event; float money; float time;
  • 3. }; struct team { char name[LENGTH]; int nummembers; float money; struct person members[TEAMSIZE]; }; It is not sufficient to simply have the structures in your program, you must use them store information and process operations for the program. Though function prototypes will not be provided, it is expected that you follow good programming design and create several functions with well-specified tasks related to the solution of this problem. Make sure to pay very careful attention to parameter passing. Input Specification The first line of the file contains the following three values, separated by spaces: Cost of early registration for individuals (in dollars), Cost of regular registration for individuals (in dollars), and the cost of team registration (in dollars). These will be positive real numbers to two decimal places. The second line of the file will contain one positive integer representing the number of early individuals and teams who are registering. Every registration will start with either TEAM or INDV for a team registration or individual registration respectively. Lines that begin with INDV will be followed by four values, separated by spaces: The individual’s name, their age, their chosen running event, and the amount of donations they have raised. The first is a string, the second is a positive integer, the third is an integer from the set {5, 10, 42}, and the fourth is a positive real number. Lines that begin with TEAM will be followed by two values, separated by spaces: the name of the team and the number of team members (k). This will be followed by k lines organized the same as the individual registration above. After early registration completes, normal registration can begin. This will be represented by one positive integer (m) representing the number of regular registrations. All teams must use early registration. This will be followed by m lines each with four values. These are the same values that are present in individual registration: The team member’s name, their age, their chosen running event, and the amount of donations they have raised. The first is a string, the second is a positive integer, the third is an integer from the set {5, 10, 42}, and the fourth is a positive real number. After registration, the running events can occur. Every registered participant will be listed with
  • 4. their number (assigned as part of registration) and the time it took them to run the race in minutes represented as a real number. This will be followed by 10 lines of qualifying times based on age groups. They will be specified: STARTINGAGE ENDINGAGE TIME where starting age and ending age are integers, and the qualifying time is a real number representing minutes. Output Specification For an individual registering for an event print a line of the form: X registered for the Y race! They have been assigned the number Z. where X is their name and Y is the event they are registering for. Y is represented by an integer {5, 10, 42} in the input file. Replace it with “5k” for the first integer, “10k” for the second integer, and “marathon” for the third integer in this print statement. Z is their unique runner number. These numbers should start at 1 and count up to a max of 10000. For a team registering print a line with one of the form: X team registered for the event. They have Y members: where X is the team name and Y is their number of members. Follow this with Y lines of the same form as the individuals: one for each member of the team. For the 5k race and the 10k race, output a single line of the following form: Xk race: Y had the fastest time with Z.Z minutes! where X is either 5 or 10 respectively, Y represents the name of the fastest runner and Z represents their time. For the marathon race, print out all the runners who times meet the qualifying times: X qualified in the marathon run with a time of Y.Y minutes! where X represents the name of the fastest runner and Y represents their time. For the team that raised the most money, output a single line of the following form: The X team raised the most money with a team donation of $Y.YY! where X is the team name and Y is the amount they raised. For each team, print out the person that raised the most with a single line of the following form: X raised the most money on team Y with a donation of $Z.ZZ! where X is the person’s name, Y is the team name, and Z is the amount they raised. For the individual that raised the most money, output a single line of the following form: X raised $Y.YY! where X is the person’s name and Y is the amount they raised. End with the total amount raised by the event: The runners raised $X.XX for charity!
  • 5. Sample Input/Output Four sets of input and output are provided with the assignment, showing the different portions of the assignment. You should try to complete race01 first, then proceed to race02, and so forth. Each test file is labeled as raceXX.txt for input and raceXX.out for output. Out files can be opened in notepad and other unformatted text editors. Deliverables A single source file named charityrun.c turned in through WebCourses. Restrictions Although you may use other compilers, your program must compile in gcc and run in Code::Blocks. Your program should include a header comment with the following information: your name, course number, section number, assignment title, and date. Make sure you include comments throughout your code describing the major steps in solving the problem. Make sure to use good programming style, including use of appropriate constants, good variable names and good use of white space. Grading Details Your programs will be graded upon the following criteria: 1) Your correctness 2) Your programming style and use of white space. Even if you have a plan and your program works perfectly, if your programming style is poor or your use of white space is poor, you could get 10% or 15% deducted from your grade. 3) Compatibility – You must submit C source files that can be compiled and executed in a standard C Development Environment. If your program does not compile, you will get a sizable deduction from your grade. 4) Header Comment - In your header comment, you must state which portions of the assignment you have implemented. Your choices are as follows: (1) Processing Individual Registrations (2) Processing Team Registrations (3) Processing run events (4) Calculating total donations If your comment is accurate, meaning that you pass the appropriate tests cases corresponding to your choice, you'll earn 10 points. If your comment is roughly accurate, meaning that you sincerely attempted the items you listed, and most of them work minus a tiny bug, then you'll get 5 of these points. If your comment isn't accurate to a reasonable degree, you'll get 0 of these points. The reason this is here is because it's very important to communicate to others accurately what you've accomplished and what is left to accomplish. This sort of honesty and ability to appraise
  • 6. your own work is a critical skill in a job. INPUT #1: 25.5 35.75 21 5 INDV Emily 30 5 10 INDV Karla 27 10 25.6 INDV Martin 45 5 33.75 INDV Lucas 23 42 100 INDV Hayley 34 42 27.43 7 George 50 10 90.3 Evelyn 47 5 15.4 Linus 55 10 22.8 Charlie 40 42 150.75 Lucy 24 10 14.89 Leah 42 5 23.45 Thomas 29 5 10.6 OUTPUT #1: INPUT #2: 25.5 35.75 21 7 INDV Emily 30 5 10 INDV Karla 27 10 25.6 INDV Martin 45 5 33.75 TEAM OATS 5 Maria 22 5 15.62 Caleb 41 10 20.5 Micahel 30 42 18.75 Lily 33 10 31.15 Charlotte 29 5 25.8 INDV Lucas 23 42 100 INDV Hayley 34 42 27.43 TEAM RAINBOW 3 Lawrence 56 5 33.75 David 55 5 33.75 Josie 60 5 33.75
  • 7. 7 George 50 10 90.3 Evelyn 47 5 15.4 Linus 55 10 22.8 Charlie 40 42 150.75 Lucy 24 10 14.89 Leah 42 5 23.45 Thomas 29 5 10.6 OUTPUT #2: INPUT #3: 25.5 35.75 21 7 INDV Emily 30 5 10 INDV Karla 27 10 25.6 INDV Martin 45 5 33.75 TEAM OATS 5 Maria 22 5 15.62 Caleb 41 10 20.5 Michael 30 42 18.75 Lily 33 10 31.15 Charlotte 29 5 25.8 INDV Lucas 23 42 100 INDV Hayley 34 42 27.43 TEAM RAINBOW 3 Lawrence 56 5 33.75 David 55 5 30.15 Josie 60 5 13.79 7 George 50 10 90.3 Evelyn 47 5 15.4 Linus 55 10 22.8 Charlie 40 42 150.75 Lucy 24 10 14.89 Leah 42 5 23.45 Thomas 29 5 10.6 1 40
  • 8. 2 75 3 35 4 30 5 80 6 200 7 82 8 32 9 230 10 213 11 37 12 25 13 33 14 78 15 31 16 82 17 235 18 77 19 36 20 29 18 34 215 35 39 220 40 44 225 45 49 235 50 54 240 55 59 250 60 64 265 65 69 280 70 74 295 75 79 310 OUTPUT #3: INPUT #4: 25.5 35.75 21 7 INDV Emily 30 5 10 INDV Karla 27 10 25.6 INDV Martin 45 5 33.75
  • 9. TEAM OATS 5 Maria 22 5 15.62 Caleb 41 10 20.5 Michael 30 42 18.75 Lily 33 10 31.15 Charlotte 29 5 25.8 INDV Lucas 23 42 100 INDV Hayley 34 42 27.43 TEAM RAINBOW 3 Lawrence 56 5 33.75 David 55 5 30.15 Josie 60 5 13.79 7 George 50 10 90.3 Evelyn 47 5 15.4 Linus 55 10 22.8 Charlie 40 42 150.75 Lucy 24 10 14.89 Leah 42 5 23.45 Thomas 29 5 10.6 1 40 2 75 3 35 4 30 5 80 6 200 7 82 8 32 9 230 10 213 11 37 12 25 13 33 14 78 15 31 16 82
  • 10. 17 235 18 77 19 36 20 29 18 34 215 35 39 220 40 44 225 45 49 235 50 54 240 55 59 250 60 64 265 65 69 280 70 74 295 75 79 310 OUTPUT #4: Solution Program:- #define _CRT_SECURE_NO_WARNINGS //different header files are defined #include #include #include #include // defined according to the question #define TEAMS1 200 #define RUNNERS1 10000 #define LENGTH1 20 #define TEAMSIZE1 50 FILE *ifp1; void information1(int); struct person1 { // diffrerent varibles are defined char name1[LENGTH1];
  • 11. char lname1[LENGTH1]; int number1; int age1; int event1; float money1; float time1; } person1; struct team1 { //needed variables are defined char name1[LENGTH1]; float money1; struct person1 members1[TEAMSIZE1]; } team1; int main() { ifp1 = fopen("input.txt", "r"); int choice1, flag1 = 0, idx1 = 0, idx2 = 0; fscanf(ifp1, "%d", &choice1); while (!feof(ifp1)) { information1(++idx1); } fclose(ifp1); getchar(); getchar(); return 0; } void information1(int idx1) { if (idx1 < 6) // conditional if else statement is used fscanf(ifp1, "%f", &person1.money1); fscanf(ifp1, "%d", &person1.age1); // pass int data type for person’s age fscanf(ifp1, "%s", person1.name1); // pass char datatype for person’s name
  • 12. fscanf(ifp1, "%d", &person1.event1); // pass int data type for person’s event fscanf(ifp1, "%s", person1.lname1); if (person1.event1 == 42) printf(" %s register for marathon race! they have been assigned number1 is %d.", person1.name1, idx1);//print else // conditional statement if else printf(" %s register for %dk race! they have been assigned number1 is %d.", person1.name1, person1.event1, idx1); } // print INPUT #1: 25.5 35.75 21 5 INDV Emily 30 5 10 INDV Karla 27 10 25.6 INDV Martin 45 5 33.75 INDV Lucas 23 42 100 INDV Hayley 34 42 27.43 7 George 50 10 90.3 Evelyn 47 5 15.4 Linus 55 10 22.8 Charlie 40 42 150.75 Lucy 24 10 14.89 Leah 42 5 23.45 Thomas 29 5 10.6 OUTPUT #1: INPUT #2: 25.5 35.75 21 7 INDV Emily 30 5 10 INDV Karla 27 10 25.6 INDV Martin 45 5 33.75 TEAM OATS 5 Maria 22 5 15.62 Caleb 41 10 20.5 Micahel 30 42 18.75
  • 13. Lily 33 10 31.15 Charlotte 29 5 25.8 INDV Lucas 23 42 100 INDV Hayley 34 42 27.43 TEAM RAINBOW 3 Lawrence 56 5 33.75 David 55 5 33.75 Josie 60 5 33.75 7 George 50 10 90.3 Evelyn 47 5 15.4 Linus 55 10 22.8 Charlie 40 42 150.75 Lucy 24 10 14.89 Leah 42 5 23.45 Thomas 29 5 10.6 OUTPUT #2: INPUT #3: 25.5 35.75 21 7 INDV Emily 30 5 10 INDV Karla 27 10 25.6 INDV Martin 45 5 33.75 TEAM OATS 5 Maria 22 5 15.62 Caleb 41 10 20.5 Michael 30 42 18.75 Lily 33 10 31.15 Charlotte 29 5 25.8 INDV Lucas 23 42 100 INDV Hayley 34 42 27.43 TEAM RAINBOW 3 Lawrence 56 5 33.75 David 55 5 30.15 Josie 60 5 13.79 7
  • 14. George 50 10 90.3 Evelyn 47 5 15.4 Linus 55 10 22.8 Charlie 40 42 150.75 Lucy 24 10 14.89 Leah 42 5 23.45 Thomas 29 5 10.6 1 40 2 75 3 35 4 30 5 80 6 200 7 82 8 32 9 230 10 213 11 37 12 25 13 33 14 78 15 31 16 82 17 235 18 77 19 36 20 29 18 34 215 35 39 220 40 44 225 45 49 235 50 54 240 55 59 250 60 64 265 65 69 280 70 74 295
  • 15. 75 79 310 OUTPUT #3: INPUT #4: 25.5 35.75 21 7 INDV Emily 30 5 10 INDV Karla 27 10 25.6 INDV Martin 45 5 33.75 TEAM OATS 5 Maria 22 5 15.62 Caleb 41 10 20.5 Michael 30 42 18.75 Lily 33 10 31.15 Charlotte 29 5 25.8 INDV Lucas 23 42 100 INDV Hayley 34 42 27.43 TEAM RAINBOW 3 Lawrence 56 5 33.75 David 55 5 30.15 Josie 60 5 13.79 7 George 50 10 90.3 Evelyn 47 5 15.4 Linus 55 10 22.8 Charlie 40 42 150.75 Lucy 24 10 14.89 Leah 42 5 23.45 Thomas 29 5 10.6 1 40 2 75 3 35 4 30 5 80 6 200 7 82 8 32
  • 16. 9 230 10 213 11 37 12 25 13 33 14 78 15 31 16 82 17 235 18 77 19 36 20 29 18 34 215 35 39 220 40 44 225 45 49 235 50 54 240 55 59 250 60 64 265 65 69 280 70 74 295 75 79 310 OUTPUT #4: