<< Chapter < Page
  Teaching beginners to code     Page 2 / 9
Chapter >> Page >

Images

  • Image 1 . The sequence structure in pseudocode.
  • Image 2 . The selection structure in pseudocode.
  • Image 3 . The loop structure in pseudocode.
  • Image 4 . Scratch 2.0 programming interface for the program named IfSimple01.
  • Image 5 . A paraphrased version of the Scratch code.
  • Image 6 . Program code for the left beachball
  • Image 7 . Initializing the position and orientation of the basketball.
  • Image 8 . All of the code that applies to the basketball.
  • Image 9 . Pseudocode for a selection structure.
  • Image 10 . Two independent decisions.
  • Image 11 . Control structures available in Scratch.
  • Image 12 . Programming blocks belonging to the Sensing group.
  • Image 13 . Initial output from the program named IfWithVar01.
  • Image 14 . Program output after having clicked twice in the Stage area.

General background information

In this module, I will help you learn about:

  • Structured programming.
  • The sequence structure.
  • The selection structure.
  • The loop structure.

In introductory programming courses, you will often hear a lot about something called structured programming. In comparison with more modern and complex programming concepts such as runtime polymorphism, structured programming is fairly mundane. However, that's not to say that structured programming isn'timportant. It is very important. But it is just a small bump in the road of learning that leads to a more complete understanding of computerprogramming, especially object-oriented programming.

What is structured programming ?

Basically, the concept of structured programming says that any programming logic problem can be solved using an appropriate combination of only threeprogramming structures, none of which are complicated. The three structures are known generally as:

  • The sequence structure.
  • The selection or decision structure .
  • The loop, repetition, or iteration structure.

One door in and one door out

To understand structured programming, you need to think in terms of a section of program code that has only one entry point and one exit point. It isvery important that there cannot be multiple entry points or multiple exit points.

There must be only one way into the section of code and one way out of the section of code.

Nesting of structures is allowed

Another important part of the concept is that structures may be nested inside of other structures provided that every structure meets the basic rules for astructure.

Thus, by nesting simple structures inside of simple structures, large and complex overall structures can be constructed.

Pseudocode

Computer programming source code consists generally (but not in Scratch) of programming instructions written in text form with a very specific format or syntax that is designed to be understood by a computerprogram. (This is commonly called source code.) Humans who are not computer programmers might not be expected to understand much of what they see in computer programming source code.

According to Wikipedia ,

"The prefix pseudo - (from Greek... "lying, false") is used to mark something as false, fraudulent, or pretending to be something it is not."

Questions & Answers

how do you get the 2/50
Abba Reply
number of sport play by 50 student construct discrete data
Aminu Reply
width of the frangebany leaves on how to write a introduction
Theresa Reply
Solve the mean of variance
Veronica Reply
Step 1: Find the mean. To find the mean, add up all the scores, then divide them by the number of scores. ... Step 2: Find each score's deviation from the mean. ... Step 3: Square each deviation from the mean. ... Step 4: Find the sum of squares. ... Step 5: Divide the sum of squares by n – 1 or N.
kenneth
what is error
Yakuba Reply
Is mistake done to something
Vutshila
Hy
anas
hy
What is the life teble
anas
hy
Jibrin
statistics is the analyzing of data
Tajudeen Reply
what is statics?
Zelalem Reply
how do you calculate mean
Gloria Reply
diveving the sum if all values
Shaynaynay
let A1,A2 and A3 events be independent,show that (A1)^c, (A2)^c and (A3)^c are independent?
Fisaye Reply
what is statistics
Akhisani Reply
data collected all over the world
Shaynaynay
construct a less than and more than table
Imad Reply
The sample of 16 students is taken. The average age in the sample was 22 years with astandard deviation of 6 years. Construct a 95% confidence interval for the age of the population.
Aschalew Reply
Bhartdarshan' is an internet-based travel agency wherein customer can see videos of the cities they plant to visit. The number of hits daily is a normally distributed random variable with a mean of 10,000 and a standard deviation of 2,400 a. what is the probability of getting more than 12,000 hits? b. what is the probability of getting fewer than 9,000 hits?
Akshay Reply
Bhartdarshan'is an internet-based travel agency wherein customer can see videos of the cities they plan to visit. The number of hits daily is a normally distributed random variable with a mean of 10,000 and a standard deviation of 2,400. a. What is the probability of getting more than 12,000 hits
Akshay
1
Bright
Sorry i want to learn more about this question
Bright
Someone help
Bright
a= 0.20233 b=0.3384
Sufiyan
a
Shaynaynay
How do I interpret level of significance?
Mohd Reply
It depends on your business problem or in Machine Learning you could use ROC- AUC cruve to decide the threshold value
Shivam
how skewness and kurtosis are used in statistics
Owen Reply
yes what is it
Taneeya
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Teaching beginners to code. OpenStax CNX. May 27, 2013 Download for free at http://cnx.org/content/col11498/1.20
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Teaching beginners to code' conversation and receive update notifications?

Ask