SlideShare a Scribd company logo
Score board generation using C/C++
Input:
https://www.espncricinfo.com/ci/engine/series/index.html
In the match take commentaryas inputtoyour programand generate the outputas score board as
given.
The code shouldbe compatible toanymatches.
Note:
 Differentiate testone day
 Fetchplayername fromcommentary
 Use regularexpression/stringmatching/stringsplittingtoseparate playersname andall
 Structure needstolooksimilar onlynoneedtoshow table
 Inputwill be takenasfile readandoutputwill be file write
 Reportwriting(will explainedlater)
Sample Inputconsideredfortestcase isas below
From the givenURL https://www.espncricinfo.com/ci/engine/series/index.html
The 2010s2012TESTSThe WisdenTrophy,May-Jun2012 (WestIndiesinEngland)May17-21,
2012 - 1st Test at Lord's, London
Score card
2.50pm: Time for the presentations, then. First the umpires get their medals - and they deserve
them, the standard is really high among the elite group and Aleem Dar and Marais Erasmus again
had an excellent Test.
West Indies captain, Darren Sammy: "I think some guys performed really well. We look at the good
things we did and in the next match hope to perform more consistently. You saw the way Kemar
started off [this morning] but once the hardness went from the ball it was difficult against the England
batsmen. We didn't get as many runs as we wanted in the first innings but the way we fought back
we can take encouragement for the next match. I think this team have been working really hard and
whoever comes in in we are going to welcome them."
Sammy also says that Shane Shillingford may play in the next Test and adds that it is up to the
selectors whether Chris Gayle is considered now that his IPL involvement is over. He also praises
Chanderpaul's contribution: "That's something we're used to with Shiv, his experience in the
dressing room helps the youngsters. He loves playing in England, he doesn't get out in England."
England captain Andrew Strauss: "We felt that the wicket was pretty flat and we had a good chance
of getting the target but you never know and we put ourselves in a tricky position last night. I thought
the wicket would flatten out and Alastair Cook and Ian Bell went about getting the runs in a sensible,
civilised way. When you have to dig a bit deeper to get over the line it makes it that bit more
satisfying. It was a good run out, we'll have to see how everyone is feeling before the next Test. It
was nice to get that hundred and when you do it in a winning cause it makes it more special. Ian Bell
has been playing brilliantly for a long time and it was just a case of him reconnecting with his method
and he showed how good he is."
England's Stuart Broad is named Man of the Match: "Winning the toss and bowling puts a bit of
pressure on the bowling group but we never expected it to be a 100-all-out wicket. I think all the
bowlers found we just got into it throughout the first day and to have them nine down for 240-odd
was a great effort. We had to work very hard for this victory. It's obviously pleasing to get on all three
honours boards - particularly as my dad didn't get on the batting one - but winning Test matches is
the most important thing. Jimmy likes bowling from the Pavilion End, he gets the choice but I found a
good rythm from the Nursery End. It's all about mentally and physically preparing for the next Test
now."
And that brings the curtain down on a fascinating Test, a really good start to the English summer and
a match to remember for the likes of Andrew Strauss and Stuart Broad, Shivnarine Chanderpaul and
Kemar Roach. We'll be back to hum the tune for the second Test, starting on Friday, with our cap in
hand, asking: "Please sir, can we have some more?" See you then, ta ra!
2.40pm: So, with victory England take a 1-0 lead in the series. It's the result most had predicted but
the journey there took an unexpectedly scenic route (although I suppose that description depends on
how much you enjoy watching Shiv Chanderpaul bat). Before the Test, Ottis Gibson, the West Indies
coach, said he wanted his team to improve on their last visit to Lord's, which was over inside three
days, and they certainly managed that. It may have ended in the cliched "noble defeat" but
there is genuine reason to be encouraged about West Indies' progress. The real test is whether they
can take what they've learned from this game and push England even harder at Trent Bridge.
String matching code to extract player names
#include <stdio.h>
#include <string.h>
// str: string
// wrd: word to find in str
// the function returns 1 if wrd is present in str
// otherwise it returns 0
int CheckWordInString(char* str,char* wrd) {
int i, j, flag, n, m;
n = strlen(str); // length of str
m = strlen(wrd); // length of wrd
// if size of wrd is bigger then str then str can never contain wrd
if (m > n)
return 0;
while (i < n) {
// checking if the current word in str
// is equal to wrd or not
j = 0;
while (i < n && j < m && str[i] == wrd[j]) {
++i;
++j;
}
// j == m signifies that current word is equal to wrd
// Therefore, wrd is present in str, thuswe return 1 (true)
// if you don't add the condition ( i == n || str[i] == ' '), then
// the function will return true if the proper prefix of a word in str
// is equal to wrd
if (( i == n || str[i] == ' ') && j == m)
return 1;
// if j != m then the current word in str is not
// equal to wrd
// thus, we move to the next word
while (i < n && str[i] != ' ') {
++i;
}
++i;
}
// reaching this step means
// no match was found
// return false
return 0;
}
int main() {
char str[100]; // input string
char wrd[100]; // word to search
printf("Enter String: ");
gets(str);
printf("Enter Word to Search in the String: ");
gets(wrd);
if (CheckWordInString(str, wrd)) {
printf("%s is present in the string", wrd);
}
else {
printf("%s is not present in the string", wrd);
}
}
Output:
Adrian Barath c Anderson b Broad 42 101 136 9 0 41.58
Kieran Powell b Anderson 5 29 36 1 0 17.24
Kirk Edwards lbw b Anderson 1 14 26 0 0 7.14
Darren Bravo run out (Bell/†Prior/Swann) 29 74 105 4 0 39.18
Shivnarine Chanderpaul not out 87 175 242 12 0 49.71
Marlon Samuels c Bairstow b Broad 31 84 110 4 0 36.90
Denesh Ramdin † c Strauss b Broad 6 5 6 1 0 120.00
Daren Sammy (c) c Bresnan b Broad 17 36 50 3 0 47.22
Kemar Roach c & b Broad 6 7 15 1 0 85.71
Fidel Edwards c †Prior b Broad 2 16 19 0 0 12.50
Shannon Gabriel c Swann b Broad 0 1 1 0 0 0.00

