Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
58 views
PPL Aakash
mbmmb
Uploaded by
DhruvKushwaha
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save PPL aakash For Later
Download
Save
Save PPL aakash For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
58 views
PPL Aakash
mbmmb
Uploaded by
DhruvKushwaha
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save PPL aakash For Later
Carousel Previous
Carousel Next
Save
Save PPL aakash For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 24
Search
Fullscreen
—— END TERM EXAMINATION 2018 EIGHT SEMESTER [B.TECH] PRINCIPLES OF PROGRAMMING LANGUAGES (ETCS-424) completely by 3 nite sets anda start sy:nbc grammar as follows:62020 Riches ; In C++, we can Fractional Numbers, Big integers, sum = a+b; Here, variables “a” types. Hence the adatom gp is because the addition op only. class A { statements; int main { Aal,a2, a3; a3 = al ta! return 0; 1 In this example, we have are trying to add two objects “a™ “class A” using the “+” operator. 7 “+” is predefined to operate only on bi defined type, so the compiler generates overloading” comes in. Now if the user wants to make the op done by using the concept of “Operator @ overloading” is to use C++ operators with class meaning of operators really does not change been given additional meaning along with their exis ‘UNIT- Q2. (a) Define the terms syntax, Ans. Syntax: In a programming lan structure and crrangement of keywords, have any relationship with the meaning of the} grammar and structure of the programming ‘A line of code is syntactically valid and et Syntax does not have to do anything. are encountered after the pr"EE fi ; TP. University 12 Tech-Atash Books 2020-7 f2F08 are encount semantic ener nated during runtime of the sed ape ig Th tags aks sone, this term refers to the meres © Bazine elegy. Te te te ly analyzes and chooses in which Parameters or conditions, basic types of logic, or flow of contra, Enews ne logic, oF sequential ow ‘or conditional flow ie, oF repetitive how. (Sequential Flow) ome at of theprocessing, even some complex preblens on, ‘generally follow this elemeritary flow pattern, kgs ®) Selection Logic (Conditional Flow) If (condition) then: defining the ‘Al i, they have {Bnd of If structure) Double Alternative This structure has the form: 1f(Condition), then: Al a Else: govern the (Module B} ax doesn't {End if structure) d with the Multiple Alternatives This structure has the form: ‘If (condition A), then: {Module A] of | ae, Else if (condition B), then: fax [Module B) Else if (condition N), then: {Module N}A class helps in data bindi has attributes like spe he different br Object reeds and colors, ts An object is an entity with, instantiated at that time, the momaigl teract wi to know details oft For example, Dog is the object of the and behaviors, Encapsulation: information in a Encapsulation in @ rule and expose is important to encapsulate iftyou want yourmeney' nd gives you the money. It in binding data ng. In the above example, the int Abstraction: Basically, abstractioa ecause of large! Inheritance: Inheritance means i you inherit features and habits from your hods from one class to another. Com perties is one of the most ‘ou do the separation! san be reused in other classes. And this the area of the ability to display the mess characteristics at the same time, so this ding means to bind one thing to » linking some attribute of one object to There are two main types of binding:Saogunges the. Por empl, 6 Dog 2 chen ‘IP. University 4B. Tech}-Akash Bocks 2020-13 Dow are the sams As we know that each object has its - a bale on specie adres that other object ca use oa lots cn enn tfc 48 do whatever ae od base ote na a an objec: nas cemimancate wits each tne in intron ane ae Restate aetract datatype? Explain with te ip een example? () ee seis (ADT) is typ or clas) fr objets whose vir jan, having its properties Gatined by a set of values and a set of eperriose ‘The definition of ADT only mentions i den nt ape a eae lth thse pero lw impaesia all in it specify will be organized in and what algorithms will _ eee be used for implementing the operations. It is called “aburact” bossa ones from modifying the data The Cot : Process of providing only the essentials and hiding the details is known as c, the machine processes " nd functions wrapped Jeads to abstraction or nachine is hidden, iplexities and displays programming because ility to change things, affecting others, and mle wer of data type does not need to know how that data type is implemented, for the eons ite have boon using Primitive values like int, foat, char data types one ee the racteristics. Just like that these data type can operate and be performed on without any ides inherit the data and [9 of how they are implemented. the objects and their’ ‘So a user only needs to know what of Oops. implement functionality so that me of @ method * In Stack ADT Implementation instead of data being stored in each node, the “the shape, the area | Pointer to data is stored. F * The program allocates memory for the data and address is passed adth a form, Aspe +» The head node and the data nodes are encapsulated in the ADT. polymorphism is ‘The calling function can only sec the pointer to the stack. ei iaoies * Tha stackhead structure also contains a pointer to vp ano: one: Here ia OOPS TE of aumber ofeatrias curently ia sack, in the Aa * push ~Incertan clement at one end ofthe stack called tp * pop()— Remove and return the element at the top ofthe sto<% SES eee: without Vix j * peck() — Return the element at the top of the stack ye anged direet!’ | removing it ifthe stack is not empty. oa * size() ~ Return the number of elements in the stack. fale ime, then it # + isEmpty() ~ Return true if the stack is empty, others © a ae eo + isFull0 ~ Return true ifthe stack i fll, otherwise to 4, and due feats? pe ted otPkht Semester, Prine of Programming Languages = is, | Ds cern an inp hes oe ore a! 0 ‘Type conversion provides greater control over the ‘ress the programmer ean epee the dered data pe ‘sabiy. Type coercion ean rest in inexpeted rela ee performed 4 et redefined rules. Type conversion, on the ‘other hand, is more predictable, ’ a Programmer specifies the desired date type. ov nrc tl neaton n “9 ston omerting fa ght rt ds ee aa mS ‘Tipe oneson an i et i ef tena a a et it Se oe at ee ee te arn Seo her eno cn in nt nd te Se Sita ae ea a a © ‘a tees whne ta dae ela aha fm te bae oe | vk By dca lasd canbe aceasibe inthe child cage is contagn "ty made. By defnult vilbilty mode ie always sotto private, int are{100), return 0; ‘ved. lass namo : visibilty ed Babe Glass Barge Types of Visibility Modo in C4 There are total 3 types of visibility mod in Co that are, Derived Glass | Private Mode Public Mode Puble arnt ® delved singe aga Rane Jit 4d protected wiembaet oF the base cle When we inberit ler oe protect th deriv clans “mater ft ha Petite 4 Publio vtetbitiey mont Whew Wo inherit a derived publeviibity mode, the pub ‘hemor and a ‘e/nherlved oa puble members and prance fram a hae es nbets of the base elas Hor rapeetivly af the etal Sot otected mean14-2020 Syntax- delete pointer variables Example. delete k; delete Ne; Q6. (b) What are wild) sures to handle them, Ans. Pointers store the mei 0 store the memory value which has been deallouat A pointer behaves like a why, they point a Here is an example of wild Example ‘include
}/ Function Prototypo : oid swapstint x, int y); ot ee tin traries fine maing vopintere fT! ry oF data inta = 10, b = 20; intas 4 ; J} Pass by Values D8 = 10, b» 29, ed, That ix ; 1 Pass reference sswapx(a, b); sapslda, ayy } printft'a=fd bssed\n", a, by, PrN anid besa 4 5 | return 0; return 0; cont ) —7 |// Swap functions that swaps A Punction to swap two varia es ae | // two values by references Void swapxCint x, int y) oid swapxtint* x, int | { ( int t; | ye tex, | 1 Output: =20 y=10 a=20 b=10 ‘Thus actual values of a and b remain ‘Thus actual values of a and b get changed unchanged even after exchanging the after exchanging values of x and y. values of x and y. lisplaying In call-by-values, we cannot alter the Yalues of actual variables through function calls, In call by reference we can alter the values of variables through function ca Nalves of variables are passed by the] Polaler variables are necessary to def Simple technique, to store the address values of variable~ 21. () Define implicit and explicit sequencing with examples. G Ans. Sequence Control Sequence control defines the li implemented sequentially, in the Frpassing address ine-by-line implementation by which states" s) to the eauivalent order in which they occur in the =| | stn move out « sequence of read er nin operations, arithmetic oper ante ON iables. A sequence control srueere can be either implicit implicit Sequence Control ~ Implist Sequence control structures are the searnt2d by the language. Implicit sequence control is decided by the seq. she Natements inthe source coda or tne builtin implementation model, The :=0' peguance control structure tends to be in Consequence except that transformed by :he Prowiainner explicitly. An example ofan erie n sequence control includ x in many programming languages, the Physical sequence of statements provides the sequence control mechanism for execution,‘ar tines anaes pgran een ad rane cacig ‘newer periormate character and tin pagantsing ine oelock (6.5) way. ocess cess. same nt of more aple, ——a LP. Universi eh jeadlock can arise if the fo) “Akash, seeseaty Comite MOG fog A By Sylutual BxclUsion: TW oF mon, re Mons ty, can uso ata time) MFCO8 are n es a Hold and Wait: A process is holding at: nn No Preemption: A resource cannot po ta 0, releases the resource. een from 4 ~~ Circular Wait: A set of Processes arg =~ ty1B 1, Q2. (b) What is logic Programming pe 80h Othe jn Logie Program. 8 the dean Ans. Logic Programming is one of the. Computer Py the rogram statements express the facts and ruta Bia syst of formal logic. Ht, SHS SUIS rs mean ce bead and body are present. POF GEAIpIG| Ha head a. BL pe te by. Now if wo stato thal SHUHl Erie hea By, pas f all On the other hand, facts are like the rules, but wi ies is “His true”. Some logic; Programming 1; are known as purely declarative languages, Th what the program should accomplish, ‘There is ‘o perform the task. However, o imperative properties, problem H, perform Bi,‘tel oad tthe eon snp ii nth Sag te ne i tried mie sept ‘rae n eck over fc. oan NNVErSItY Serieg Pe as ‘ ipo ora | cnet gy Wer 1 mem eg ial oymbl is expanded by applying a grammar rule that niin ‘etude Ta ciren are the symbols in he riht_ SieDS si CCESS H’S ira Prasthe University Se PAPERS ——— ech} 'H SEMESTER miming Language anak hte sy mat pos rrp ‘nh ea po rate hes atv mats ph meet erate aa na are Omir tpt init tn nee Socotra le Se tay eee ieee ermaciens asco ay meres Seco Soper whch not empty. In case
You might also like
Davija CP and Ds Notes-Eee 2nd Year
PDF
No ratings yet
Davija CP and Ds Notes-Eee 2nd Year
340 pages
Object Oriented Programming Question Bank
PDF
100% (1)
Object Oriented Programming Question Bank
4 pages
CSC-335 Data Structures and Algorithms: Instructor: Ahmad Reza Hadaegh
PDF
No ratings yet
CSC-335 Data Structures and Algorithms: Instructor: Ahmad Reza Hadaegh
23 pages
Model Test Paper 4
PDF
No ratings yet
Model Test Paper 4
9 pages
class notes
PDF
No ratings yet
class notes
12 pages
Six Week Training Presentation On C++ Programming From
PDF
No ratings yet
Six Week Training Presentation On C++ Programming From
64 pages
Answer BC0037 C++
PDF
No ratings yet
Answer BC0037 C++
20 pages
OOSD
PDF
No ratings yet
OOSD
20 pages
C++ Semester1
PDF
No ratings yet
C++ Semester1
59 pages
C++ Cheat Sheet
PDF
No ratings yet
C++ Cheat Sheet
2 pages
AM38: Intermediate Level Programming
PDF
No ratings yet
AM38: Intermediate Level Programming
57 pages
Assignment 1 Answer
PDF
0% (1)
Assignment 1 Answer
11 pages
Why Use C++
PDF
No ratings yet
Why Use C++
16 pages
unit 1
PDF
No ratings yet
unit 1
35 pages
C++ Assignment
PDF
No ratings yet
C++ Assignment
16 pages
Learning C++
PDF
No ratings yet
Learning C++
14 pages
C4 OperatorExp 2012 Eng PDF
PDF
No ratings yet
C4 OperatorExp 2012 Eng PDF
30 pages
C4 Vfsrfa2012 Eng
PDF
No ratings yet
C4 Vfsrfa2012 Eng
30 pages
Coding Interview Questions for Freshers _ PrepInsta
PDF
No ratings yet
Coding Interview Questions for Freshers _ PrepInsta
14 pages
NIIT Vile Parle
PDF
No ratings yet
NIIT Vile Parle
24 pages
Oops Final
PDF
No ratings yet
Oops Final
47 pages
Screenshot 2023-10-03 at 8.01.52 AM
PDF
No ratings yet
Screenshot 2023-10-03 at 8.01.52 AM
39 pages
Bca 3
PDF
No ratings yet
Bca 3
35 pages
Q-1: Explain The Concept of Constructers and Destructors in C+ + With Programming Examples
PDF
No ratings yet
Q-1: Explain The Concept of Constructers and Destructors in C+ + With Programming Examples
21 pages
Bcs 031
PDF
No ratings yet
Bcs 031
25 pages
CMP203 OOPs and C++ Reference Book
PDF
No ratings yet
CMP203 OOPs and C++ Reference Book
125 pages
C
PDF
No ratings yet
C
104 pages
C++ Internal (1)
PDF
No ratings yet
C++ Internal (1)
22 pages
C and Data Structure
PDF
No ratings yet
C and Data Structure
151 pages
CPP
PDF
No ratings yet
CPP
43 pages
oop anser ct2 riya (1)-1
PDF
No ratings yet
oop anser ct2 riya (1)-1
16 pages
C++
PDF
No ratings yet
C++
21 pages
CS2311-oops EEE
PDF
No ratings yet
CS2311-oops EEE
189 pages
Advanced C++
PDF
No ratings yet
Advanced C++
143 pages
SET-1 PYQ - 2023
PDF
No ratings yet
SET-1 PYQ - 2023
76 pages
Exercises C++
PDF
No ratings yet
Exercises C++
37 pages
DSA Unit 1_merged
PDF
No ratings yet
DSA Unit 1_merged
98 pages
Solution Sheet For Regular PYQ Paper 2023
PDF
No ratings yet
Solution Sheet For Regular PYQ Paper 2023
29 pages
Cs 2133 Data Abstraction & Adts (Abstract Data Types)
PDF
No ratings yet
Cs 2133 Data Abstraction & Adts (Abstract Data Types)
25 pages
02 Data Stru
PDF
No ratings yet
02 Data Stru
59 pages
C++ Tutorial Part II - Advanced: Silan Liu
PDF
No ratings yet
C++ Tutorial Part II - Advanced: Silan Liu
53 pages
Apply OOPL Skill
PDF
No ratings yet
Apply OOPL Skill
109 pages
XII C++ Jul 2023
PDF
No ratings yet
XII C++ Jul 2023
217 pages
C++Reference Card: Looping Pointers
PDF
No ratings yet
C++Reference Card: Looping Pointers
2 pages
C
PDF
No ratings yet
C
2 pages
402 CPP
PDF
No ratings yet
402 CPP
8 pages
Data Structure
PDF
No ratings yet
Data Structure
47 pages
Object Oriented Programming: Unit - I Overview of C++
PDF
No ratings yet
Object Oriented Programming: Unit - I Overview of C++
81 pages
Friend Functions, Exception and File Handling in C++
PDF
No ratings yet
Friend Functions, Exception and File Handling in C++
10 pages
C and OOPs
PDF
No ratings yet
C and OOPs
220 pages
C++ Fundamentals
PDF
No ratings yet
C++ Fundamentals
207 pages
Programming in C++
PDF
No ratings yet
Programming in C++
149 pages
Imgtopdf 2909221401056
PDF
No ratings yet
Imgtopdf 2909221401056
39 pages
02 Data Stru
PDF
No ratings yet
02 Data Stru
59 pages
C Language Tutorial
PDF
No ratings yet
C Language Tutorial
15 pages
List Guidelines of The Scholarship Scheme 2023-24
PDF
No ratings yet
List Guidelines of The Scholarship Scheme 2023-24
24 pages
Mobile Computing
PDF
No ratings yet
Mobile Computing
16 pages
CD Notes1
PDF
No ratings yet
CD Notes1
49 pages
Cut 1
PDF
No ratings yet
Cut 1
2 pages
Cut 6
PDF
No ratings yet
Cut 6
2 pages
(N +1) Star Topology
PDF
No ratings yet
(N +1) Star Topology
2 pages
Star Network Topology Diagram
PDF
No ratings yet
Star Network Topology Diagram
1 page