SlideShare a Scribd company logo
1 of 1
Dr. A.Q.Khan Institute of Computer Science and Information Technology
Kahuta Distt. Rawalpindi
(End Semester Exam Spring 2016)
Subject: Programming Fundamentals
Registration No: _____________
Student Name:____________________
Class /Semester: BSCS-1
Credit Hours:__4_____
Duration:_180 mins___
Total Marks: 50______
___________________________________________________________________________
Q no. 01: (12.5)
Write C++ code that compares the value of ‘X’ element entered by the user in order to count the occurrence of
‘X’ element in the list of integer numbers. Your code should output the element X, number of times element X
has appeared, it should also display message if that ‘X’ element doesn’t exist in the array. All the abnormal
conditions must be handled by the code. (make separate functions)
Q no. 2: (12.5)
Write simple C++ code for letting the user play the following game:
The game will be played with two dice. Each time the pair of dice is tossed, the sum of two number that
comes up is used. That sum will be an integer in the range 2 to 12 since the faces of each die are number 1 to 6.
The player wins immediately if he tosses a 7 or 11, and user loses immediately if he tosses a 2,3 or 12. If user
tosses a 4,5,6,8,9 or 10 then that number becomes his ‘point’. The user then repeats tossing the dice until he
wins by making his point or he losses by tossing a 7.
Q no. 3: (12.5)
Write and run a program that plays the game of “Rock, paper, scissors.” Your game must possess the following
:-In this game, two players simultaneously say (or display a hand symbol representing) either “rock,” “paper,”
or “scissors.” The winner is the one whose choice dominates the other. The rules are: paper dominates (wraps)
rock, rock dominates (breaks) scissors, and scissors dominate (cut) paper. (Hint: Use functions).
Q no. 4: (12.5)
Write and run a program like that computes and prints both the mean and the standard deviation of the input
data. The standard deviation of the n numbers ao, . . ., an-1, is defined by the formula
where is the mean of the data.
Extend the program that it also computes and prints the Z-scores of the input data. The Z-scores of the n
numbers ao, . . ., anml are defined by the formula zi = (ai - )/ . They normalize the given data so ,that
it is centered about 0 and has standard deviation 1
All the Best 

More Related Content

What's hot

Fundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersFundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersAbdul Rahman Sherzad
 
Os sample mid exam
Os sample mid examOs sample mid exam
Os sample mid examMesfin123
 
Math 107 final examination answers
Math 107 final examination answersMath 107 final examination answers
Math 107 final examination answersarnitaetsitty
 
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAINFP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAINSyahriha Ruslan
 

What's hot (7)

04 struct-union
04 struct-union04 struct-union
04 struct-union
 
Fundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersFundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and Answers
 
Os sample mid exam
Os sample mid examOs sample mid exam
Os sample mid exam
 
Math 107 final examination answers
Math 107 final examination answersMath 107 final examination answers
Math 107 final examination answers
 
D-Square statistic
D-Square statisticD-Square statistic
D-Square statistic
 
016 lesson 7
016 lesson 7016 lesson 7
016 lesson 7
 
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAINFP304 DATABASE SYSTEM  PAPER FINAL EXAM AGAIN
FP304 DATABASE SYSTEM PAPER FINAL EXAM AGAIN
 

Similar to End term

C++ programming exercise
C++ programming exerciseC++ programming exercise
C++ programming exercisekhapul
 
1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docx1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docxmercysuttle
 
1 ECE 175 Computer Programming for Engineering Applica.docx
1  ECE 175 Computer Programming for Engineering Applica.docx1  ECE 175 Computer Programming for Engineering Applica.docx
1 ECE 175 Computer Programming for Engineering Applica.docxoswald1horne84988
 
CSP1150D Programming Principles
CSP1150D Programming PrinciplesCSP1150D Programming Principles
CSP1150D Programming PrinciplesNicole Valerio
 
Industrial Control System Assignment Help|25% Online Assignment Help
Industrial Control System Assignment Help|25% Online Assignment HelpIndustrial Control System Assignment Help|25% Online Assignment Help
Industrial Control System Assignment Help|25% Online Assignment HelpNicole Valerio
 
