SlideShare ist ein Scribd-Unternehmen logo
1 von 1
5057775-228600914400-165735  Colegio de San Juan de Letran-Calamba<br />School of Computer Studies and Technology<br />PRELIMINARY EXAMINATION<br />STRUCTURE OF PROGRAMMING LANGUAGES - LABORATORY <br />Name:_______________________________Date: ____________________<br />Yr & Section: ___________________________Prepared by:  VSRivera<br />Using Perl, create a program that will accomplish the following:<br />M A I N  M E N U<br />Multiplication<br />Division<br />Exit<br />Choice: <br />Multiplication – the user should be able to input 2 numbers, the multiplicand and the multiplier. It should output the product of the 2 numbers using repeated addition.<br />Sample Output:<br />Insert Multiplicand: 5<br />Insert Multiplier: 3<br />Product: 15<br />The multiplicand is added to itself multiplier times, that is, if you are going to add 5 to itself 3 times the sum is the same as the product of 5 multiplied to 3.<br />5 + 5 + 5 = 15<br />Division - the user should be able to input 2 numbers, the dividend and the divisor. It should output the quotient of the 2 numbers using repeated subtraction.<br />Sample Output:<br />Insert Dividend: 15<br />Insert Divisor: 3<br />Product: 15<br />The divisor is subtracted from the dividend while the dividend is greater than or equal to the divisor, that is, if you are going to subtract 3 times from 15 while the value is greater than 3, then the number of times 3 will be able to subtract from 15 is the same as the quotient of 15 divided by 3.<br />15 – 3 = 12 – 3 = 9 – 3 = 6 – 3 = 3 – 3 = 0<br />Count the number of times the value 3 was able to subtract from 15 while the difference is greater than or equal to 3.<br />Give an appropriate error message if the value of the divisor is greater than the dividend.<br />Output the remainder if the dividend is not exactly divisible by the divisor.<br />Exit – terminates the program.<br />General instruction:<br />Print this exam paper, do not photocopy.<br />Print your program on a short bond paper (8.5” x 11”).<br />Staple the bond paper with this exam paper being the first page before submitting it.<br />Write your printed name at the upper left side of every bond paper you’ve used and affix your signature on top of the printed name.<br />Put it in a short brown envelope. Write your complete name at the back of the envelope.<br />Submit the envelope personally on or before 12:00 P.M. of July 27, 2011, Wednesday. Time will be based on the wall clock located at the stairway in ITCC. Again, on or before 12:00 P.M. of July 27, 2011. If you think you cannot submit it on time, submit it before the date or the time of submission.<br />Softcopy of the program will be collected during our lecture class on July 27, 2011, Wdnesday.<br />Non-compliance with the instruction will mean non-submission, thus, will require you to take a special exam.<br />

Weitere ähnliche Inhalte

Andere mochten auch

COMELEC III - Bash unit 1 part 2
COMELEC III - Bash unit 1 part 2COMELEC III - Bash unit 1 part 2
COMELEC III - Bash unit 1 part 2Binsent Ribera
 
32 shell-programming
32 shell-programming32 shell-programming
32 shell-programmingkayalkarnan
 
5 scbsalespresentation
5 scbsalespresentation5 scbsalespresentation
5 scbsalespresentationFreddy Ntwari
 
Lesson 7 - Linux Shell Programming
Lesson 7 - Linux Shell ProgrammingLesson 7 - Linux Shell Programming
Lesson 7 - Linux Shell ProgrammingThang Man
 
Lesson 2 - Install Linux & Command Line Environment
Lesson 2 - Install Linux & Command Line EnvironmentLesson 2 - Install Linux & Command Line Environment
Lesson 2 - Install Linux & Command Line EnvironmentThang Man
 
shell programming training | shell programming classes | unix shell programmi...
shell programming training | shell programming classes | unix shell programmi...shell programming training | shell programming classes | unix shell programmi...
shell programming training | shell programming classes | unix shell programmi...Nancy Thomas
 
