SlideShare a Scribd company logo
A Presentation 0f Advance Pr0gramming Language
Implicit & Explicit Sequence Control
and
Exception Handling
Master of Technology
In
Computer Science &Engineering
Submitted T0 Submitted By
Miss. Manshi Gupta Vikash MainanwaI
Control Structure
Sequence Control Structure
Implicit
Explicit
Exception
Exception Handling
Bibliography
CONTENTS
Control structures: the basic framework
within which operations and data are
combined into programs.
 Sequence control
 data control
1.Control Structure
the control of the order of execution of the operations
(Primitive, user defined).
1.1 Sequence control
1.2 Data control
the control of the transmission of data among the
subprograms of a program.
Implicit sequence control: (default)
defined by the language .
Explicit sequence control: defined by the
programmer.
Types of sequence control
Example of Explicit Sequence control
Describe Exception
An exception is an erroneous situation that occurs during
program execution.
When an exception occurs in an application, the system
throws an error.
The error is handled through the process of exception
handling.
Types of Error
There are three types of errors that can occur in the application:
Syntax errors: Occurs when statements are not constructed
properly, keywords are misspelled, or punctuation is omitted.
Run-time errors: Occurs when an application attempts to perform
an operation, which is not allowed at runtime.
Logical errors: Occurs when an application compiles and runs
properly but does not produce the expected results.
Let us understand the various types of errors in detail.
Syntax Error
class Errors
{
Console.WriteLine(“Enjoy Errors”)
}
Semicolon is missing from Console.WriteLine statement
Run Time Error
class Errors
{
int Num1=0;
int Num2=20;
int Num3;
Num3=Num2/Num1;
Console.WriteLine(“The Result is {0}”,
Num3);
}
Division by zero has taken place
Logical Error
class Errors
{
int Num1=10;
int Num2=2;
int Num3;
Num3=Num2/Num1;
Console.WriteLine(“The Result is
{0}”, Num3);
}
Expected result = 5
Present result = 0.2
There are many exception classes which are
directly or indirectly derived from the
System.Exception class. Some of these
classes are:
System.ApplicationException class
System.SystemException class
Exception Classes
—The hierarchy of the exception classes is displayed in the following
figure.
Exception Classes
System. Exception
System.ApplicationException
System.SystemException
Handling Exception
In exception handling, the application is divided into blocks of code.
A block that shows the probability of raising an error contains one or
more exception handlers.
The exception handlers follow a control structure and a uniform way of
handling the system level and application level errors.
The blocks for exception-handling can be implemented using the
following keywords:
try
catch
finally
Let us look at each of these keywords in detail.
Exception Handling Control Flow
Try Block
The try block:
The try block guards statements that may throw an exception. Following is
the syntax of try block statement:
try
{
//statements that may cause an exception
}
The try block governs statements that are enclosed within it and defines
the scope of the exception-handlers associated with it.
A try block must have at least one catch block.
Catch Block
The catch block:
The catch statement of the catch block takes an object of the exception
class as a parameter, which refers to the raised exception.
You can associate an exception-handler with the try block by providing
one or more catch handlers, immediately after the try block:
try
{
//statements that may cause an exception
}
catch (…)
{
//error handling code
}
Finally Block
The finally block:
The finally block is used to execute a given set of
statements, whether an exception is thrown or not thrown:
try
{
//statements that may cause an exception
}
catch (…)
{
//error handling code
}
finally
{
//statements to be executed
}
Example of Exception Handling
Bibliography
• Programming Language Terrance W.Pratt
• —www.dotnetperls.com/exception
• —msdn.microsoft.com/en-
us/library/ms173160.aspx
 —www.tutorialspoint.com/csharp/csharp_exception_handlin
g.
• The complete reference C# 4.0 Tata McGraw-Hill
Implicit and explicit sequence control with exception handling
Implicit and explicit sequence control with exception handling

More Related Content

What's hot

Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphicanku2266
 
Object oriented modeling
Object oriented modelingObject oriented modeling
Object oriented modeling
Pooja Dixit
 
Android resource
Android resourceAndroid resource
Android resourceKrazy Koder
 
Access to non local names
Access to non local namesAccess to non local names
Access to non local namesVarsha Kumar
 
System software - macro expansion,nested macro calls
System software - macro expansion,nested macro callsSystem software - macro expansion,nested macro calls
System software - macro expansion,nested macro calls
SARASWATHI S
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer Graphics
Laxman Puri
 
Applet life cycle
Applet life cycleApplet life cycle
Applet life cyclemyrajendra
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systemssumitjain2013
 