Hw8Excel - Exercise 8 Mail Merge-2.docINFS 3250In Class Pro.docx
Hw8Excel - Exercise 8 Mail Merge-2.docINFS 3250In Class Pro.docxHw8Excel - Exercise 8 Mail Merge-2.docINFS 3250In Class Pro.docx
Hw8Excel - Exercise 8 Mail Merge-2.docINFS 3250In Class Pro.docxadampcarr67227
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2Animesh Chaturvedi
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01Drjilesh
 
Java programming lab assignments
Java programming lab assignments Java programming lab assignments
Java programming lab assignments rajni kaushal
 
Statement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docxStatement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docxwhitneyleman54422
 
Ge6161 lab manual
Ge6161 lab manualGe6161 lab manual
Ge6161 lab manualMani Kandan
 
ISM3230 In-class lab 8 Spring 2019 TOPIC Introduction .docx
ISM3230 In-class lab 8 Spring 2019 TOPIC  Introduction .docxISM3230 In-class lab 8 Spring 2019 TOPIC  Introduction .docx
ISM3230 In-class lab 8 Spring 2019 TOPIC Introduction .docxvrickens
 
Gradient boosting for regression problems with example basics of regression...
Gradient boosting for regression problems with example   basics of regression...Gradient boosting for regression problems with example   basics of regression...
Gradient boosting for regression problems with example basics of regression...prateek kumar
 
Assignment Java Programming 2
Assignment Java Programming 2Assignment Java Programming 2
Assignment Java Programming 2Kaela Johnson
 

Similar to End term (20)

C++ programming exercise
C++ programming exerciseC++ programming exercise
C++ programming exercise
 
1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docx1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docx
 
1 ECE 175 Computer Programming for Engineering Applica.docx
1  ECE 175 Computer Programming for Engineering Applica.docx1  ECE 175 Computer Programming for Engineering Applica.docx
1 ECE 175 Computer Programming for Engineering Applica.docx
 
CSP1150D Programming Principles
CSP1150D Programming PrinciplesCSP1150D Programming Principles
CSP1150D Programming Principles
 
Industrial Control System Assignment Help|25% Online Assignment Help
Industrial Control System Assignment Help|25% Online Assignment HelpIndustrial Control System Assignment Help|25% Online Assignment Help
Industrial Control System Assignment Help|25% Online Assignment Help
 
Hw8Excel - Exercise 8 Mail Merge-2.docINFS 3250In Class Pro.docx
Hw8Excel - Exercise 8 Mail Merge-2.docINFS 3250In Class Pro.docxHw8Excel - Exercise 8 Mail Merge-2.docINFS 3250In Class Pro.docx
Hw8Excel - Exercise 8 Mail Merge-2.docINFS 3250In Class Pro.docx
 
ELAVARASAN.pdf
ELAVARASAN.pdfELAVARASAN.pdf
ELAVARASAN.pdf
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2
 
Java Practice Set
Java Practice SetJava Practice Set
Java Practice Set
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
 
Java programming lab assignments
Java programming lab assignments Java programming lab assignments
Java programming lab assignments
 
Statement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docxStatement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docx
 
Ge6161 lab manual
Ge6161 lab manualGe6161 lab manual
Ge6161 lab manual
 
ISM3230 In-class lab 8 Spring 2019 TOPIC Introduction .docx
ISM3230 In-class lab 8 Spring 2019 TOPIC  Introduction .docxISM3230 In-class lab 8 Spring 2019 TOPIC  Introduction .docx
ISM3230 In-class lab 8 Spring 2019 TOPIC Introduction .docx
 
Lab sheet 1
Lab sheet 1Lab sheet 1
Lab sheet 1
 
R Language
R LanguageR Language
R Language
 
Gradient boosting for regression problems with example basics of regression...
Gradient boosting for regression problems with example   basics of regression...Gradient boosting for regression problems with example   basics of regression...
Gradient boosting for regression problems with example basics of regression...
 
Lab exam question_paper
Lab exam question_paperLab exam question_paper
Lab exam question_paper
 
R Programming Intro
R Programming IntroR Programming Intro
R Programming Intro
 
Assignment Java Programming 2
Assignment Java Programming 2Assignment Java Programming 2
Assignment Java Programming 2
 

More from ZUbaria Inayat

