1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Dennis_Churaev [7]
3 years ago
15

Describe the three functions of all programming languages and list at least two specific examples of each. The examples can be f

rom your personal experience, or anything you’ve read or watched in the course so far. The three functions of all programming languages are input, execution and collection.
Computers and Technology
2 answers:
natta225 [31]3 years ago
8 0

Answer:

The 3 functions of all programming languages are Input, Execution and collection.

They are described below:

Explanation:

1. <u>INPUT</u>: An input function can be defined as the function in programming that enables or allows the computer take in an input in form of any data type from the user. The input is either stored directly into a variable identifier or processed. A real-life scenario of an input function is taking in food. The intake of any substance into the mouth can be likened to an input function. We take in food into the body through the mouth and this is processed within the body.

Another example of input in a real-life scenario is dumping your trash into the bin. In this case, the bin is taking your trash bag as an input.  An input function in programming can take in integers, strings, character, float, arrays or any kind of data type. An input function allows the user send information to the computer using the keyboard, voice, gestures and other forms of communication.

  • <u>Examples of Input Function using C# programming language</u>

<em>Console.WriteLine("Please type any input from keyboard and press enter:");   </em>

<em>string userName = Console.ReadLine(); </em>

From the above example, In the first line of code, the compiler asks the user to input anything via the keyboard.

In the second line of code, the compiler takes in whatever the user has typed and stores it as a variable that we defined as userinput.<em> </em>

  • <u>Example of Input Function Using Python programming language</u>

<em>print('Type in your name:') </em>

<em>username = input() </em>

The first line of code requests that the user types in his name as an input, then Second line of code takes in the input and stores it as a variable declared as username

2. EXECUTION: execution in programming can be described as the process of performing some kind of operation as instructed by the code. This means that the computer reads through the code and performs any operation that it is asked to perform. such execution operation may include arithmetics, iteration, comparison and as many instructions as written in the code.

A real life scenario of execution is when you press the "play" button of an ipod. The ipod executes the "play" action and plays any song within in.

Another example is pressing 2+2 in your calculator and pressing "=" sign. The calculator performs the 2+2 operation and gives a result.

So we can then say that for every execution there is usually a result.  

  • <u>Examples of Execution Function using C# programming language</u>

<em>class ExecuteExample</em>

<em>  { </em>

<em>    static void Main(string[] args) </em>

<em>    { </em>

<em>      int additionop= 100 + 500; </em>

<em>     } </em>

<em>  }</em>

In the code above, execution occurs at the highlighted line. The compiler is asked to add the numbers 100 and 500. The act/process of adding both numbers is called EXECUTION.

  • <u>Example of Execution Function Using Python programming language</u>

<em>print('Type in your name:') </em>

<em>username = input() </em>

<em>print('We just executed, ' + username )</em>

Continuing from our code in the "input example" . As seen in the code above, execution occurs at the point where the computer prints the output of the user's input. In this case the computer prints "we just executed, + whatever value the user had passed as an input."

3. COLLECTION: Collection in programming is used to describe the process where a computer objects collects and groups  similar elements to form a single unit. This collection can be a group of similar data types.

A real life example of a collection is a Queue of people at an ATM. This can define the Queue collection type. usually this kind of collection is considered as a First in First out collection.

Another example of collection can be a List of cars in a Ford car garage. This garage takes in a range of cars that are Ford models only.

  • <u>Example of Collection Function using C# programming language</u>

List : A List is a type of collection as seen below:

<em>var listcollect = new List<string>(); </em>

<em>listcollect .Add("fordexplorer"); </em>

<em>listcollect .Add("fordedge"); </em>

<em>listcollect .Add("fordescape"); </em>

<em>listcollect .Add("fordtruck"); </em>

<em>foreach (var car in listcollect) </em>

<em>{ </em>

<em>    //do somethin</em>

<em>}</em>

The above code creates a collection(list) of the car names as a string in a tipper garage, adds elements(items) to this list and iterates through the list. This is a typical example of a collection.

  • <u>Example of Collection Function using C# programming language</u>

Queue: a queue is a case of colleciton that uses the first in first out idea. The first in first out concept is : first element to be taken in is pushed out first also known as FIFO:

<em>class ExmapleofQueue</em>

<em> { </em>

<em>  static void Main(string[] args) </em>

<em>  { </em>

<em>   Queue sampleQueue= new Queue(); </em>

<em>   sampleQueue.Enqueue(1); </em>

<em>   sampleQueue.Enqueue(2); </em>

<em>   sampleQueue.Enqueue(3); </em>

<em>   foreach (Object numberel in sampleQueue) </em>

<em>   { </em>

<em>    //do something</em>

<em>   }</em>

<em>}</em>

<em>}</em>

<em>From example above, we can see that we created a queue called sampleQueue. This holds a queue of integers.</em>

<em />

Lerok [7]3 years ago
4 0

Answer:

3 different types of user defined functions are:

  • Function with no arguments and no return value.
  • Function with no arguments and a return value.
  • Function with arguments and no return value.

