By clicking “Check Writers’ Offers”, you agree to our terms of service and privacy policy. We’ll occasionally send you promo and account related email
No need to pay just yet!
About this sample
About this sample
Words: 690 |
Pages: 2|
4 min read
Published: Mar 19, 2020
Words: 690|Pages: 2|4 min read
Published: Mar 19, 2020
Output statements are instructions that a computer will read and process from a portion of a program. The program will send the information to an output statement which usually will look like this: print(“Hello, World”). This type of statement will display this sentence on the screen. Output statements are also very useful to display calculations (print(2+2), which would then calculate and present the number 4. This type of statement can show stings, integers and calculations. Output statements are needed as is able to display different question that might be needed to be known of.
Variables (known as memory location) are used to collect information that can be changed and stored to look at later in the program. These values can change when a user is asked a question, for example, when asking for their name. It will store there name and change during the programs executions. It may use it later on in the program. Different variables are given appropriate names so they are easily understandable. Many programmer make variables follow strict naming convention. It should begin with a letter, lowercased, however upper cased is allows and must no contain any spaces.
Input statemens are most commonly used to register a response from a user. These statements allow this variable to be input and stored as data. In python, for example, all inputs statements are held in the String data type. Therefore it means that they will be detected as characters (alphanumerical), which means letters, numbers and symbols. u This code sample explains that the piece of code has been ordered to ask a question to the user to enter their name, it will then be stored and used for later purposes.
In a sequence structure, an action or event that is program driven will begin with the ordered and follow it up with another order in a predetermined order. This structure allows any numbers of actions/ events to take place, however, these cannot be skipped and run in the logical order given to sequence. It will not have the ability to branch off into other parts of the coding and will only follow the strictly given instructions. Most commonly this structure is used in procedural programming.
Sequences are necessary structures to contain when coding as it makes sure the tasks that have been given, is proceeding in the correct order as, without this, the sequences would be at a fault and will become unorganised possibly confusing the user, if the user has been given a question.
The selection structure can be used when a question is asked. It will then determine the route in which the program will take, this will cause the program to move on to the next events, asking different questions. They’re also important when decision making needs to be made. Selections methods are usually: IF, Then, Else or Else IF statements.
Selections is essential as it allows programs to have different paths made by choice making. Without this branched question wouldn’t be a thing, and the solutions that would be created wouldn’t be realistic.
Iterations is a programming structure that causes a process of events to be repeated in an order that is specified by the number of times it happens or until the cooldown is met. This is also known as a loop when a set of instructions has been executed in a repeated manner.
Iteration is crucial as it allows algorithms to be simplified by mentioning that specific procedures will only repeat until told otherwise. However, this code sample shows that it is the same code repeated a lot of times. It works, but it’s a waste of time and effort.
But when using iteration programming structure it displays the names that have been stored in the variable, it makes a loop and invites them personal saving time. The concept of while loops: It will repeat itself depending on the instructions that are based on a condition. It must finish with a Boolean value of TRUE. This type of loop is used when the programmer doesn’t know the exact number of time the code is needed to be repeated.
Browse our vast selection of original essay samples, each expertly formatted and styled