Chapter3 part3-cmm-for-cis6516
Chapter3 part3-cmm-for-cis6516Chapter3 part3-cmm-for-cis6516
Chapter3 part3-cmm-for-cis6516ZUbaria Inayat
 
Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...
Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...
Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...ZUbaria Inayat
 
Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...
Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...
Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...ZUbaria Inayat
 
Salesforce tutorial lec 09
Salesforce tutorial lec 09Salesforce tutorial lec 09
Salesforce tutorial lec 09ZUbaria Inayat
 
End term bsce fall18 26122018
End term bsce fall18 26122018End term bsce fall18 26122018
End term bsce fall18 26122018ZUbaria Inayat
 
A4 montgomery-woodall-six-sigma
A4 montgomery-woodall-six-sigmaA4 montgomery-woodall-six-sigma
A4 montgomery-woodall-six-sigmaZUbaria Inayat
 

More from ZUbaria Inayat (11)

Chapter3 part3-cmm-for-cis6516
Chapter3 part3-cmm-for-cis6516Chapter3 part3-cmm-for-cis6516
Chapter3 part3-cmm-for-cis6516
 
Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...
Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...
Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...
 
Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...
Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...
Explainable artificial-intelligence-xai-for-exploring-spatial-variability-of-...
 
QA in RE
QA in REQA in RE
QA in RE
 
SINP requirements
SINP requirementsSINP requirements
SINP requirements
 
Lecture01 0089
Lecture01 0089Lecture01 0089
Lecture01 0089
 
Sample1
Sample1Sample1
Sample1
 
Salesforce tutorial lec 09
Salesforce tutorial lec 09Salesforce tutorial lec 09
Salesforce tutorial lec 09
 
Tutorial usecases
Tutorial usecasesTutorial usecases
Tutorial usecases
 
End term bsce fall18 26122018
End term bsce fall18 26122018End term bsce fall18 26122018
End term bsce fall18 26122018
 
A4 montgomery-woodall-six-sigma
A4 montgomery-woodall-six-sigmaA4 montgomery-woodall-six-sigma
A4 montgomery-woodall-six-sigma
 

Recently uploaded

HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 

Recently uploaded (20)

HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 

End term

  • 1. Dr. A.Q.Khan Institute of Computer Science and Information Technology Kahuta Distt. Rawalpindi (End Semester Exam Spring 2016) Subject: Programming Fundamentals Registration No: _____________ Student Name:____________________ Class /Semester: BSCS-1 Credit Hours:__4_____ Duration:_180 mins___ Total Marks: 50______ ___________________________________________________________________________ Q no. 01: (12.5) Write C++ code that compares the value of ‘X’ element entered by the user in order to count the occurrence of ‘X’ element in the list of integer numbers. Your code should output the element X, number of times element X has appeared, it should also display message if that ‘X’ element doesn’t exist in the array. All the abnormal conditions must be handled by the code. (make separate functions) Q no. 2: (12.5) Write simple C++ code for letting the user play the following game: The game will be played with two dice. Each time the pair of dice is tossed, the sum of two number that comes up is used. That sum will be an integer in the range 2 to 12 since the faces of each die are number 1 to 6. The player wins immediately if he tosses a 7 or 11, and user loses immediately if he tosses a 2,3 or 12. If user tosses a 4,5,6,8,9 or 10 then that number becomes his ‘point’. The user then repeats tossing the dice until he wins by making his point or he losses by tossing a 7. Q no. 3: (12.5) Write and run a program that plays the game of “Rock, paper, scissors.” Your game must possess the following :-In this game, two players simultaneously say (or display a hand symbol representing) either “rock,” “paper,” or “scissors.” The winner is the one whose choice dominates the other. The rules are: paper dominates (wraps) rock, rock dominates (breaks) scissors, and scissors dominate (cut) paper. (Hint: Use functions). Q no. 4: (12.5) Write and run a program like that computes and prints both the mean and the standard deviation of the input data. The standard deviation of the n numbers ao, . . ., an-1, is defined by the formula where is the mean of the data. Extend the program that it also computes and prints the Z-scores of the input data. The Z-scores of the n numbers ao, . . ., anml are defined by the formula zi = (ai - )/ . They normalize the given data so ,that it is centered about 0 and has standard deviation 1 All the Best 