- •Reading
- •Match the terms related to the topic of the Unit (1-7) with their definitions (a-f).
- •Decide if the following sentences are true or false. Correct the false sentences. Use the phrases from Appendix 3 to help you.
- •Language work
- •Grammar
- •Translate the following sentences from Russian into English. Use Grammar guide 3 and Grammar guide 4 to help you.
- •Speaking
- •Read the text and define five basic types of programming languages.
- •Study the following sample sections of programs and define programming languages, in which these programs are written.
- •Study this Visual Basic program. What do you think this program is for? Discuss your ideas with the partner.
- •Language work
- •Compare your answers with the partner.
- •Grammar
- •Read the following article about Voice xml and its component and perform the following tasks.
- •Think over and answer the following questions:
- •Reading
- •Language work
- •Speaking
Study the following sample sections of programs and define programming languages, in which these programs are written.
1
#include <iostream>
using namespace std;
void main()
{
unsigned int Miles;
const double LessThan100 = 0.25;
const double MoreThan100 = 0.15;
double PriceLessThan100, PriceMoreThan100, TotalPrice;
cout << "Enter the number of miles: ";
cin >> Miles;
2
<!DOCTYPE html>
<html>
<body>
<p>In HTML, JavaScript statements are "commands" to the browser.</p>
<p id="demo"></p>
3
PROGRAM EUCLID
PRINT *, 'A?'
READ *, NA
IF (NA.LE.0) THEN
PRINT *, 'A must be a positive integer.'
4
def __init__(self, fun, *args, **kwargs):
self.fun = fun
self.pending = args[:]
self.kwargs = kwargs.copy()
5
public class CalculateCircleAreaExample {
public static void main(String[] args) {
int radius = 0;
System.out.println("Please enter radius of a circle");
try
{
//get the radius from console
BufferedReader br = new BufferedReader(newInputStreamReader(System.in));
4
6
using System.Windows.Forms;
using System.Drawing;
public static DialogResult InputBox(string title, string promptText, ref string value)
{
Form form = new Form();
Label label = new Label();
TextBox textBox = new TextBox();
Button buttonOk = new Button();
Button buttonCancel = new Button();
Study this Visual Basic program. What do you think this program is for? Discuss your ideas with the partner.
Private Sub UpdateSprite(ByVal gameTime As GameTime) ' Move the sprite by speed, scaled by elapsed time. spritePosition += spriteSpeed * CSng(gameTime.ElapsedGameTime.TotalSeconds)
Dim MaxX = graphics.GraphicsDevice.Viewport.Width - myTexture.Width Dim MinX = 0 Dim MaxY = graphics.GraphicsDevice.Viewport.Height - myTexture.Height Dim MinY = 0
' Check for bounce. If spritePosition.X > MaxX Then spriteSpeed.X *= -1 spritePosition.X = MaxX ElseIf spritePosition.X < MinX Then spriteSpeed.X *= -1 spritePosition.X = MinX End If
If spritePosition.Y > MaxY Then spriteSpeed.Y *= -1 spritePosition.Y = MaxY
ElseIf spritePosition.Y < MinY Then spriteSpeed.Y *= -1 spritePosition.Y = MinY End If End Sub |
READING
Read the text and define five basic types of programming languages.
Basic language types
Nowadays programming languages are getting more general and all-purpose, but they still have their specializations, and each language has its benefits and deficiencies. We can distinguish a few basic types of languages, though many of them maintain more than one programming style.
Procedural
Procedural languages perform a sequence of statements that lead to a result. In order to solve a problem a procedural language expresses the procedure to be followed. Procedural languages generally use many variables, loops and other elements of "state", which recognize the difference between them and functional programming languages.
Functional
Functional programs usually make use of recursive functions and focuses on the return values of functions. Functional languages are thought to be simpler syntactically, which make it easier to work on abstract problems. However, their programming model complicates understanding of how the code is translated into machine language, therefore it can be problematic for system programming.
Object-oriented
Object-oriented programming considers the world as a collection of objects that have internal data and external means of accessing parts of that data. By means of object-oriented language, the problem is divided into a collection of objects to solve a particular problem.
Scripting
Scripting languages are often procedural and may include elements of object-oriented languages, but they refer to their own category. Scripting languages tend to require little syntax to get started but may result in making a mess.
Logic
Logic programming languages let programmers make declarative statements and then allow the computer to reason about the consequences of those statements. Logic programming, in a manner, does not tell the computer how to do something, but place constraints on what it should consider doing.
To call these categories "language types" is a bit improper. It's possible to program in an object-oriented style in C, or a functional style in a scripting language. Practically, most modern languages incorporate features and ideas from multiple domains, which only serve to increase the abundance and usefulness of these languages.
In the text above find the words and word combinations that mean the following:
designed to be used for writing software in a wide variety of application domains;
disadvantages;
a class of functions that are defined using primitive recursion;
a sentence used to state an argument a fact or an idea;
misleading;
a very large quantity of something;
to make something more difficult to do, deal with, or understand;
a mathematical quantity which can represent several different amounts;
the rules that describe how words and phrases are used in a computer language.
Answer the following questions:
Is there a perfect programming language without any defects?
What do procedural languages perform?
Do functional programs have complicated syntax?
How is a problem solved in object-oriented programming?
What features do scripting languages have?
What do logic programming languages let the computer do?
What is the function of multiple domains?
Listen to Matthew Brown, editor of LordMatt, on the following site http://cplus.about.com/od/introductiontoprogramming/p/programming.htm and answer the questions:
What is the C++ programming language?
Where is C++ used?
What are the benefits of C++?
Tell the partner about main features of basic types of programming languages mentioned in the text.
Read the text about some other programming languages.
Java is an object-oriented programming language that was designed to be portable and workable on as many platforms as possible. Therefore, Java can be found at the core of applications on and off the web, on all platforms, operating systems and devices. Nevertheless, Java is not a perfect programming language, as it got a lot of its syntax from earlier languages (C, C++).
JavaScript, (should not to be confused with Java) is a scripting language that was developed in the 90s. JavaScript is one of the fundamental technologies on which the web is based. JavaScript exists both in the context of connected applications and services and outside of the browser. The language itself is dynamic, and gives programmers the flexibility to use object-oriented programming styles as well as functional and imperative ones.
Python was developed in the 80s, it is open source and free to use, even for commercial applications. Python is usually used and referred to as a scripting language, which allows programmers to produce large quantities of easily readable and functional code at a fast rate and within a short time. In the meantime, it supports object-oriented, procedural and functional programming styles, among others. Thanks to its flexibility, Python is one of the most widely used high-level programming languages today.
Visual Basic is used to create programs for Microsoft Windows at an easy rate. "Visual" stands for the method used to create what the user can see - the graphical user interface, or GUI (graphical user interface). "Basic" is the acronym for Beginners All-Purpose Symbolic Instruction Code. With this language, it is possible to create useful programs being familiar with just a few of its features.
PHP is a common language for webpage design, and is sometimes used as a scripting language in *nix. PHP comprises features that make it easy to link to databases, generate HTTP headers, and so forth. As a scripting language, it contains a relatively simple set of basic components.
Visual C# is designed to easily and quickly create .NET applications, including Web services and ASP.NET Web applications. C# is a simple, type-safe, object-oriented language developed by Microsoft for designing a wide range of applications. Developers familiar with C and C++ can quickly become efficient in C#. C# provides intrinsic code trust mechanisms for a high level of security, type safety and garbage collection.
XML provides a format for describing structured data. This facilitates precise declarations of content and useful search results across multiple platforms. XML specifies information and data in accordance with purpose rather than presentation. XML is an increasingly important meta-markup language to use on the Internet. XML is not a replacement for HTML. The strength of HTML is in displaying information while XML is a way to describe information.
Complete these sentences with the programming language from the text.
__________ is a general-purpose programming language created in the late 1980s, which is used by thousands of people to do different things from testing microchips at Intel to powering Instagram, building video games with the PyGame library owing to its availability.
___________ provides developers with access to the Microsoft .NET Framework - a reliable, thread-safe library of networking functions, collection classes, data access classes, etc.
__________started as an alternative to C++ with an extensive standard library. Due to its versatility it is used on many platforms.
Generally, ________ is used to supplement a functionality to your site that HTML alone can't achieve. It can perform all types of calculations and interact with databases.
You can easily create your own webpage using ____________.
_____________ is primarily a scripting language for use within HTML pages.
___________ is used on webpages and web services as well as for creating databases, storing and carrying data.
Answer the following questions:
What are the differences between Java and Java Script?
Why is Java so popular?
What is Python used for?
What is the key difference between XML and HTML?
Is it difficult to master Visual C# if you do not know C or C++?
Can PHP be embedded into HTML? Is it suitable for web development?
Tell the partner about programming languages mentioned in the text above, outlining their features.
Complete the list of programming languages. Try to remember at least four of them, name their characteristics.
