SlideShare a Scribd company logo
1 of 2
UNIVERSITI TUN HUSSEIN ONN MALAYSIA
                    FACULTY OF MECHANICAL AND MANUFACTURING ENGINEERING
                    BTI 10202: COMPUTER PROGRAMMING

 LAB 6: Control Structure –Part 3
 NAME     : ______________________________________                               MARK

 MATRICS NO.: ____________________ DATE : ________


Objective: Students will be able to write C program using combinations of control structure
technique.

Exercise 1:
An institute offers a course that prepares students for the licensing exam for real brokers.
Last year, several of the students who completed this course took the licensing examination.
Naturally, the institute wants to know how well its students did on the exam. You have been
asked to write a program to summarize the results. You have been given a list of these 15
students. From the list of result the program should able to segregate between pass and fail.
Students with test result between 0-39 will be mark as failed while 40-100 mark as passed.

Your program should analyze the results of the exam as follow:
1. Input each test result (i.e. 20, 55). Display the message “Enter result <no>” on the
    screen each time the program requests another test result.
2. Display a summary of the test results indicating the number of students who passed and
    the number of students who failed.
3. If more than 6 students failed in the exam, print message “Need teaching
    improvement!”

(Tips: pseudo-code given as following)

Declare result as floating number
Declare and Initialize pass to zero
Declare and Initialize fail to zero
Declare and Initialize student counter to one

While student counter is less than or equal to fifteen
    Label reenter
    Get result

    If result is smaller and equal to 100 and result is larger and equal to 40
          Add one to pass
       Add one to student counter




                                                                                                1
Else if result is smaller than 40 and result is larger and equal to 0
         Add one to fail
         Add one to student counter
 Else
         go to label reenter