Peephole optimization techniques in compiler design
Peephole optimization techniques in compiler designPeephole optimization techniques in compiler design
Peephole optimization techniques in compiler design
Anul Chaudhary
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programming
Amar Jukuntla
 
Scan line method
Scan line methodScan line method
Scan line method
Pooja Dixit
 
Chapter 2.datatypes and operators
Chapter 2.datatypes and operatorsChapter 2.datatypes and operators
Chapter 2.datatypes and operators
Jasleen Kaur (Chandigarh University)
 
Counter propagation Network
Counter propagation NetworkCounter propagation Network
Counter propagation Network
Akshay Dhole
 
Back face detection
Back face detectionBack face detection
Back face detection
Pooja Dixit
 
Knowledge engg using & in fol
Knowledge engg using & in folKnowledge engg using & in fol
Knowledge engg using & in folchandsek666
 
Reduction & Handle Pruning
Reduction & Handle PruningReduction & Handle Pruning
Reduction & Handle Pruning
MdAshikJiddney
 

What's hot (20)

White box ppt
White box pptWhite box ppt
White box ppt
 
Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphic
 
Object oriented modeling
Object oriented modelingObject oriented modeling
Object oriented modeling
 
Android resource
Android resourceAndroid resource
Android resource
 
Access to non local names
Access to non local namesAccess to non local names
Access to non local names
 
System software - macro expansion,nested macro calls
System software - macro expansion,nested macro callsSystem software - macro expansion,nested macro calls
System software - macro expansion,nested macro calls
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer Graphics
 
Applet life cycle
Applet life cycleApplet life cycle
Applet life cycle
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systems
 
Peephole optimization techniques in compiler design
Peephole optimization techniques in compiler designPeephole optimization techniques in compiler design
Peephole optimization techniques in compiler design
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programming
 
Scan line method
Scan line methodScan line method
Scan line method
 
Chapter 2.datatypes and operators
Chapter 2.datatypes and operatorsChapter 2.datatypes and operators
Chapter 2.datatypes and operators
 
ppt
pptppt
ppt
 
Counter propagation Network
Counter propagation NetworkCounter propagation Network
Counter propagation Network
 
Arrays
ArraysArrays
Arrays
 
Unit 4
Unit 4Unit 4
Unit 4
 
Back face detection
Back face detectionBack face detection
Back face detection
 
Knowledge engg using & in fol
Knowledge engg using & in folKnowledge engg using & in fol
Knowledge engg using & in fol
 
Reduction & Handle Pruning
Reduction & Handle PruningReduction & Handle Pruning
Reduction & Handle Pruning
 

Similar to Implicit and explicit sequence control with exception handling

Introduction of exception in vb.net
Introduction of exception in vb.netIntroduction of exception in vb.net
Introduction of exception in vb.net
suraj pandey
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
siragezeynu
 
Java -Exception handlingunit-iv
Java -Exception handlingunit-ivJava -Exception handlingunit-iv
Java -Exception handlingunit-iv
RubaNagarajan
 
UNIT-3.pptx Exception Handling and Multithreading
UNIT-3.pptx Exception Handling and MultithreadingUNIT-3.pptx Exception Handling and Multithreading
UNIT-3.pptx Exception Handling and Multithreading
SakkaravarthiS1
 
Md07 exceptions&assertion
Md07 exceptions&assertionMd07 exceptions&assertion
Md07 exceptions&assertionRakesh Madugula
 
130410107010 exception handling
130410107010 exception handling130410107010 exception handling
130410107010 exception handling
Hemant Chetwani
 
7.error management and exception handling
7.error management and exception handling7.error management and exception handling
7.error management and exception handlingDeepak Sharma
 
Chapter 8 agent-oriented software engineering ch8-prometheus research methodo...
Chapter 8 agent-oriented software engineering ch8-prometheus research methodo...Chapter 8 agent-oriented software engineering ch8-prometheus research methodo...
Chapter 8 agent-oriented software engineering ch8-prometheus research methodo...
farshad33
 
Testing
TestingTesting
Testing
BinamraRegmi
 
Presentation1
Presentation1Presentation1
Presentation1
Anul Chaudhary
 
Exception Handling in Java
Exception Handling in JavaException Handling in Java
Exception Handling in Java
lalithambiga kamaraj
 
Software testing and_quality_assurance_powerpoint_presentation
Software testing and_quality_assurance_powerpoint_presentationSoftware testing and_quality_assurance_powerpoint_presentation
Software testing and_quality_assurance_powerpoint_presentationvigneshasromio
 
Exception handling
Exception handlingException handling
Exception handling
Raja Sekhar
 
Chapter 8 - Software Testing.ppt
Chapter 8 - Software Testing.pptChapter 8 - Software Testing.ppt
Chapter 8 - Software Testing.ppt
GentaSahuri2
 