Fundamental of Shell Programming
Fundamental of Shell ProgrammingFundamental of Shell Programming
Fundamental of Shell ProgrammingRahul Hada
 
COMELEC III - Bash unit 1
COMELEC III - Bash unit 1COMELEC III - Bash unit 1
COMELEC III - Bash unit 1Binsent Ribera
 
Operating systems linux
Operating systems linuxOperating systems linux
Operating systems linuxwilliam_morg
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scriptingvceder
 
Shell Scripting in Linux
Shell Scripting in LinuxShell Scripting in Linux
Shell Scripting in LinuxAnu Chaudhry
 

Andere mochten auch (20)

Syntax analysis
Syntax analysisSyntax analysis
Syntax analysis
 
COMELEC III - Bash unit 1 part 2
COMELEC III - Bash unit 1 part 2COMELEC III - Bash unit 1 part 2
COMELEC III - Bash unit 1 part 2
 
Spsl by sasidhar 3 unit
Spsl by sasidhar  3 unitSpsl by sasidhar  3 unit
Spsl by sasidhar 3 unit
 
Shell programming in ubuntu
Shell programming in ubuntuShell programming in ubuntu
Shell programming in ubuntu
 
32 shell-programming
32 shell-programming32 shell-programming
32 shell-programming
 
Shellscripting
ShellscriptingShellscripting
Shellscripting
 
5 scbsalespresentation
5 scbsalespresentation5 scbsalespresentation
5 scbsalespresentation
 
Linux basics (part 2)
Linux basics (part 2)Linux basics (part 2)
Linux basics (part 2)
 
SHELL PROGRAMMING
SHELL PROGRAMMINGSHELL PROGRAMMING
SHELL PROGRAMMING
 
Lesson 7 - Linux Shell Programming
Lesson 7 - Linux Shell ProgrammingLesson 7 - Linux Shell Programming
Lesson 7 - Linux Shell Programming
 
Lesson 2 - Install Linux & Command Line Environment
Lesson 2 - Install Linux & Command Line EnvironmentLesson 2 - Install Linux & Command Line Environment
Lesson 2 - Install Linux & Command Line Environment
 
shell programming training | shell programming classes | unix shell programmi...
shell programming training | shell programming classes | unix shell programmi...shell programming training | shell programming classes | unix shell programmi...
shell programming training | shell programming classes | unix shell programmi...
 
Fundamental of Shell Programming
Fundamental of Shell ProgrammingFundamental of Shell Programming
Fundamental of Shell Programming
 
COMELEC III - Bash unit 1
COMELEC III - Bash unit 1COMELEC III - Bash unit 1
COMELEC III - Bash unit 1
 
Operating systems linux
Operating systems linuxOperating systems linux
Operating systems linux
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scripting
 
Shell structure
Shell structureShell structure
Shell structure
 
Shell Scripting in Linux
Shell Scripting in LinuxShell Scripting in Linux
Shell Scripting in Linux
 
Shell programming
Shell programmingShell programming
Shell programming
 

Ähnlich wie Perl program for multiplication and division

Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab neweyavagal
 
Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newLast7693
 
Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newscottbrownnn
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEWshyamuopeight
 
Md university cmis 102 week 5 hands
Md university cmis 102 week 5 handsMd university cmis 102 week 5 hands
Md university cmis 102 week 5 handseyavagal
 
CSCI1250 Project 3 Fall 2015 CSCI1250 INTRODUCTIO.docx
CSCI1250    Project 3  Fall 2015  CSCI1250 INTRODUCTIO.docxCSCI1250    Project 3  Fall 2015  CSCI1250 INTRODUCTIO.docx
CSCI1250 Project 3 Fall 2015 CSCI1250 INTRODUCTIO.docxfaithxdunce63732
 
CPSC 120Spring 2014Lab 5Name _____________________.docx
CPSC 120Spring 2014Lab 5Name _____________________.docxCPSC 120Spring 2014Lab 5Name _____________________.docx
CPSC 120Spring 2014Lab 5Name _____________________.docxfaithxdunce63732
 