Print the number of pass
Print the number of fail`

If more than 6 students failed
     Print “Need teaching improvement”

Re-write your program:




                                                                            2

More Related Content

Viewers also liked

Dti2143 lab sheet 7
Dti2143 lab sheet 7Dti2143 lab sheet 7
Dti2143 lab sheet 7alish sha
 
Lab 5 2012/2012
Lab 5 2012/2012Lab 5 2012/2012
Lab 5 2012/2012alish sha
 
Lab 10 sem ii_12_13
Lab 10 sem ii_12_13Lab 10 sem ii_12_13
Lab 10 sem ii_12_13alish sha
 
Lab 9 sem ii_12_13
Lab 9 sem ii_12_13Lab 9 sem ii_12_13
Lab 9 sem ii_12_13alish sha
 
What are the causes of conflicts (Bahasa Malaysia)
What are the causes of conflicts (Bahasa Malaysia)What are the causes of conflicts (Bahasa Malaysia)
What are the causes of conflicts (Bahasa Malaysia)alish sha
 

Viewers also liked (8)

Dti2143 lab sheet 7
Dti2143 lab sheet 7Dti2143 lab sheet 7
Dti2143 lab sheet 7
 
Chapter1 6
Chapter1 6Chapter1 6
Chapter1 6
 
Lab 6
Lab 6Lab 6
Lab 6
 
Lab sheet 1
Lab sheet 1Lab sheet 1
Lab sheet 1
 
Lab 5 2012/2012
Lab 5 2012/2012Lab 5 2012/2012
Lab 5 2012/2012
 
Lab 10 sem ii_12_13
Lab 10 sem ii_12_13Lab 10 sem ii_12_13
Lab 10 sem ii_12_13
 
Lab 9 sem ii_12_13
Lab 9 sem ii_12_13Lab 9 sem ii_12_13
Lab 9 sem ii_12_13
 
What are the causes of conflicts (Bahasa Malaysia)
What are the causes of conflicts (Bahasa Malaysia)What are the causes of conflicts (Bahasa Malaysia)
What are the causes of conflicts (Bahasa Malaysia)
 

Similar to Lab 6 sem ii_11_12

Accn4 2121-accn4-w-ms-jun 12
Accn4 2121-accn4-w-ms-jun 12Accn4 2121-accn4-w-ms-jun 12
Accn4 2121-accn4-w-ms-jun 12Sam Catlin
 
CIS/115 CIS 115 CIS115 You Have Been Asked To Design A Program That Will Allo...
CIS/115 CIS 115 CIS115 You Have Been Asked To Design A Program That Will Allo...CIS/115 CIS 115 CIS115 You Have Been Asked To Design A Program That Will Allo...
CIS/115 CIS 115 CIS115 You Have Been Asked To Design A Program That Will Allo...itartist90
 
Cis 115 i lab 4 of 7
Cis 115 i lab 4 of 7Cis 115 i lab 4 of 7
Cis 115 i lab 4 of 7helpido9
 
AIHR_Measuring_Learning_Effectiveness.pdf
AIHR_Measuring_Learning_Effectiveness.pdfAIHR_Measuring_Learning_Effectiveness.pdf
AIHR_Measuring_Learning_Effectiveness.pdfYodhyPrabuJaya
 
Contemporary Marketing for Sustainability (CMS) SLIM 2017 June
Contemporary Marketing for Sustainability (CMS) SLIM 2017 JuneContemporary Marketing for Sustainability (CMS) SLIM 2017 June
Contemporary Marketing for Sustainability (CMS) SLIM 2017 JuneShehan Timothy Perera
 
Cis 115 i lab 4 of 7
Cis 115 i lab 4 of 7Cis 115 i lab 4 of 7
Cis 115 i lab 4 of 7comp274
 
College of administrative and financial sciences assignme
College of administrative and financial sciences assignmeCollege of administrative and financial sciences assignme
College of administrative and financial sciences assignmenand15
 
LSSGB_Project_SimpliLearn.ppt
LSSGB_Project_SimpliLearn.pptLSSGB_Project_SimpliLearn.ppt
LSSGB_Project_SimpliLearn.pptMash92
 
Covidien Dc Work Keys 101 2
Covidien Dc    Work Keys 101 2Covidien Dc    Work Keys 101 2
Covidien Dc Work Keys 101 2LauraAtACT
 
Sec ed esl fl_ts faculty instructional guide_revised 10.18.13
Sec ed esl fl_ts faculty instructional guide_revised 10.18.13Sec ed esl fl_ts faculty instructional guide_revised 10.18.13
Sec ed esl fl_ts faculty instructional guide_revised 10.18.13OPPA
 
Bil sped ts faculty instructional guide_revised 10.18.13
Bil sped ts faculty instructional guide_revised 10.18.13Bil sped ts faculty instructional guide_revised 10.18.13
Bil sped ts faculty instructional guide_revised 10.18.13OPPA
 
PPT on implementing Kirkpatrickk Model
PPT on implementing Kirkpatrickk ModelPPT on implementing Kirkpatrickk Model
PPT on implementing Kirkpatrickk ModelShobitash Jamwal
 
Devry cis 115 week 4 lab grade calendar
Devry cis 115 week 4 lab grade calendarDevry cis 115 week 4 lab grade calendar
Devry cis 115 week 4 lab grade calendarshyaminfo12
 
Devry cis 115 week 4 lab grade calendar
Devry cis 115 week 4 lab grade calendarDevry cis 115 week 4 lab grade calendar
Devry cis 115 week 4 lab grade calendarshamek1236
 
Ecse ts faculty instructional guide revised 10.18.13
Ecse ts faculty instructional guide revised 10.18.13Ecse ts faculty instructional guide revised 10.18.13
Ecse ts faculty instructional guide revised 10.18.13OPPA
 
Ed admin ts faculty instructional guide revised 10.18.13
Ed admin ts faculty instructional guide revised 10.18.13Ed admin ts faculty instructional guide revised 10.18.13
Ed admin ts faculty instructional guide revised 10.18.13OPPA
 
Devry cis 115 week 4 lab grade calendar
Devry cis 115 week 4 lab grade calendarDevry cis 115 week 4 lab grade calendar
Devry cis 115 week 4 lab grade calendareyavagal
 
Cebd ts faculty instructional guide revised 10.18.13
Cebd ts faculty instructional guide revised 10.18.13Cebd ts faculty instructional guide revised 10.18.13
Cebd ts faculty instructional guide revised 10.18.13OPPA
 

Similar to Lab 6 sem ii_11_12 (20)

Accn4 2121-accn4-w-ms-jun 12
Accn4 2121-accn4-w-ms-jun 12Accn4 2121-accn4-w-ms-jun 12
Accn4 2121-accn4-w-ms-jun 12
 
CIS/115 CIS 115 CIS115 You Have Been Asked To Design A Program That Will Allo...
CIS/115 CIS 115 CIS115 You Have Been Asked To Design A Program That Will Allo...CIS/115 CIS 115 CIS115 You Have Been Asked To Design A Program That Will Allo...
CIS/115 CIS 115 CIS115 You Have Been Asked To Design A Program That Will Allo...
 
Cis 115 i lab 4 of 7
Cis 115 i lab 4 of 7Cis 115 i lab 4 of 7
Cis 115 i lab 4 of 7
 
Statistics-1 : The Basics of Statistics
Statistics-1 : The Basics of StatisticsStatistics-1 : The Basics of Statistics
Statistics-1 : The Basics of Statistics
 
AIHR_Measuring_Learning_Effectiveness.pdf
AIHR_Measuring_Learning_Effectiveness.pdfAIHR_Measuring_Learning_Effectiveness.pdf
AIHR_Measuring_Learning_Effectiveness.pdf
 
Contemporary Marketing for Sustainability (CMS) SLIM 2017 June
Contemporary Marketing for Sustainability (CMS) SLIM 2017 JuneContemporary Marketing for Sustainability (CMS) SLIM 2017 June
Contemporary Marketing for Sustainability (CMS) SLIM 2017 June
 
Cis 115 i lab 4 of 7
Cis 115 i lab 4 of 7Cis 115 i lab 4 of 7
Cis 115 i lab 4 of 7
 
College of administrative and financial sciences assignme
College of administrative and financial sciences assignmeCollege of administrative and financial sciences assignme
College of administrative and financial sciences assignme
 
LSSGB_Project_SimpliLearn.ppt
LSSGB_Project_SimpliLearn.pptLSSGB_Project_SimpliLearn.ppt
LSSGB_Project_SimpliLearn.ppt
 
Cs 1114 - lecture-7
Cs 1114 - lecture-7Cs 1114 - lecture-7
Cs 1114 - lecture-7
 
Covidien Dc Work Keys 101 2
Covidien Dc    Work Keys 101 2Covidien Dc    Work Keys 101 2
Covidien Dc Work Keys 101 2
 
Sec ed esl fl_ts faculty instructional guide_revised 10.18.13
Sec ed esl fl_ts faculty instructional guide_revised 10.18.13Sec ed esl fl_ts faculty instructional guide_revised 10.18.13
Sec ed esl fl_ts faculty instructional guide_revised 10.18.13
 
Bil sped ts faculty instructional guide_revised 10.18.13
Bil sped ts faculty instructional guide_revised 10.18.13Bil sped ts faculty instructional guide_revised 10.18.13
Bil sped ts faculty instructional guide_revised 10.18.13
 
PPT on implementing Kirkpatrickk Model
PPT on implementing Kirkpatrickk ModelPPT on implementing Kirkpatrickk Model
PPT on implementing Kirkpatrickk Model
 
Devry cis 115 week 4 lab grade calendar
Devry cis 115 week 4 lab grade calendarDevry cis 115 week 4 lab grade calendar
Devry cis 115 week 4 lab grade calendar
 
Devry cis 115 week 4 lab grade calendar
Devry cis 115 week 4 lab grade calendarDevry cis 115 week 4 lab grade calendar
Devry cis 115 week 4 lab grade calendar
 
Ecse ts faculty instructional guide revised 10.18.13
Ecse ts faculty instructional guide revised 10.18.13Ecse ts faculty instructional guide revised 10.18.13
Ecse ts faculty instructional guide revised 10.18.13
 
Ed admin ts faculty instructional guide revised 10.18.13
Ed admin ts faculty instructional guide revised 10.18.13Ed admin ts faculty instructional guide revised 10.18.13
Ed admin ts faculty instructional guide revised 10.18.13
 
Devry cis 115 week 4 lab grade calendar
Devry cis 115 week 4 lab grade calendarDevry cis 115 week 4 lab grade calendar
Devry cis 115 week 4 lab grade calendar
 
Cebd ts faculty instructional guide revised 10.18.13
Cebd ts faculty instructional guide revised 10.18.13Cebd ts faculty instructional guide revised 10.18.13
Cebd ts faculty instructional guide revised 10.18.13
 

More from alish sha

T22016 – how to answer with ubs 9
T22016 – how to answer with ubs 9T22016 – how to answer with ubs 9
T22016 – how to answer with ubs 9alish sha
 
July 2014 theory exam (theory)
July 2014 theory exam (theory)July 2014 theory exam (theory)
July 2014 theory exam (theory)alish sha
 
Accounting basic equation
Accounting basic equation Accounting basic equation
Accounting basic equation alish sha
 
It 302 computerized accounting (week 2) - sharifah
It 302   computerized accounting (week 2) - sharifahIt 302   computerized accounting (week 2) - sharifah
It 302 computerized accounting (week 2) - sharifahalish sha
 
It 302 computerized accounting (week 1) - sharifah
It 302   computerized accounting (week 1) - sharifahIt 302   computerized accounting (week 1) - sharifah
It 302 computerized accounting (week 1) - sharifahalish sha
 
Test 1 skema q&a
Test 1 skema q&aTest 1 skema q&a
Test 1 skema q&aalish sha
 
Test 1 skema q&a
Test 1 skema q&aTest 1 skema q&a
Test 1 skema q&aalish sha
 
Final project
Final projectFinal project
Final projectalish sha
 
Final project
Final projectFinal project
Final projectalish sha
 
Attn list test
Attn list testAttn list test
Attn list testalish sha
 
Carry markdam31303
Carry markdam31303Carry markdam31303
Carry markdam31303alish sha
 
Final project
Final projectFinal project
Final projectalish sha
 
Final project
Final projectFinal project
Final projectalish sha
 
Dti2143 dam31303 lab sheet 8
Dti2143 dam31303 lab sheet 8Dti2143 dam31303 lab sheet 8
Dti2143 dam31303 lab sheet 8alish sha
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7alish sha
 
Dti2143 lab sheet 6
Dti2143 lab sheet 6Dti2143 lab sheet 6
Dti2143 lab sheet 6alish sha
 
Math hquickissential
Math hquickissentialMath hquickissential
Math hquickissentialalish sha
 
Dti2143 dam31303 lab sheet 5
Dti2143 dam31303 lab sheet 5Dti2143 dam31303 lab sheet 5
Dti2143 dam31303 lab sheet 5alish sha
 
Dam31303 lab sheet 4
Dam31303 lab sheet 4Dam31303 lab sheet 4
Dam31303 lab sheet 4alish sha
 

More from alish sha (20)

T22016 – how to answer with ubs 9
T22016 – how to answer with ubs 9T22016 – how to answer with ubs 9
T22016 – how to answer with ubs 9
 
July 2014 theory exam (theory)
July 2014 theory exam (theory)July 2014 theory exam (theory)
July 2014 theory exam (theory)
 
Accounting basic equation
Accounting basic equation Accounting basic equation
Accounting basic equation
 
It 302 computerized accounting (week 2) - sharifah
It 302   computerized accounting (week 2) - sharifahIt 302   computerized accounting (week 2) - sharifah
It 302 computerized accounting (week 2) - sharifah
 
It 302 computerized accounting (week 1) - sharifah
It 302   computerized accounting (week 1) - sharifahIt 302   computerized accounting (week 1) - sharifah
It 302 computerized accounting (week 1) - sharifah
 
Test 1 skema q&a
Test 1 skema q&aTest 1 skema q&a
Test 1 skema q&a
 
Test 1 skema q&a
Test 1 skema q&aTest 1 skema q&a
Test 1 skema q&a
 
Final project
Final projectFinal project
Final project
 
Final project
Final projectFinal project
Final project
 
Attn list test
Attn list testAttn list test
Attn list test
 
Carry markdam31303
Carry markdam31303Carry markdam31303
Carry markdam31303
 
Final project
Final projectFinal project
Final project
 
Final project
Final projectFinal project
Final project
 
Dti2143 dam31303 lab sheet 8
Dti2143 dam31303 lab sheet 8Dti2143 dam31303 lab sheet 8
Dti2143 dam31303 lab sheet 8
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7
 
Dti2143 lab sheet 6
Dti2143 lab sheet 6Dti2143 lab sheet 6
Dti2143 lab sheet 6
 
Math hquickissential
Math hquickissentialMath hquickissential
Math hquickissential
 
Dti2143 dam31303 lab sheet 5
Dti2143 dam31303 lab sheet 5Dti2143 dam31303 lab sheet 5
Dti2143 dam31303 lab sheet 5
 
Rpp
RppRpp
Rpp
 
Dam31303 lab sheet 4
Dam31303 lab sheet 4Dam31303 lab sheet 4
Dam31303 lab sheet 4
 

Recently uploaded

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 

Recently uploaded (20)

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 

Lab 6 sem ii_11_12

  • 1. UNIVERSITI TUN HUSSEIN ONN MALAYSIA FACULTY OF MECHANICAL AND MANUFACTURING ENGINEERING BTI 10202: COMPUTER PROGRAMMING LAB 6: Control Structure –Part 3 NAME : ______________________________________ MARK MATRICS NO.: ____________________ DATE : ________ Objective: Students will be able to write C program using combinations of control structure technique. Exercise 1: An institute offers a course that prepares students for the licensing exam for real brokers. Last year, several of the students who completed this course took the licensing examination. Naturally, the institute wants to know how well its students did on the exam. You have been asked to write a program to summarize the results. You have been given a list of these 15 students. From the list of result the program should able to segregate between pass and fail. Students with test result between 0-39 will be mark as failed while 40-100 mark as passed. Your program should analyze the results of the exam as follow: 1. Input each test result (i.e. 20, 55). Display the message “Enter result <no>” on the screen each time the program requests another test result. 2. Display a summary of the test results indicating the number of students who passed and the number of students who failed. 3. If more than 6 students failed in the exam, print message “Need teaching improvement!” (Tips: pseudo-code given as following) Declare result as floating number Declare and Initialize pass to zero Declare and Initialize fail to zero Declare and Initialize student counter to one While student counter is less than or equal to fifteen Label reenter Get result If result is smaller and equal to 100 and result is larger and equal to 40 Add one to pass Add one to student counter 1
  • 2. Else if result is smaller than 40 and result is larger and equal to 0 Add one to fail Add one to student counter Else go to label reenter Print the number of pass Print the number of fail` If more than 6 students failed Print “Need teaching improvement” Re-write your program: 2