Week7 exception handling
Week7 exception handlingWeek7 exception handling
Week7 exception handlingAlpesh Oza
 
Week7 exception handling
Week7 exception handlingWeek7 exception handling
Week7 exception handlingAlpesh Oza
 
Week7 exception handling
Week7 exception handlingWeek7 exception handling
Week7 exception handling
Alpesh Oza
 
Integration testing
Integration testingIntegration testing
Integration testing
queen jemila
 
SOFTWARE Engineering (SOFTWARE TESTING).pptx
SOFTWARE Engineering (SOFTWARE TESTING).pptxSOFTWARE Engineering (SOFTWARE TESTING).pptx
SOFTWARE Engineering (SOFTWARE TESTING).pptx
arthurtembo02
 

Similar to Implicit and explicit sequence control with exception handling (20)

Introduction of exception in vb.net
Introduction of exception in vb.netIntroduction of exception in vb.net
Introduction of exception in vb.net
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Java -Exception handlingunit-iv
Java -Exception handlingunit-ivJava -Exception handlingunit-iv
Java -Exception handlingunit-iv
 
Ch20
Ch20Ch20
Ch20
 
UNIT-3.pptx Exception Handling and Multithreading
UNIT-3.pptx Exception Handling and MultithreadingUNIT-3.pptx Exception Handling and Multithreading
UNIT-3.pptx Exception Handling and Multithreading
 
Md07 exceptions&assertion
Md07 exceptions&assertionMd07 exceptions&assertion
Md07 exceptions&assertion
 
130410107010 exception handling
130410107010 exception handling130410107010 exception handling
130410107010 exception handling
 
7.error management and exception handling
7.error management and exception handling7.error management and exception handling
7.error management and exception handling
 
Chapter 8 agent-oriented software engineering ch8-prometheus research methodo...
Chapter 8 agent-oriented software engineering ch8-prometheus research methodo...Chapter 8 agent-oriented software engineering ch8-prometheus research methodo...
Chapter 8 agent-oriented software engineering ch8-prometheus research methodo...
 
Testing
TestingTesting
Testing
 
Presentation1
Presentation1Presentation1
Presentation1
 
Exception Handling in Java
Exception Handling in JavaException Handling in Java
Exception Handling in Java
 
Software testing and_quality_assurance_powerpoint_presentation
Software testing and_quality_assurance_powerpoint_presentationSoftware testing and_quality_assurance_powerpoint_presentation
Software testing and_quality_assurance_powerpoint_presentation
 
Exception handling
Exception handlingException handling
Exception handling
 
Chapter 8 - Software Testing.ppt
Chapter 8 - Software Testing.pptChapter 8 - Software Testing.ppt
Chapter 8 - Software Testing.ppt
 
Week7 exception handling
Week7 exception handlingWeek7 exception handling
Week7 exception handling
 
Week7 exception handling
Week7 exception handlingWeek7 exception handling
Week7 exception handling
 
Week7 exception handling
Week7 exception handlingWeek7 exception handling
Week7 exception handling
 
Integration testing
Integration testingIntegration testing
Integration testing
 
SOFTWARE Engineering (SOFTWARE TESTING).pptx
SOFTWARE Engineering (SOFTWARE TESTING).pptxSOFTWARE Engineering (SOFTWARE TESTING).pptx
SOFTWARE Engineering (SOFTWARE TESTING).pptx
 

More from VIKASH MAINANWAL

Remote Procedure Call
Remote Procedure CallRemote Procedure Call
Remote Procedure Call
VIKASH MAINANWAL
 
Gas Management System by Vikash Mainanwal
Gas Management System by Vikash MainanwalGas Management System by Vikash Mainanwal
Gas Management System by Vikash Mainanwal
VIKASH MAINANWAL
 
Virus Attack & firewall by vikash mainanwal
Virus Attack & firewall by vikash mainanwalVirus Attack & firewall by vikash mainanwal
Virus Attack & firewall by vikash mainanwal
VIKASH MAINANWAL
 
Manet By Vikas mainanwal
Manet By Vikas mainanwalManet By Vikas mainanwal
Manet By Vikas mainanwal
VIKASH MAINANWAL
 
MANETS Routing By Vikash Maianwal
MANETS Routing By Vikash MaianwalMANETS Routing By Vikash Maianwal
MANETS Routing By Vikash Maianwal
VIKASH MAINANWAL
 
Asynchronous Message Passing
Asynchronous Message PassingAsynchronous Message Passing
Asynchronous Message Passing
VIKASH MAINANWAL
 

