SlideShare a Scribd company logo
1 of 11
Download to read offline
Any kind of help would gladly be appreciated. (C-programming)
Problem:
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:
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: Emily registered for the 5k race! They have been assigned the number 1 Karla
registered for the 10k race l They have been assigned the number 2 Martin registered for the 5k
race l They have been assigned the number 3 OATS team registered for the event They have 5
members Maria registered for the 5k race! They have been assigned the number 4 Caleb
registered for the 10k race They have been assigned the number 5 Michael registered for the
marathon race They have been assigned the number 6 Lily registered for the 10k race They have
been assigned the number 7 Charlotte registered for the 5k race They have been assigned the
number 8 Lucas registered for the marathon race They have been assigned the number 9 Hayley
registered for the marathon race! They have been assigned the number 10 RAINBOW team
registered for the event They have 3 members Lawrence registered for the 5k race They have
been assigned the number 11 David registered for the 5k race They have been assigned the
number 12 Josie registered for the 5k race They have been assigned the number 13 George
registered for the 10k race They have been assigned the number 14 Evelyn registered for the 5k
race They have been assigned the number 15 Linus registered for the 10k race They have been
assigned the number 16 Charlie registered for the marathon race They have been assigned the
number 17 Lucy registered for the 10k race They have been assigned the number 18 Leah
registered for the 5k race l They have been assigned the number 19 Thomas registered for the 5k
race I They have been assigned the number 20 5k race: David had the fastest time with 25.0
minutes 10k race Karla had the fastest time with 75.0 minutes Hayley qualified in the marathon
run with a time of 213.0 minutes l Michael qualified in the marathon run with a time of 200.0
minutes l The OATS team raised the most money with a team donation of $111.82 l Lily raised
the most money on team OATS with a donation of $31.15 I Lawrence raised the most money on
team RAINBOW with a donation of $33.75 Charlie raised $150.75 The runners raised $1260.23
for charity!
Solution
#include
#include
#define TEAMS 200
#define RUNNERS 10000
#define LENGTH 20
#define TEAMSIZE 50
//creating person structure
struct person {
char type[4];
char name[LENGTH];
int number;
int age;
int event;
float money;
float time;
};
//creatind team structure
struct team {
char name[LENGTH];
int numbers;
float money;
struct person *members;
};
//declaring team and person structures
struct person persons[1000];
struct team teams[200];
int per_size=0;
int t_size=0,i=0;
//regiserting a person
void registerPerson(struct person p){
if(RUNNERS!=per_size){
p.number=per_size;
(persons)[per_size]=p;
per_size=per_size+1;
printf(" %s register for the %dk race.They have been assigned with %d
number",p.name,p.event,p.number);
}
else{
printf("maximum runners reached");
return;
}
}
//register a team
void registerTeam(struct team t){
if(t_size>=5 && t_size<=TEAMSIZE){
teams[t_size]=t;
t_size=t_size+1;
printf(" The %s team register for the event.THey have %d members",t.name,t.numbers);
}
else{
printf("maximum team reached");
return;
}
}
void race5k_calc(){
int i=0;
struct person p;
//calculate for individual persons
for(i=0;ipersons[i+1].time) )
{
p=persons[i+1];
}
}
}
printf(" 5K RACE: %s has the fastest time with %f minutes",p.name,p.time);
}
void race10k_calc(){
int i=0;
struct person p;
//checking person event is 10k run and finding the winner
for(i=0;ipersons[i+1].time) )
{
p=persons[i+1];
}
}
}
printf(" 10K RACE: %s has the fastest time with %f minutes",p.name,p.time);
}
void race_marathon_calc(){
int i=0;
int hrs,mts,secs;
struct person p;
//checking persons event is marathon and finding winner
for(i=0;ipersons[i+1].time) )
{
p=persons[i+1];
}
}
}
printf("marathon RACE: %s has the fastest time with %f minutes",p.name,p.time);
}
//calculating the donation
void donation_calc(){
float amt=0,t_amt=0,max_amt=0;
struct person p,*members;
struct team t;
int i=0,j=0,l;
for(i=0;imembers[j].money){
max_amt=members[j].money;
p=members[j];
}
printf(" %s raised the mostmoney on the %s team with $%f
amount",p.name,max_amt);
t_amt=t_amt+members[j].money;
printf(" The %s team raised the most money $%f ",t.name,t_amt);
}
}
amt=0;
for(i=0;i

More Related Content

Similar to Any kind of help would gladly be appreciated. (C-programming)Probl.pdf

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 2014Tahira Naseem
 
Laquando Young Comp. Sci.pdf
Laquando Young Comp. Sci.pdfLaquando Young Comp. Sci.pdf
Laquando Young Comp. Sci.pdfIsaacRamdeen
 
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
 
How To Log Into The Volunteer Center
How To Log Into The Volunteer CenterHow To Log Into The Volunteer Center
How To Log Into The Volunteer CenterMichael Gilman
 
May 5, 2018: Colorado Coach Connection
May 5, 2018: Colorado Coach ConnectionMay 5, 2018: Colorado Coach Connection
May 5, 2018: Colorado Coach ConnectionICF Colorado
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2Animesh Chaturvedi
 
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
 
System Analysis & Design (NCC Education)
System Analysis & Design (NCC Education)System Analysis & Design (NCC Education)
System Analysis & Design (NCC Education)Md. Mahbub Alam
 
December 20, 2017: Colorado Coach Connection
December 20, 2017: Colorado Coach ConnectionDecember 20, 2017: Colorado Coach Connection
December 20, 2017: Colorado Coach ConnectionICF Colorado
 
January 5, 2018: Colorado Coach Connection
January 5, 2018: Colorado Coach ConnectionJanuary 5, 2018: Colorado Coach Connection
January 5, 2018: Colorado Coach ConnectionICF Colorado
 
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 GymnasiumoelbertAngela Gibbs
 
December 5, 2017: Colorado Coach Connection
December 5, 2017: Colorado Coach ConnectionDecember 5, 2017: Colorado Coach Connection
December 5, 2017: Colorado Coach ConnectionICF Colorado
 
Welcome to jaiveer mobiles
Welcome to jaiveer mobilesWelcome to jaiveer mobiles
Welcome to jaiveer mobilesgoyal112
 
AIESEC US RoKS 2015 | MOGX Track
AIESEC US RoKS 2015 | MOGX TrackAIESEC US RoKS 2015 | MOGX Track
AIESEC US RoKS 2015 | MOGX Trackkavyauchil
 
Colorado Coach Connection: April 5, 2018
Colorado Coach Connection: April 5, 2018Colorado Coach Connection: April 5, 2018
Colorado Coach Connection: April 5, 2018ICF Colorado
 
Luxury ventures corporation_eng
Luxury ventures corporation_engLuxury ventures corporation_eng
Luxury ventures corporation_engOleg Ivaniloff
 

Similar to Any kind of help would gladly be appreciated. (C-programming)Probl.pdf (20)

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
 
Laquando Young Comp. Sci.pdf
Laquando Young Comp. Sci.pdfLaquando Young Comp. Sci.pdf
Laquando Young Comp. Sci.pdf
 
January 5, 2018: Colorado Coach Connection -
January 5, 2018: Colorado Coach Connection -January 5, 2018: Colorado Coach Connection -
January 5, 2018: Colorado Coach Connection -
 
How To Log Into The Volunteer Center
How To Log Into The Volunteer CenterHow To Log Into The Volunteer Center
How To Log Into The Volunteer Center
 
May 5, 2018: Colorado Coach Connection
May 5, 2018: Colorado Coach ConnectionMay 5, 2018: Colorado Coach Connection
May 5, 2018: Colorado Coach Connection
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2
 
January 20, 2018: Colorado Coach Connection
January 20, 2018: Colorado Coach Connection January 20, 2018: Colorado Coach Connection
January 20, 2018: Colorado Coach Connection
 
EPF E Return FAQ
EPF E Return FAQEPF E Return FAQ
EPF E Return FAQ
 
System Analysis & Design (NCC Education)
System Analysis & Design (NCC Education)System Analysis & Design (NCC Education)
System Analysis & Design (NCC Education)
 
December 20, 2017: Colorado Coach Connection
December 20, 2017: Colorado Coach ConnectionDecember 20, 2017: Colorado Coach Connection
December 20, 2017: Colorado Coach Connection
 
January 5, 2018: Colorado Coach Connection
January 5, 2018: Colorado Coach ConnectionJanuary 5, 2018: Colorado Coach Connection
January 5, 2018: Colorado Coach Connection
 
If switch structure
If switch structureIf switch structure
If switch structure
 
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
 
December 5, 2017: Colorado Coach Connection
December 5, 2017: Colorado Coach ConnectionDecember 5, 2017: Colorado Coach Connection
December 5, 2017: Colorado Coach Connection
 
C Programming
C ProgrammingC Programming
C Programming
 
Vip update ppt
Vip update pptVip update ppt
Vip update ppt
 
Welcome to jaiveer mobiles
Welcome to jaiveer mobilesWelcome to jaiveer mobiles
Welcome to jaiveer mobiles
 
AIESEC US RoKS 2015 | MOGX Track
AIESEC US RoKS 2015 | MOGX TrackAIESEC US RoKS 2015 | MOGX Track
AIESEC US RoKS 2015 | MOGX Track
 
Colorado Coach Connection: April 5, 2018
Colorado Coach Connection: April 5, 2018Colorado Coach Connection: April 5, 2018
Colorado Coach Connection: April 5, 2018
 
Luxury ventures corporation_eng
Luxury ventures corporation_engLuxury ventures corporation_eng
Luxury ventures corporation_eng
 

More from sktambifortune

Your company is preparing to migrate from IPv4 to IPv6, and you are .pdf
Your company is preparing to migrate from IPv4 to IPv6, and you are .pdfYour company is preparing to migrate from IPv4 to IPv6, and you are .pdf
Your company is preparing to migrate from IPv4 to IPv6, and you are .pdfsktambifortune
 
You are burning the latest song you bought on ITunes to a disk. The .pdf
You are burning the latest song you bought on ITunes to a disk. The .pdfYou are burning the latest song you bought on ITunes to a disk. The .pdf
You are burning the latest song you bought on ITunes to a disk. The .pdfsktambifortune
 
CASE 3-12 Information System Project Steering Committee The Informat.pdf
CASE 3-12 Information System Project Steering Committee The Informat.pdfCASE 3-12 Information System Project Steering Committee The Informat.pdf
CASE 3-12 Information System Project Steering Committee The Informat.pdfsktambifortune
 
Can you date the latest financial crisis in the United States or in .pdf
Can you date the latest financial crisis in the United States or in .pdfCan you date the latest financial crisis in the United States or in .pdf
Can you date the latest financial crisis in the United States or in .pdfsktambifortune
 
B1. State the components of organization. Give good examples to justi.pdf
B1. State the components of organization. Give good examples to justi.pdfB1. State the components of organization. Give good examples to justi.pdf
B1. State the components of organization. Give good examples to justi.pdfsktambifortune
 
Assignment of SOS operating systemThe file lmemman.c has one incom.pdf
Assignment of SOS operating systemThe file lmemman.c has one incom.pdfAssignment of SOS operating systemThe file lmemman.c has one incom.pdf
Assignment of SOS operating systemThe file lmemman.c has one incom.pdfsktambifortune
 
Which of the following solutions will turn red litmus blue pOH 1.pdf
Which of the following solutions will turn red litmus blue pOH 1.pdfWhich of the following solutions will turn red litmus blue pOH 1.pdf
Which of the following solutions will turn red litmus blue pOH 1.pdfsktambifortune
 
What serves as the most reliable source of information about the .pdf
What serves as the most reliable source of information about the .pdfWhat serves as the most reliable source of information about the .pdf
What serves as the most reliable source of information about the .pdfsktambifortune
 
What is the difference between the terms “earnings and profits” and .pdf
What is the difference between the terms “earnings and profits” and .pdfWhat is the difference between the terms “earnings and profits” and .pdf
What is the difference between the terms “earnings and profits” and .pdfsktambifortune
 
what are three effects of transistor scaling on computer architectur.pdf
what are three effects of transistor scaling on computer architectur.pdfwhat are three effects of transistor scaling on computer architectur.pdf
what are three effects of transistor scaling on computer architectur.pdfsktambifortune
 
What are some of the motives for employee theft What are some .pdf
What are some of the motives for employee theft What are some .pdfWhat are some of the motives for employee theft What are some .pdf
What are some of the motives for employee theft What are some .pdfsktambifortune
 
Twitter is a popular social media. It allows its users to exchange tw.pdf
Twitter is a popular social media. It allows its users to exchange tw.pdfTwitter is a popular social media. It allows its users to exchange tw.pdf
Twitter is a popular social media. It allows its users to exchange tw.pdfsktambifortune
 
A. State the domai and ranga. 1. y find the inverse and state the dom.pdf
A. State the domai and ranga. 1. y find the inverse and state the dom.pdfA. State the domai and ranga. 1. y find the inverse and state the dom.pdf
A. State the domai and ranga. 1. y find the inverse and state the dom.pdfsktambifortune
 
The Puritan faith community shaped the New England colonies in virtu.pdf
The Puritan faith community shaped the New England colonies in virtu.pdfThe Puritan faith community shaped the New England colonies in virtu.pdf
The Puritan faith community shaped the New England colonies in virtu.pdfsktambifortune
 
savings account d. the value of the shares is based on the amount of .pdf
savings account d. the value of the shares is based on the amount of .pdfsavings account d. the value of the shares is based on the amount of .pdf
savings account d. the value of the shares is based on the amount of .pdfsktambifortune
 
QuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdf
QuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdfQuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdf
QuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdfsktambifortune
 
946 LTE Labs Le.chateliers-lab.pdf Before beginning this experiment.pdf
946 LTE Labs Le.chateliers-lab.pdf  Before beginning this experiment.pdf946 LTE Labs Le.chateliers-lab.pdf  Before beginning this experiment.pdf
946 LTE Labs Le.chateliers-lab.pdf Before beginning this experiment.pdfsktambifortune
 
Prove that the T_i-property is a topological property for i = 0So.pdf
Prove that the T_i-property is a topological property for i = 0So.pdfProve that the T_i-property is a topological property for i = 0So.pdf
Prove that the T_i-property is a topological property for i = 0So.pdfsktambifortune
 
4. Refer to the table of Gini coefficients in the Added Dimension box.pdf
4. Refer to the table of Gini coefficients in the Added Dimension box.pdf4. Refer to the table of Gini coefficients in the Added Dimension box.pdf
4. Refer to the table of Gini coefficients in the Added Dimension box.pdfsktambifortune
 
number of lines should be included in the last page of the paper aft.pdf
number of lines should be included in the last page of the paper aft.pdfnumber of lines should be included in the last page of the paper aft.pdf
number of lines should be included in the last page of the paper aft.pdfsktambifortune
 

More from sktambifortune (20)

Your company is preparing to migrate from IPv4 to IPv6, and you are .pdf
Your company is preparing to migrate from IPv4 to IPv6, and you are .pdfYour company is preparing to migrate from IPv4 to IPv6, and you are .pdf
Your company is preparing to migrate from IPv4 to IPv6, and you are .pdf
 
You are burning the latest song you bought on ITunes to a disk. The .pdf
You are burning the latest song you bought on ITunes to a disk. The .pdfYou are burning the latest song you bought on ITunes to a disk. The .pdf
You are burning the latest song you bought on ITunes to a disk. The .pdf
 
CASE 3-12 Information System Project Steering Committee The Informat.pdf
CASE 3-12 Information System Project Steering Committee The Informat.pdfCASE 3-12 Information System Project Steering Committee The Informat.pdf
CASE 3-12 Information System Project Steering Committee The Informat.pdf
 
Can you date the latest financial crisis in the United States or in .pdf
Can you date the latest financial crisis in the United States or in .pdfCan you date the latest financial crisis in the United States or in .pdf
Can you date the latest financial crisis in the United States or in .pdf
 
B1. State the components of organization. Give good examples to justi.pdf
B1. State the components of organization. Give good examples to justi.pdfB1. State the components of organization. Give good examples to justi.pdf
B1. State the components of organization. Give good examples to justi.pdf
 
Assignment of SOS operating systemThe file lmemman.c has one incom.pdf
Assignment of SOS operating systemThe file lmemman.c has one incom.pdfAssignment of SOS operating systemThe file lmemman.c has one incom.pdf
Assignment of SOS operating systemThe file lmemman.c has one incom.pdf
 
Which of the following solutions will turn red litmus blue pOH 1.pdf
Which of the following solutions will turn red litmus blue pOH 1.pdfWhich of the following solutions will turn red litmus blue pOH 1.pdf
Which of the following solutions will turn red litmus blue pOH 1.pdf
 
What serves as the most reliable source of information about the .pdf
What serves as the most reliable source of information about the .pdfWhat serves as the most reliable source of information about the .pdf
What serves as the most reliable source of information about the .pdf
 
What is the difference between the terms “earnings and profits” and .pdf
What is the difference between the terms “earnings and profits” and .pdfWhat is the difference between the terms “earnings and profits” and .pdf
What is the difference between the terms “earnings and profits” and .pdf
 
what are three effects of transistor scaling on computer architectur.pdf
what are three effects of transistor scaling on computer architectur.pdfwhat are three effects of transistor scaling on computer architectur.pdf
what are three effects of transistor scaling on computer architectur.pdf
 
What are some of the motives for employee theft What are some .pdf
What are some of the motives for employee theft What are some .pdfWhat are some of the motives for employee theft What are some .pdf
What are some of the motives for employee theft What are some .pdf
 
Twitter is a popular social media. It allows its users to exchange tw.pdf
Twitter is a popular social media. It allows its users to exchange tw.pdfTwitter is a popular social media. It allows its users to exchange tw.pdf
Twitter is a popular social media. It allows its users to exchange tw.pdf
 
A. State the domai and ranga. 1. y find the inverse and state the dom.pdf
A. State the domai and ranga. 1. y find the inverse and state the dom.pdfA. State the domai and ranga. 1. y find the inverse and state the dom.pdf
A. State the domai and ranga. 1. y find the inverse and state the dom.pdf
 
The Puritan faith community shaped the New England colonies in virtu.pdf
The Puritan faith community shaped the New England colonies in virtu.pdfThe Puritan faith community shaped the New England colonies in virtu.pdf
The Puritan faith community shaped the New England colonies in virtu.pdf
 
savings account d. the value of the shares is based on the amount of .pdf
savings account d. the value of the shares is based on the amount of .pdfsavings account d. the value of the shares is based on the amount of .pdf
savings account d. the value of the shares is based on the amount of .pdf
 
QuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdf
QuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdfQuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdf
QuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdf
 
946 LTE Labs Le.chateliers-lab.pdf Before beginning this experiment.pdf
946 LTE Labs Le.chateliers-lab.pdf  Before beginning this experiment.pdf946 LTE Labs Le.chateliers-lab.pdf  Before beginning this experiment.pdf
946 LTE Labs Le.chateliers-lab.pdf Before beginning this experiment.pdf
 
Prove that the T_i-property is a topological property for i = 0So.pdf
Prove that the T_i-property is a topological property for i = 0So.pdfProve that the T_i-property is a topological property for i = 0So.pdf
Prove that the T_i-property is a topological property for i = 0So.pdf
 
4. Refer to the table of Gini coefficients in the Added Dimension box.pdf
4. Refer to the table of Gini coefficients in the Added Dimension box.pdf4. Refer to the table of Gini coefficients in the Added Dimension box.pdf
4. Refer to the table of Gini coefficients in the Added Dimension box.pdf
 
number of lines should be included in the last page of the paper aft.pdf
number of lines should be included in the last page of the paper aft.pdfnumber of lines should be included in the last page of the paper aft.pdf
number of lines should be included in the last page of the paper aft.pdf
 

Recently uploaded

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportDenish Jangid
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MysoreMuleSoftMeetup
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital ManagementMBA Assignment Experts
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxLimon Prince
 

Recently uploaded (20)

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 

Any kind of help would gladly be appreciated. (C-programming)Probl.pdf

  • 1. Any kind of help would gladly be appreciated. (C-programming) Problem: 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: 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
  • 7. 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: Emily registered for the 5k race! They have been assigned the number 1 Karla registered for the 10k race l They have been assigned the number 2 Martin registered for the 5k race l They have been assigned the number 3 OATS team registered for the event They have 5 members Maria registered for the 5k race! They have been assigned the number 4 Caleb registered for the 10k race They have been assigned the number 5 Michael registered for the marathon race They have been assigned the number 6 Lily registered for the 10k race They have been assigned the number 7 Charlotte registered for the 5k race They have been assigned the number 8 Lucas registered for the marathon race They have been assigned the number 9 Hayley registered for the marathon race! They have been assigned the number 10 RAINBOW team registered for the event They have 3 members Lawrence registered for the 5k race They have been assigned the number 11 David registered for the 5k race They have been assigned the number 12 Josie registered for the 5k race They have been assigned the number 13 George registered for the 10k race They have been assigned the number 14 Evelyn registered for the 5k race They have been assigned the number 15 Linus registered for the 10k race They have been assigned the number 16 Charlie registered for the marathon race They have been assigned the
  • 8. number 17 Lucy registered for the 10k race They have been assigned the number 18 Leah registered for the 5k race l They have been assigned the number 19 Thomas registered for the 5k race I They have been assigned the number 20 5k race: David had the fastest time with 25.0 minutes 10k race Karla had the fastest time with 75.0 minutes Hayley qualified in the marathon run with a time of 213.0 minutes l Michael qualified in the marathon run with a time of 200.0 minutes l The OATS team raised the most money with a team donation of $111.82 l Lily raised the most money on team OATS with a donation of $31.15 I Lawrence raised the most money on team RAINBOW with a donation of $33.75 Charlie raised $150.75 The runners raised $1260.23 for charity! Solution #include #include #define TEAMS 200 #define RUNNERS 10000 #define LENGTH 20 #define TEAMSIZE 50 //creating person structure struct person { char type[4]; char name[LENGTH]; int number; int age; int event; float money; float time; }; //creatind team structure struct team { char name[LENGTH]; int numbers; float money; struct person *members; };
  • 9. //declaring team and person structures struct person persons[1000]; struct team teams[200]; int per_size=0; int t_size=0,i=0; //regiserting a person void registerPerson(struct person p){ if(RUNNERS!=per_size){ p.number=per_size; (persons)[per_size]=p; per_size=per_size+1; printf(" %s register for the %dk race.They have been assigned with %d number",p.name,p.event,p.number); } else{ printf("maximum runners reached"); return; } } //register a team void registerTeam(struct team t){ if(t_size>=5 && t_size<=TEAMSIZE){ teams[t_size]=t; t_size=t_size+1; printf(" The %s team register for the event.THey have %d members",t.name,t.numbers); } else{ printf("maximum team reached"); return; } } void race5k_calc(){ int i=0; struct person p; //calculate for individual persons
  • 10. for(i=0;ipersons[i+1].time) ) { p=persons[i+1]; } } } printf(" 5K RACE: %s has the fastest time with %f minutes",p.name,p.time); } void race10k_calc(){ int i=0; struct person p; //checking person event is 10k run and finding the winner for(i=0;ipersons[i+1].time) ) { p=persons[i+1]; } } } printf(" 10K RACE: %s has the fastest time with %f minutes",p.name,p.time); } void race_marathon_calc(){ int i=0; int hrs,mts,secs; struct person p; //checking persons event is marathon and finding winner for(i=0;ipersons[i+1].time) ) { p=persons[i+1]; } } } printf("marathon RACE: %s has the fastest time with %f minutes",p.name,p.time); } //calculating the donation void donation_calc(){ float amt=0,t_amt=0,max_amt=0;
  • 11. struct person p,*members; struct team t; int i=0,j=0,l; for(i=0;imembers[j].money){ max_amt=members[j].money; p=members[j]; } printf(" %s raised the mostmoney on the %s team with $%f amount",p.name,max_amt); t_amt=t_amt+members[j].money; printf(" The %s team raised the most money $%f ",t.name,t_amt); } } amt=0; for(i=0;i