Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Python Expert

 

Primitives, Composition, Abstraction, and Patterns

 

We will  start  by thinking about  how  the  PCAP  framework applies to computer programs, in general. We may do that by taking in table 3.1, exploring the PCAP concepts in data, functions, and objects.

 

Data

 

The primitive data  items in most programming languages are things  like integer variables, ?oating point values, and  strings. We can use those into data  structures  such as lists, dictionaries, arrays and records. Creating  a data  structure  allows  us,  at the  most  simple  level,  to think  of a type  of primitive data  elements as if it were  one thing,  freeing  us from information.   Sometimes, we just think  of a section  of data,  not  in type  of its relaying representation, but  in terms  of what  it shows.  So, we may think  of a set of functions, or a family  tree, without thinking whether it is an array or a list in its basic representation. Abstract data  types  gives a way  of abstracting away  from representational details  and allowing us to focus on what  the data  really means.

 

 

Procedures

 

The primitive procedures of a language are things  like built-in  numeric operations and  basic list application. We may combine these  using  the facilities of the language, such as if and  while, or by using  procedure composition (f(g(x))).  If we try  to abstract away  from  the details  of how a particular calculation is done,  we can describe  a new  function; de?ning a function allows  us to use it for computational programs without thinking about  the information  of how  those  computational jobs get completed.   You can think  of this  process  as essentially creating a new  primitive, which  we may then  use  while  ignoring the information  of how  it is created.  One  way  to save common patterns of abstraction in method is to abstract over functions themselves, with higher-order methods.

 

Objects

 

Object-oriented programming provides a number of methods of abstraction and  pattern capture in both  data  and  function. At the most  basic level, objects can be used  as files, combining with primitive data  component. More usually, they give strategies for jointly abstracting a data  representation and the procedures that work  on it. The features of polymorphism and inheritance are particularly important.

 

Procedures

Data

Primitives

Means of combination

Means of abstraction

Means of capturing patterns

+, *, ==

if, while, f(g(x))

def

higher-order procedures

numbers, strings

lists, dictionaries, objects

ADTS, classes

Generic functions, inheritance




 

 

 

 

 

 

Table 3.1          Primitives, combination, abstraction, patterns framework for computer programs

 

Python, Programming

  • Category:- Python
  • Reference No.:- M9506022

Have any Question?


Related Questions in Python

Question write a python program with a graphical user

Question: Write a python program with a graphical user interface that will allow a user to create a custom pizza which they wish to order. At minimum, the user should be able to choose the size of the pizza, the type of ...

In this programming assignment you will write a client

In this programming assignment, you will write a client pingprogram in Python. Your client will send a simple ping message to a server, receive a correspondingpong message back from the server, and determine the delay be ...

Quesiton write a python script that counts occurrences of

Quesiton: Write a python script that counts occurrences of words in a file. • The script expects two command-line arguments: the name of an input file and a threshold (an integer). Here is an example of how to run the sc ...

Simple python traffic lightswrite a program that simulates

Simple Python (Traffic lights) Write a program that simulates a traffic light. The program lets the user select one of three lights: red, yellow, or green. When a radio button is selected, the light is turned on, and onl ...

Lab assignment -background - we have discussed in detail

Lab Assignment - Background - We have discussed, in detail, the function of Stacks and Queues and how they are specifically implemented in Python. To get a better understanding of the utility of these data structures, we ...

Question why is software configuration management

Question : Why is software configuration management considered an umbrella activity in software engineering? Please include examples and supporting discussion. The response must be typed, single spaced, must be in times ...

Assignment1 utilising python 3 build the following

Assignment 1. Utilising Python 3 Build the following regression models: - Decision Tree - Gradient Boosted Tree - Linear regression 2. Select a dataset (other than the example dataset given in section 3) and apply the De ...

Project reconnaissance and attack on ics

Project: Reconnaissance and Attack on ICS NetworksEnvironment Setup The second mini project will be based on Industrial Network Protocols, specifically the Modbus protocol. Please follow the instructions carefully to set ...

Question research pythons dictionary data type dictdiscuss

Question : Research Python's dictionary data type (dict). Discuss its interface and usage. Include examples. Discuss practical applications of dictionaries.

Homework -this homework will have both a short written and

Homework - This homework will have, both a short written and coding assignment. The problems that are supposed to be written are clearly marked. 1) (Written) Make heuristics Describe two heuristics for the slide problem ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As