EDUC 215Health and Wellness Project OverviewFor this assignmen
EDUC 215Health and Wellness Project OverviewFor this assignmenEDUC 215Health and Wellness Project OverviewFor this assignmen
EDUC 215Health and Wellness Project OverviewFor this assignmenEvonCanales257
 
M150 A Fall2010 T01
M150 A Fall2010 T01M150 A Fall2010 T01
M150 A Fall2010 T01abdalodainat
 
Course project solutions 2018
Course project solutions 2018Course project solutions 2018
Course project solutions 2018Robert Geofroy
 
Rightand wrong[1]
Rightand wrong[1]Rightand wrong[1]
Rightand wrong[1]slange
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01Drjilesh
 
Comp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source codeComp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source codepradesigali1
 
Little book of programming challenges
Little book of programming challengesLittle book of programming challenges
Little book of programming challengesysolanki78
 
Std 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingStd 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingNuzhat Memon
 
Comp 122 lab 4 lab report and source code
Comp 122 lab 4 lab report and source codeComp 122 lab 4 lab report and source code
Comp 122 lab 4 lab report and source codepradesigali1
 
Identify Root Causes – C&E Matrix
Identify Root Causes – C&E MatrixIdentify Root Causes – C&E Matrix
Identify Root Causes – C&E MatrixMatt Hansen
 
OverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxOverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxgerardkortney
 

Ähnlich wie Perl program for multiplication and division (20)

Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab new
 
Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab new
 
Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab new
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEW
 
Md university cmis 102 week 5 hands
Md university cmis 102 week 5 handsMd university cmis 102 week 5 hands
Md university cmis 102 week 5 hands
 
Java Practice Set
Java Practice SetJava Practice Set
Java Practice Set
 
CSCI1250 Project 3 Fall 2015 CSCI1250 INTRODUCTIO.docx
CSCI1250    Project 3  Fall 2015  CSCI1250 INTRODUCTIO.docxCSCI1250    Project 3  Fall 2015  CSCI1250 INTRODUCTIO.docx
CSCI1250 Project 3 Fall 2015 CSCI1250 INTRODUCTIO.docx
 
CPSC 120Spring 2014Lab 5Name _____________________.docx
CPSC 120Spring 2014Lab 5Name _____________________.docxCPSC 120Spring 2014Lab 5Name _____________________.docx
CPSC 120Spring 2014Lab 5Name _____________________.docx
 
EDUC 215Health and Wellness Project OverviewFor this assignmen
EDUC 215Health and Wellness Project OverviewFor this assignmenEDUC 215Health and Wellness Project OverviewFor this assignmen
EDUC 215Health and Wellness Project OverviewFor this assignmen
 
M150 A Fall2010 T01
M150 A Fall2010 T01M150 A Fall2010 T01
M150 A Fall2010 T01
 
Course project solutions 2018
Course project solutions 2018Course project solutions 2018
Course project solutions 2018
 
Rightand wrong[1]
Rightand wrong[1]Rightand wrong[1]
Rightand wrong[1]
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
 
Comp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source codeComp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source code
 
Little book of programming challenges
Little book of programming challengesLittle book of programming challenges
Little book of programming challenges
 
Chap3
Chap3Chap3
Chap3
 
Std 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingStd 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem Solving
 
Comp 122 lab 4 lab report and source code
Comp 122 lab 4 lab report and source codeComp 122 lab 4 lab report and source code
Comp 122 lab 4 lab report and source code
 
Identify Root Causes – C&E Matrix
Identify Root Causes – C&E MatrixIdentify Root Causes – C&E Matrix
Identify Root Causes – C&E Matrix
 
OverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxOverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docx
 

Mehr von Binsent Ribera

Ibm system programming training module 2 - linux basics
Ibm system programming training   module 2 - linux basicsIbm system programming training   module 2 - linux basics
Ibm system programming training module 2 - linux basicsBinsent Ribera
 
Perl take home final exam
Perl take home final examPerl take home final exam
Perl take home final examBinsent Ribera
 