Explanation:

Function with no arguments and no return value.

#include<iostream.h>

#include<conio.h>

void main()    // function declaration

{

   greatNum();        // function call

   return 0;

}

void greatNum()        // function definition

{

   int i, j;

   if(i > j) {

cout <<"The greater number is : "<< i;

   }

   else {

      cout <<"The greater number is : "<< j;

}

}  

Function with no arguments and a return value.

#include<iostream.h>

int Num();       // function declaration

int main()

{

   int r;

   r= Num();        // function call

  cout<<" The number is "<< r;

   return 0;

}

int Num()        // function definition

{

   int i, j, gNum;

   if(i > j) {

       gNum = i;

   }

   else {

       gNum = j;

   }

   return gNum;

}

The following code determine the input execution and collection of function with return and no return type

You might be interested in
Discussion Question 10: A bank in California has 13 branches spread throughout northern California , each with its own minicompu
GuDViN [60]

Answer:

The system that will be more prone to attack or vulnerability is the  bank that has ten branches spread throughout California with the data being stored on a mainframe in San Francisco.

Explanation:

Solution

If the databases are not shared by all the branches throughout the network, they could not be hacked or accessed easily. but when the systems are in a network and share databases or resources,then these could be more vulnerable  to unauthorized persons or individuals.

The data been stored on a mainframe in San Francisco that is a centralized access by 10 branches of another bank. what this implies is that networking is involved or used to share data.

With this example, the chances of vulnerability or attacks increases from the following :

  • Accounts payable could be disturbed by changing cash in payment false.
  • Entering incorrect data into the system. such transactions can be altered, deleted by unauthorized persons.
  • Transaction fraud like hacking, masquerading are very common in a networked system.
3 0
3 years ago
Can anyone tell me what wrong with this code the instructions are "Currently, this program will add 6 and 3 together, output the
atroni [7]

Answer:

import random

a = random.randint(1,10)

b = random.randint(1,10)

answer = a * b

print(str(b)+" * "+str(a)+" = "+str(answer))

Explanation: So I am guessing you are on Edhesive Module 2.5 Intro to cs. Sorry it took so long but hopefully this works.

4 0
3 years ago
On a web page coded in HTML, there is a sentence that reads, "Welcome to Assessments Section." Sam wants to insert the word "the
Natalka [10]

Answer:

The inserted text will appear as underlined text. The deleted text will appear as strike through text.

Explanation:

In HTML the text which has been inserted will appear as underlined text. It means if we insert something in HTML then it will underline it. This will highlight the text that has been inserted. While on the other hand if we delete some text and replace it with some other text, then it will appear as strikethrough text.

Strikethrough text is the text which is represented with a horizontal line in its center. It represents those words which are added by mistake and are not meant for inclusion.

7 0
3 years ago
State The function<br>of floppy disk​
Romashka [77]

Answer:

A floppy disk drive (FDD) is a small disk drive used in computers for data transfer, storage and backup of small amounts of data, as well as installation of programs and driver updates. A floppy disk drive accesses data recorded on small, removable diskettes known as floppy disks.

8 0
3 years ago
Consider a city of 10 square kilometers. A macro-cellular system design divides the city into square cells of 1 square kilometer
victus00 [196]

Answer:

1,000 users

10,000,000 users

Explanation:

Given the following :

Area of city = 10 square kilometers

Each cell = 1 square per kilometer

Number of users each cell can accommodate = 100

Total number of users that can be accommodated in the system :

(Total number of cells in the system * number of users per cell)

(10 sqkm / 1 sqkm) * 100

10 * 100 = 1,000 users

B) If cell size is reduced to 100 square meters

Converting 100 square meters to square km

100 sq meters = 0.0001 sq kilometers

Number of users each cell can accommodate = 100

Total number of users that can be accommodated in the new system :

(Total number of cells in the system * number of users per cell)

(10 sqkm / 0.0001 sqkm) * 100

100,000 * 100 = 10,000,000 users

6 0
3 years ago
Other questions:
  • How technology bacome the mode of revealing​
    10·1 answer
  • You can be sentenced to up to 180 days in jail for driving with a license that was suspended for _________ .
    15·1 answer
  • 4. What is the difference between portrait orientation and landscape orientation? (1.0 points)
    9·1 answer
  • The word blog is made from what two terms?
    11·1 answer
  • Which of the following could not be represented by columns in the SPSS data editor? a. Levels of between-group variables. b. Lev
    11·2 answers
  • You're a ticket agent for a commercial airline and responsible for checking the identification for each passenger before issuing
    13·1 answer
  • A Transmission Control Protocol (TCP) connection is established and two devices ensure that they're speaking the same protocol.
    15·1 answer
  • I'm trying to export a video with HitFilm Express, I am either unable to click the export button or it gets to 43% and just stop
    5·1 answer
  • In series connection, if we have two symmetric devices connected with 10 V battery, voltage for each device will be.. .5V or 10V
    10·1 answer
  • Which game would be classified as an advergame?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!