More Related Content

More from Radhe Syam

DS.ppt
DS.pptDS.ppt
DS.ppt
Radhe Syam
 
week4_python.docx
week4_python.docxweek4_python.docx
week4_python.docx
Radhe Syam
 
Searching&amp;sorting
Searching&amp;sortingSearching&amp;sorting
Searching&amp;sorting
Radhe Syam
 
Array strings
Array stringsArray strings
Array strings
Radhe Syam
 
Structures
StructuresStructures
Structures
Radhe Syam
 
Algorithms and tools for point cloud generation
Algorithms and tools for point cloud generationAlgorithms and tools for point cloud generation
Algorithms and tools for point cloud generation
Radhe Syam
 

More from Radhe Syam (6)

DS.ppt
DS.pptDS.ppt
DS.ppt
 
week4_python.docx
week4_python.docxweek4_python.docx
week4_python.docx
 
Searching&amp;sorting
Searching&amp;sortingSearching&amp;sorting
Searching&amp;sorting
 
Array strings
Array stringsArray strings
Array strings
 
Structures
StructuresStructures
Structures
 
Algorithms and tools for point cloud generation
Algorithms and tools for point cloud generationAlgorithms and tools for point cloud generation
Algorithms and tools for point cloud generation
 

Recently uploaded

Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
Gas agency management system project report.pdf
Gas agency management system project report.pdfGas agency management system project report.pdf
Gas agency management system project report.pdf
Kamal Acharya
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
morris_worm_intro_and_source_code_analysis_.pdf
morris_worm_intro_and_source_code_analysis_.pdfmorris_worm_intro_and_source_code_analysis_.pdf
morris_worm_intro_and_source_code_analysis_.pdf
ycwu0509
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
harshapolam10
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
PriyankaKilaniya
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
RamonNovais6
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
bijceesjournal
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
Engineering Standards Wiring methods.pdf
Engineering Standards Wiring methods.pdfEngineering Standards Wiring methods.pdf
Engineering Standards Wiring methods.pdf
edwin408357
 

Recently uploaded (20)

Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
Gas agency management system project report.pdf
Gas agency management system project report.pdfGas agency management system project report.pdf
Gas agency management system project report.pdf
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
morris_worm_intro_and_source_code_analysis_.pdf
morris_worm_intro_and_source_code_analysis_.pdfmorris_worm_intro_and_source_code_analysis_.pdf
morris_worm_intro_and_source_code_analysis_.pdf
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
Engineering Standards Wiring methods.pdf
Engineering Standards Wiring methods.pdfEngineering Standards Wiring methods.pdf
Engineering Standards Wiring methods.pdf
 