PERL Unit 6 regular expression
PERL Unit 6 regular expressionPERL Unit 6 regular expression
PERL Unit 6 regular expressionBinsent Ribera
 
PERL Regular Expression
PERL Regular ExpressionPERL Regular Expression
PERL Regular ExpressionBinsent Ribera
 

Mehr von Binsent Ribera (6)

Syntax analysis
Syntax analysisSyntax analysis
Syntax analysis
 
Ibm system programming training module 2 - linux basics
Ibm system programming training   module 2 - linux basicsIbm system programming training   module 2 - linux basics
Ibm system programming training module 2 - linux basics
 
Perl take home final exam
Perl take home final examPerl take home final exam
Perl take home final exam
 
PERL Unit 6 regular expression
PERL Unit 6 regular expressionPERL Unit 6 regular expression
PERL Unit 6 regular expression
 
PERL Regular Expression
PERL Regular ExpressionPERL Regular Expression
PERL Regular Expression
 
Linux IV - PERL
Linux IV - PERLLinux IV - PERL
Linux IV - PERL
 

Kürzlich hochgeladen

APRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdfAPRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdfRbc Rbcua
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMintel Group
 
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCRalexsharmaa01
 
8447779800, Low rate Call girls in Dwarka mor Delhi NCR
8447779800, Low rate Call girls in Dwarka mor Delhi NCR8447779800, Low rate Call girls in Dwarka mor Delhi NCR
8447779800, Low rate Call girls in Dwarka mor Delhi NCRashishs7044
 
Annual General Meeting Presentation Slides
Annual General Meeting Presentation SlidesAnnual General Meeting Presentation Slides
Annual General Meeting Presentation SlidesKeppelCorporation
 
International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...ssuserf63bd7
 
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City GurgaonCall Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaoncallgirls2057
 
Church Building Grants To Assist With New Construction, Additions, And Restor...
Church Building Grants To Assist With New Construction, Additions, And Restor...Church Building Grants To Assist With New Construction, Additions, And Restor...
Church Building Grants To Assist With New Construction, Additions, And Restor...Americas Got Grants
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Riya Pathan
 
Organizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessOrganizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessSeta Wicaksana
 
Buy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail AccountsBuy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail AccountsBuy Verified Accounts
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03DallasHaselhorst
 
Entrepreneurship lessons in Philippines
Entrepreneurship lessons in  PhilippinesEntrepreneurship lessons in  Philippines
Entrepreneurship lessons in PhilippinesDavidSamuel525586
 
PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationAnamaria Contreras
 
1911 Gold Corporate Presentation Apr 2024.pdf
1911 Gold Corporate Presentation Apr 2024.pdf1911 Gold Corporate Presentation Apr 2024.pdf
1911 Gold Corporate Presentation Apr 2024.pdfShaun Heinrichs
 
PB Project 1: Exploring Your Personal Brand
PB Project 1: Exploring Your Personal BrandPB Project 1: Exploring Your Personal Brand
PB Project 1: Exploring Your Personal BrandSharisaBethune
 
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607dollysharma2066
 
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCRashishs7044
 

Kürzlich hochgeladen (20)

APRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdfAPRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdf
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 Edition
 
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
 
Call Us ➥9319373153▻Call Girls In North Goa
Call Us ➥9319373153▻Call Girls In North GoaCall Us ➥9319373153▻Call Girls In North Goa
Call Us ➥9319373153▻Call Girls In North Goa
 
Corporate Profile 47Billion Information Technology
Corporate Profile 47Billion Information TechnologyCorporate Profile 47Billion Information Technology
Corporate Profile 47Billion Information Technology
 
8447779800, Low rate Call girls in Dwarka mor Delhi NCR
8447779800, Low rate Call girls in Dwarka mor Delhi NCR8447779800, Low rate Call girls in Dwarka mor Delhi NCR
8447779800, Low rate Call girls in Dwarka mor Delhi NCR
 
