Question

In: Computer Science

1)define variables. 2)define functions. 3)define data structure.

1)define variables.

2)define functions.

3)define data structure.

Solutions

Expert Solution

Variable:

A variable is a name given to a memory location in which we can store data. A data type is associated with a variable. In programming languages like C, we have to declare a variable by specifying its data type, and then it can hold only that particular type of data.

Eg: int a;
a is a variable of type int. a=10, assigns the value 10 to variable, a.

Function:

A function is a group of statements, that togerther performs a task. It enables code reusability. We can execute the same set of code again and again by calling the function using function name.

Eg: In C,

void printSum(int a, in b){
int sum = a + b;
printf("%d", sum);
}

The function printSum() accepts two integers a, and b and prints its sum.

Data Structure:

A data structure is a way of organizing and storing data in memory in such a way that we can retrieve and perform operations on that stored data effectively.

For Eg, Structure is a data structure in C,

struct student{
int id;
char name[10];
int mark;
};

The above structure students helps to bind the name, id and mark of a student together, store it, and also to perform operations on the data effectively.

Please don't forget to give a Thumbs Up.


Related Solutions

2 .Define the probability density functions (pdfs) of the independent random variables X and Y as:...
2 .Define the probability density functions (pdfs) of the independent random variables X and Y as: fX(x)={ (1/5).(1-(x/10)), 0≤x≤10 fY(y)={ (1/5).(y/10) , 0≤y≤10 0 , otherwise for both fX(x) and fY(y) (a) Suppose that you are playing a game where you want to maximize your number of points , and you can have your score be X or Y . Which would you choose? (b) Suppose I am confused in part (a), so I flip an unfair coin, with P...
CS 209 Data Structure 3. a. Create a class named Point3D that contains 3 instance variables...
CS 209 Data Structure 3. a. Create a class named Point3D that contains 3 instance variables x, y, and z. b. Create a constructor that sets the variables. Also, create get and set methods for each variable. c. Create a toString() method. d. Make Point3D implement Comparable. Also, create a compareTo(Point3D other) method that compares based on the x-coordinate, then y-coordinate for tiebreakers, then z-coordinate for tiebreakers. For example, (1, 2, 5) comes before (2, 1, 4), which comes before...
URINARY SYSTEM 1. The anatomical structure of the urinary system 2.physiologic functions of the urinary 3.how...
URINARY SYSTEM 1. The anatomical structure of the urinary system 2.physiologic functions of the urinary 3.how circulatory system helps urinary in maintaining homeostasis 4. How lymphatics helps urinary in maintaining homeostasis 5 how respiratory helps urinary in maintaining homeostasis 6. How digestive helps urinary in maintaining homeostasis 7.How reproductive helps urinary in maintaining homeostasis Please, I want a short solution, for example, CARDIOVASCULAR SYSTEM- is an organ system composing of the heart and blood vessels as its major organs in...
Identify the structure and list their functions Sheep brain 1. Olfactory bulb 2. Olfactory tract 3....
Identify the structure and list their functions Sheep brain 1. Olfactory bulb 2. Olfactory tract 3. Optic chiasm 4. Optic nerve 5. Optic tract 6. Longitudinal fissure 7. Lateral ventricles 8. 4th ventricle 9. vermis
CREATE A CASH MANAGEMENT STRUCTURE AND DEFINE EACH OF THE FUNCTIONS AND CREATE SAMPLE CAPITAL STRUCTURE
CREATE A CASH MANAGEMENT STRUCTURE AND DEFINE EACH OF THE FUNCTIONS AND CREATE SAMPLE CAPITAL STRUCTURE
Immunoglobulin D: 1.Structure and functions 2. Evolutionary History 3. Unique Structures and components 4. roles in...
Immunoglobulin D: 1.Structure and functions 2. Evolutionary History 3. Unique Structures and components 4. roles in aspects of the metabolism of the organism 5. how does it interact with other organisms
Answer the following: 1. What is Econometrics? 2. What is the Structure of Economic Data 3....
Answer the following: 1. What is Econometrics? 2. What is the Structure of Economic Data 3. What are the steps in Econometric Modelling 4. What are the steps in Empirical Economic Analysis 5. Definition of the Simple Regression Model 6. What is the Interpretation of Regression Output 7. Define OLS
1- Definition and introduction of its layer 2- Explain the network functions 3- Explain the data...
1- Definition and introduction of its layer 2- Explain the network functions 3- Explain the data transfer method in the network 4- Mention the protocols if there is and explain them 5- Network positives and negatives effect for physical layer data link layer network layer transport layer presentation layer application layer and the tcp/ip
1. Identify and describe the functions of the nuclear envelope 2. Describe the structure of the...
1. Identify and describe the functions of the nuclear envelope 2. Describe the structure of the nuclear envelope. 3. Analyze how Lamin proteins play a role in nuclear structure.
1. Write out Beer’s Law for a mixture of 2 analytes and define the variables 2....
1. Write out Beer’s Law for a mixture of 2 analytes and define the variables 2. Why are 2 wavelength reading necessary? 3. Why is HCl added to the solutions? 4. Calculate the concentration when 10.0 mL of 0.10 M HCl is diluted to 100 mL. 5. Calculate the volume required to make your working standards.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT