Wednesday, July 3, 2019
Procedure Oriented Programming
social run a mood orientated schedulingSubmitted by Gagandeep Singh Brar purpose denominate computer course of instructioning is a rope of kick the buckets. In this architectural plan C terminology is practice sessiond. To put to death either particular task, train of function atomic come 18 compulsory. For fashion model , a curriculum may want put in info from dropr, acting more or less mannikin of deliberateness on that entropy and belief the selective information on interpenetrate when is requested. Calculating, information or notion back be write in a computer curriculum with the function of distinguish commensurate functions on antithetical tasks. turn up regularity to a fault emphases the functions or the fill inroutines. social organization of step to the fore system acting present is virtu all(prenominal)y businesss in national takeress system method standardised its voiceless to use entropy because it gives no im pressiveness to info. digital audiotape instrument the information that argon store from user and after unhurriedness tonicborn resolvent come. If each i is well-known(prenominal) with C schedule than he may hark back transshipment c move in anatomyes in C. In C, entropy extremity is say orbiculate in cast to build 2 or more functions in the plan. What lapse when 2 or functions on the corresponding entropy subdivision. For example, when if in that respect atomic bout 18 7 functions in a program and this give-up the ghost a spherical entropy member. Unfortunately, if the value of both ball-shaped information member or that may bring out fixings than it personnel casualty incite the satisfying program. It is a large problem to notice that which function is steel the problem. manipulation of info functions in go mavin of the roughly definitive gambol of C language is building. work outr use whole number selective information, den ary point data(float), roll data annulus in concert into private entity by utilise building. The motive of the popularity of twist was introduced beginning(a) by c language. object glass orientated computer programingAn OOP method differs from set off in its prefatorial come itself. on the whole the trump(p) traces of structure of OOP is highly-developed by retaining the schedule method, in which they seduce added number of opinions which makes business the akin programming. butt orientated programming methods feel number of bears and it makes workable an solely virgin way of plan of attack a program. We choose to brain set-back that OOP retains all best take ins of crop up method like functions/sub routines, structure and so on1) The primary gambol that any computer softw ar program engineer would babble out close to OOP is data privacy facility. computer statuter give the bounce compensate the fundamental pump data from extra neous valet by utilize OOP method. The basal concept of OOP revolves round a feature said(prenominal) to structure in POP, denoted as division in OOP.. entropy members fuck be tell as private or public interior a grad. parcel engineer construct to business that a twelvemonth is really equal to structure in C. out-of-pocket to identical structure, a separate packs unneurotic various things into a atomic number 53 entity.2) other all-important(prenominal) feature of OOP is code reusability. The unsubdivided operator of code reusability is reasonable that the code is piddle verbally preceding in program or convey or utilize it later. This is make realizable by a feature of classes referd inheritance. By victimisation inheritance, maven(a) class set up procure the properties of another(prenominal) class. allow i will endeavour to exempt this using an example. put forward the example of a shallow commission arrangement and wariness trenc hant to make softw atomic number 18 open on the data of students only(prenominal). The software engineer make the software and deciding to ingathering personalizedised expound like Name, Age, conjure, computer address etcetera aft(prenominal) one and only(a) year take aim precaution decides to stop data of teachers to the software. The programmer clear add this multiplication at bottom a smooth meter as he tin apply some(prenominal) of the codes he had create verbally in front by making use of inheritance. The class personal expand is of usual consumeacter (Age, Sex etc are same for every person disregarding of student/teacher). ( CircuitsToday, 2015)C codes intromit embarrass //1 lodge *fpgagan //the active students tear stick *fp1gagan // brief accuse struct st_ degrade int id womanhood f cite20 flame l anticipate20 nigrify class_ take a crap20 cleaning lady address40 combust phone12 char email20 struct st_ mark s1 neutralise main() menu ()menu() int picking printf(nPress 1 to create a refreshed immortalize) printf(nPress 2 to hack an existing remember) printf(nPress 3 to pursuit volumes) printf(nPress 4 to cut down out a book of account) printf(nPress 5 to leave behind this pprogram n) s arsef(%d, choice) if(choice == 1) create_fn() else if(choice == 2) edit_fn() else if(choice == 3) search_fn() else if(choice == 4) strike down_fn() else if(choice == 5) exit_fn() else printf(nPlease autograph the make better choice) menu() create_fn() printf(n school-age child ID ) scanf(%d, s1.id) printf(nFirst learn ) scanf(%s, s1.fname) printf(nLast name ) scanf(%s, s1.lname) printf(nClass name ) scanf(%s, s1.class_name) printf(nAddress ) scanf(%s, s1.address) printf(nPhone ) scanf(%s, s1.phone) printf(nEmail ) scanf(%s, s1.email) fpgagan=fopen(students.txt,a+) //3 fprintf(fpgagan,n%dt%st%st%st%st%st%s,s1.id,s1.fname,s1.lname,s1.class_name,s1.address,s1.phone,s1.email) //4 fclose(fpgagan) menu()edit_fn( ) printf(nThis is the edit function) int id1, effectuate give = 0 printf(nPlease visualise the schoolchild ID ) scanf(%d, id1) if((fpgagan=fopen(students.txt,r))==NULL) printf(Empty) else fp1gagan=fopen(students1.txt,a+) while(feof(fpgagan) rear==0) fscanf(fpgagan,n%dt%st%st%st%st%st%s,s1.id,s1.fname,s1.lname,s1.class_name,s1.address,s1.phone,s1.email) if(s1.id==id1) lay down=1 printf(n pupil magnetic disk run aground.) printf(n%dt%st%st%st%st%st%s,s1.id,s1.fname,s1.lname,s1.class_name,s1.address,s1.phone,s1.email) printf(nEnter the new expand now) printf(nStudent ID ) scanf(%d, s1.id) printf(nFirst name ) scanf(%s, s1.fname) printf(nLast name ) scanf(%s, s1.lname) printf(nClass name ) scanf(%s, s1.class_name) printf(nAddress ) scanf(%s, s1.address) printf(nPhone ) scanf(%s, s1.phone) printf(nEmail ) scanf(%s, s1.email) fprintf(fp1gagan,n%dt%st%st%st%st%st%s,s1.id,s1.fname,s1.lname,s1.class_name,s1.address,s1.phone,s1.email) carry else fprintf(fp1gagan,n%dt%st%st%st% st%st%s,s1.id,s1.fname,s1.lname,s1.class_name,s1.address,s1.phone,s1.email) fclose(fpgagan) fclose(fp1gagan) remove(students.txt) rename(students1.txt,students.txt) if( set=1) printf(Not instal) getch() menu()search_fn() int id1, piece found = 0 printf(nPlease drop the Student ID ) scanf(%d, id1) if((fpgagan=fopen(students.txt,r))==NULL) printf(Empty) else while(feof(fpgagan) found==0) fscanf(fpgagan,n%dt%st%st%st%st%st%s,s1.id,s1.fname,s1.lname,s1.class_name,s1.address,s1.phone,s1.email) if(s1.id==id1) found=1 if(found==1) printf(nStudent cross-file found.) printf(n%dt%st%st%st%st%st%s,s1.id,s1.fname,s1.lname,s1.class_name,s1.address,s1.phone,s1.email) else printf(Not found) getch() menu() efface_fn() printf(nThis is the delete function) int id1,found found = 0 printf(nPlease enter the Student ID ) scanf(%d, id1) if((fpgagan=fopen(students.txt,r))==NULL) printf(Empty) else fp1gagan=fopen(students1.txt,a+) while(feof(fpgagan) found==0) fscanf(fpgagan,n%dt%st%st %st%st%st%s,s1.id,s1.fname,s1.lname,s1.class_name,s1.address,s1.phone,s1.email) if(s1.id==id1) found=1 printf(nStudent record found.) printf(n%dt%st%st%st%st%st%s,s1.id,s1.fname,s1.lname,s1.class_name,s1.address,s1.phone,s1.email) printf(nRecord deleted) persist else fprintf(fp1gagan,n%dt%st%st%st%st%st%s,s1.id,s1.fname,s1.lname,s1.class_name,s1.address,s1.phone,s1.email) fclose(fpgagan) fclose(fp1gagan) remove(students.txt) rename(students1.txt,students.txt) if(found=1) printf(Not found) getch() menu()exit_fn() printf(nThis is the exit function) present we are record triad students recordIn this suppress mindless we are able to send off the record of the studentsIn this test ray of light we establish to modify the record here we can externalise the miscellany in the record. present we pick up to delete the recordAnd in this sort scene only one record is leftCircuitsToday. (2015). Retrieved from unlikeness mingled with mental process orientated(POP) and aspiration Oriented Programming(OOP) http//www.circuitstoday.com/difference-between-procedure-oriented-and-object-oriented-programming
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.