Annual General Meeting Presentation Slides
Annual General Meeting Presentation SlidesAnnual General Meeting Presentation Slides
Annual General Meeting Presentation Slides
 
International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...
 
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City GurgaonCall Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaon
 
Church Building Grants To Assist With New Construction, Additions, And Restor...
Church Building Grants To Assist With New Construction, Additions, And Restor...Church Building Grants To Assist With New Construction, Additions, And Restor...
Church Building Grants To Assist With New Construction, Additions, And Restor...
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737
 
Organizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessOrganizational Structure Running A Successful Business
Organizational Structure Running A Successful Business
 
Buy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail AccountsBuy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail Accounts
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03
 
Entrepreneurship lessons in Philippines
Entrepreneurship lessons in  PhilippinesEntrepreneurship lessons in  Philippines
Entrepreneurship lessons in Philippines
 
PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement Presentation
 
1911 Gold Corporate Presentation Apr 2024.pdf
1911 Gold Corporate Presentation Apr 2024.pdf1911 Gold Corporate Presentation Apr 2024.pdf
1911 Gold Corporate Presentation Apr 2024.pdf
 
PB Project 1: Exploring Your Personal Brand
PB Project 1: Exploring Your Personal BrandPB Project 1: Exploring Your Personal Brand
PB Project 1: Exploring Your Personal Brand
 
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
 
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
 

Perl program for multiplication and division

  • 1. 5057775-228600914400-165735 Colegio de San Juan de Letran-Calamba<br />School of Computer Studies and Technology<br />PRELIMINARY EXAMINATION<br />STRUCTURE OF PROGRAMMING LANGUAGES - LABORATORY <br />Name:_______________________________Date: ____________________<br />Yr & Section: ___________________________Prepared by: VSRivera<br />Using Perl, create a program that will accomplish the following:<br />M A I N M E N U<br />Multiplication<br />Division<br />Exit<br />Choice: <br />Multiplication – the user should be able to input 2 numbers, the multiplicand and the multiplier. It should output the product of the 2 numbers using repeated addition.<br />Sample Output:<br />Insert Multiplicand: 5<br />Insert Multiplier: 3<br />Product: 15<br />The multiplicand is added to itself multiplier times, that is, if you are going to add 5 to itself 3 times the sum is the same as the product of 5 multiplied to 3.<br />5 + 5 + 5 = 15<br />Division - the user should be able to input 2 numbers, the dividend and the divisor. It should output the quotient of the 2 numbers using repeated subtraction.<br />Sample Output:<br />Insert Dividend: 15<br />Insert Divisor: 3<br />Product: 15<br />The divisor is subtracted from the dividend while the dividend is greater than or equal to the divisor, that is, if you are going to subtract 3 times from 15 while the value is greater than 3, then the number of times 3 will be able to subtract from 15 is the same as the quotient of 15 divided by 3.<br />15 – 3 = 12 – 3 = 9 – 3 = 6 – 3 = 3 – 3 = 0<br />Count the number of times the value 3 was able to subtract from 15 while the difference is greater than or equal to 3.<br />Give an appropriate error message if the value of the divisor is greater than the dividend.<br />Output the remainder if the dividend is not exactly divisible by the divisor.<br />Exit – terminates the program.<br />General instruction:<br />Print this exam paper, do not photocopy.<br />Print your program on a short bond paper (8.5” x 11”).<br />Staple the bond paper with this exam paper being the first page before submitting it.<br />Write your printed name at the upper left side of every bond paper you’ve used and affix your signature on top of the printed name.<br />Put it in a short brown envelope. Write your complete name at the back of the envelope.<br />Submit the envelope personally on or before 12:00 P.M. of July 27, 2011, Wednesday. Time will be based on the wall clock located at the stairway in ITCC. Again, on or before 12:00 P.M. of July 27, 2011. If you think you cannot submit it on time, submit it before the date or the time of submission.<br />Softcopy of the program will be collected during our lecture class on July 27, 2011, Wdnesday.<br />Non-compliance with the instruction will mean non-submission, thus, will require you to take a special exam.<br />