More from VIKASH MAINANWAL (6)

Remote Procedure Call
Remote Procedure CallRemote Procedure Call
Remote Procedure Call
 
Gas Management System by Vikash Mainanwal
Gas Management System by Vikash MainanwalGas Management System by Vikash Mainanwal
Gas Management System by Vikash Mainanwal
 
Virus Attack & firewall by vikash mainanwal
Virus Attack & firewall by vikash mainanwalVirus Attack & firewall by vikash mainanwal
Virus Attack & firewall by vikash mainanwal
 
Manet By Vikas mainanwal
Manet By Vikas mainanwalManet By Vikas mainanwal
Manet By Vikas mainanwal
 
MANETS Routing By Vikash Maianwal
MANETS Routing By Vikash MaianwalMANETS Routing By Vikash Maianwal
MANETS Routing By Vikash Maianwal
 
Asynchronous Message Passing
Asynchronous Message PassingAsynchronous Message Passing
Asynchronous Message Passing
 

Recently uploaded

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 

Recently uploaded (20)

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 

Implicit and explicit sequence control with exception handling

  • 1. A Presentation 0f Advance Pr0gramming Language Implicit & Explicit Sequence Control and Exception Handling Master of Technology In Computer Science &Engineering Submitted T0 Submitted By Miss. Manshi Gupta Vikash MainanwaI
  • 2. Control Structure Sequence Control Structure Implicit Explicit Exception Exception Handling Bibliography CONTENTS
  • 3. Control structures: the basic framework within which operations and data are combined into programs.  Sequence control  data control 1.Control Structure
  • 4. the control of the order of execution of the operations (Primitive, user defined). 1.1 Sequence control 1.2 Data control the control of the transmission of data among the subprograms of a program.
  • 5. Implicit sequence control: (default) defined by the language . Explicit sequence control: defined by the programmer. Types of sequence control
  • 6. Example of Explicit Sequence control
  • 7. Describe Exception An exception is an erroneous situation that occurs during program execution. When an exception occurs in an application, the system throws an error. The error is handled through the process of exception handling.
  • 8. Types of Error There are three types of errors that can occur in the application: Syntax errors: Occurs when statements are not constructed properly, keywords are misspelled, or punctuation is omitted. Run-time errors: Occurs when an application attempts to perform an operation, which is not allowed at runtime. Logical errors: Occurs when an application compiles and runs properly but does not produce the expected results. Let us understand the various types of errors in detail.
  • 9. Syntax Error class Errors { Console.WriteLine(“Enjoy Errors”) } Semicolon is missing from Console.WriteLine statement
  • 10. Run Time Error class Errors { int Num1=0; int Num2=20; int Num3; Num3=Num2/Num1; Console.WriteLine(“The Result is {0}”, Num3); } Division by zero has taken place
  • 11. Logical Error class Errors { int Num1=10; int Num2=2; int Num3; Num3=Num2/Num1; Console.WriteLine(“The Result is {0}”, Num3); } Expected result = 5 Present result = 0.2
  • 12. There are many exception classes which are directly or indirectly derived from the System.Exception class. Some of these classes are: System.ApplicationException class System.SystemException class Exception Classes
  • 13. —The hierarchy of the exception classes is displayed in the following figure. Exception Classes System. Exception System.ApplicationException System.SystemException
  • 14. Handling Exception In exception handling, the application is divided into blocks of code. A block that shows the probability of raising an error contains one or more exception handlers. The exception handlers follow a control structure and a uniform way of handling the system level and application level errors. The blocks for exception-handling can be implemented using the following keywords: try catch finally Let us look at each of these keywords in detail.
  • 16. Try Block The try block: The try block guards statements that may throw an exception. Following is the syntax of try block statement: try { //statements that may cause an exception } The try block governs statements that are enclosed within it and defines the scope of the exception-handlers associated with it. A try block must have at least one catch block.
  • 17. Catch Block The catch block: The catch statement of the catch block takes an object of the exception class as a parameter, which refers to the raised exception. You can associate an exception-handler with the try block by providing one or more catch handlers, immediately after the try block: try { //statements that may cause an exception } catch (…) { //error handling code }
  • 18. Finally Block The finally block: The finally block is used to execute a given set of statements, whether an exception is thrown or not thrown: try { //statements that may cause an exception } catch (…) { //error handling code } finally { //statements to be executed }
  • 20. Bibliography • Programming Language Terrance W.Pratt • —www.dotnetperls.com/exception • —msdn.microsoft.com/en- us/library/ms173160.aspx  —www.tutorialspoint.com/csharp/csharp_exception_handlin g. • The complete reference C# 4.0 Tata McGraw-Hill