Pradunma daa

  • 1. Score board generation using C/C++ Input: https://www.espncricinfo.com/ci/engine/series/index.html In the match take commentaryas inputtoyour programand generate the outputas score board as given. The code shouldbe compatible toanymatches. Note:  Differentiate testone day  Fetchplayername fromcommentary  Use regularexpression/stringmatching/stringsplittingtoseparate playersname andall  Structure needstolooksimilar onlynoneedtoshow table  Inputwill be takenasfile readandoutputwill be file write  Reportwriting(will explainedlater) Sample Inputconsideredfortestcase isas below From the givenURL https://www.espncricinfo.com/ci/engine/series/index.html The 2010s2012TESTSThe WisdenTrophy,May-Jun2012 (WestIndiesinEngland)May17-21, 2012 - 1st Test at Lord's, London Score card 2.50pm: Time for the presentations, then. First the umpires get their medals - and they deserve them, the standard is really high among the elite group and Aleem Dar and Marais Erasmus again had an excellent Test. West Indies captain, Darren Sammy: "I think some guys performed really well. We look at the good things we did and in the next match hope to perform more consistently. You saw the way Kemar started off [this morning] but once the hardness went from the ball it was difficult against the England batsmen. We didn't get as many runs as we wanted in the first innings but the way we fought back we can take encouragement for the next match. I think this team have been working really hard and whoever comes in in we are going to welcome them." Sammy also says that Shane Shillingford may play in the next Test and adds that it is up to the selectors whether Chris Gayle is considered now that his IPL involvement is over. He also praises Chanderpaul's contribution: "That's something we're used to with Shiv, his experience in the dressing room helps the youngsters. He loves playing in England, he doesn't get out in England." England captain Andrew Strauss: "We felt that the wicket was pretty flat and we had a good chance of getting the target but you never know and we put ourselves in a tricky position last night. I thought the wicket would flatten out and Alastair Cook and Ian Bell went about getting the runs in a sensible, civilised way. When you have to dig a bit deeper to get over the line it makes it that bit more
  • 2. satisfying. It was a good run out, we'll have to see how everyone is feeling before the next Test. It was nice to get that hundred and when you do it in a winning cause it makes it more special. Ian Bell has been playing brilliantly for a long time and it was just a case of him reconnecting with his method and he showed how good he is." England's Stuart Broad is named Man of the Match: "Winning the toss and bowling puts a bit of pressure on the bowling group but we never expected it to be a 100-all-out wicket. I think all the bowlers found we just got into it throughout the first day and to have them nine down for 240-odd was a great effort. We had to work very hard for this victory. It's obviously pleasing to get on all three honours boards - particularly as my dad didn't get on the batting one - but winning Test matches is the most important thing. Jimmy likes bowling from the Pavilion End, he gets the choice but I found a good rythm from the Nursery End. It's all about mentally and physically preparing for the next Test now." And that brings the curtain down on a fascinating Test, a really good start to the English summer and a match to remember for the likes of Andrew Strauss and Stuart Broad, Shivnarine Chanderpaul and Kemar Roach. We'll be back to hum the tune for the second Test, starting on Friday, with our cap in hand, asking: "Please sir, can we have some more?" See you then, ta ra! 2.40pm: So, with victory England take a 1-0 lead in the series. It's the result most had predicted but the journey there took an unexpectedly scenic route (although I suppose that description depends on how much you enjoy watching Shiv Chanderpaul bat). Before the Test, Ottis Gibson, the West Indies coach, said he wanted his team to improve on their last visit to Lord's, which was over inside three days, and they certainly managed that. It may have ended in the cliched "noble defeat" but there is genuine reason to be encouraged about West Indies' progress. The real test is whether they can take what they've learned from this game and push England even harder at Trent Bridge. String matching code to extract player names #include <stdio.h> #include <string.h> // str: string // wrd: word to find in str // the function returns 1 if wrd is present in str // otherwise it returns 0 int CheckWordInString(char* str,char* wrd) { int i, j, flag, n, m; n = strlen(str); // length of str m = strlen(wrd); // length of wrd // if size of wrd is bigger then str then str can never contain wrd if (m > n) return 0; while (i < n) { // checking if the current word in str // is equal to wrd or not j = 0; while (i < n && j < m && str[i] == wrd[j]) {
  • 3. ++i; ++j; } // j == m signifies that current word is equal to wrd // Therefore, wrd is present in str, thuswe return 1 (true) // if you don't add the condition ( i == n || str[i] == ' '), then // the function will return true if the proper prefix of a word in str // is equal to wrd if (( i == n || str[i] == ' ') && j == m) return 1; // if j != m then the current word in str is not // equal to wrd // thus, we move to the next word while (i < n && str[i] != ' ') { ++i; } ++i; } // reaching this step means // no match was found // return false return 0; } int main() { char str[100]; // input string char wrd[100]; // word to search printf("Enter String: "); gets(str); printf("Enter Word to Search in the String: "); gets(wrd); if (CheckWordInString(str, wrd)) { printf("%s is present in the string", wrd); } else { printf("%s is not present in the string", wrd); } }
  • 4. Output: Adrian Barath c Anderson b Broad 42 101 136 9 0 41.58 Kieran Powell b Anderson 5 29 36 1 0 17.24 Kirk Edwards lbw b Anderson 1 14 26 0 0 7.14 Darren Bravo run out (Bell/†Prior/Swann) 29 74 105 4 0 39.18 Shivnarine Chanderpaul not out 87 175 242 12 0 49.71 Marlon Samuels c Bairstow b Broad 31 84 110 4 0 36.90 Denesh Ramdin † c Strauss b Broad 6 5 6 1 0 120.00 Daren Sammy (c) c Bresnan b Broad 17 36 50 3 0 47.22 Kemar Roach c & b Broad 6 7 15 1 0 85.71 Fidel Edwards c †Prior b Broad 2 16 19 0 0 12.50 Shannon Gabriel c Swann b Broad 0 1 1 0 0 0.00