Skip to content

Commit

Permalink
Fixed short hyphen "-" to long hyphen "–" in the text sentences
Browse files Browse the repository at this point in the history
  • Loading branch information
nakov committed Jan 28, 2019
1 parent ed2a0a4 commit dfdebdb
Show file tree
Hide file tree
Showing 94 changed files with 256 additions and 257 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Exercises: First Steps in Coding

Welcome to the **exercises**. Now we are going to write a couple of console applications, by which we are going to make a few more steps into programming. After that we will show how we can program something more complex - programs with graphical user interface.
Welcome to the **exercises**. Now we are going to write a couple of console applications, by which we are going to make a few more steps into programming. After that we will show how we can program something more complex programs with graphical user interface.

## What We Learned in This Chapter?

First we have learned **what is programming** - **giving commands, written in a computer language**, which the machine understands and is able to execute. We understood what is **a computer program** - it represents a **sequence of commands**, arranged one after another. We got familiar with **the language for programming C\#** on a base level and how **to create simple console applications** with Visual Studio. We followed **the structure of the programming code in the C\# language**, as for example, the fact that commands are mainly given in the section `static void Main(string[] args)` between **the opening and closing curly parentheses**. We saw how to print with `Console.WriteLine(…)` and how to start our program with \[**Ctrl + F5**\]. We learned how to test our code in **SoftUni Judge**.
First we have learned **what is programming** **giving commands, written in a computer language**, which the machine understands and is able to execute. We understood what is **a computer program** it represents a **sequence of commands**, arranged one after another. We got familiar with **the language for programming C\#** on a base level and how **to create simple console applications** with Visual Studio. We followed **the structure of the programming code in the C\# language**, as for example, the fact that commands are mainly given in the section `static void Main(string[] args)` between **the opening and closing curly parentheses**. We saw how to print with `Console.WriteLine(…)` and how to start our program with \[**Ctrl + F5**\]. We learned how to test our code in **SoftUni Judge**.

## The Exercises

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ What remains is to finish the program above, to calculate the area of the rectan

## Test Your Solution

Test your solution with a few examples. You have to receive an output, similar to this one \(we enter 2 and 7 as input and the program prints result 14 - their multiplication\):
Test your solution with a few examples. You have to receive an output, similar to this one \(we enter 2 and 7 as input and the program prints result 14 their multiplication\):

```
2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Now we are about to build one simple **web application** and one simple **graphi

With **console applications**, as you can figure out yourselves, **all operations** for reading input and printing output are **done through the console**. **The input data is inserted** in the console, which is then read by the application, also in it, and the **output data is printed** on the console after or during the runtime of the program.

While a console application **uses the text console**, web applications **use web-based user interface**. To **execute them**, two things are needed - **a web server** and **a web browser**, as **the browser** plays the main role in **the visualization of the data and the interaction with the user**. Web applications are much more pleasant for the user, they visually look better, and a mouse and touch screen can be used \(for tablets and smartphones\), but programming stands behind all of that. And this is why **we have to learn to program** and we have already made our first very little steps towards that.
While a console application **uses the text console**, web applications **use web-based user interface**. To **execute them**, two things are needed **a web server** and **a web browser**, as **the browser** plays the main role in **the visualization of the data and the interaction with the user**. Web applications are much more pleasant for the user, they visually look better, and a mouse and touch screen can be used \(for tablets and smartphones\), but programming stands behind all of that. And this is why **we have to learn to program** and we have already made our first very little steps towards that.

Graphical \(GUI\) applications have **a visual user interface**, directly into your computer or mobile device, without a web browser. Graphical applications \(also known as desktop applications\) **contain one or more graphical windows**, in which certain **controllers** are located \(text fields, buttons, pictures, tables and others\), **serving for dialog** with the user in a more intuitive way. Similar to them are the mobile applications in your telephone or your tablet: we use forms, text fields, buttons and other controls and we control them by programming code. This is why we are learning how to write code now: **the code is everywhere in software development**.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Let's start with the **concepts of computer programming**: computer programs, al

## What It Means "To Program"?

**To program** means to give commands to the computer, for example "_to play a sound_", "_to print something on the screen_" or "_to multiply two numbers_". When the commands are one after another, they are called **a computer program**. The text of computer programs is called **a program code** \(or **a source code**, or even shorter - **code**\).
**To program** means to give commands to the computer, for example "_to play a sound_", "_to print something on the screen_" or "_to multiply two numbers_". When the commands are one after another, they are called **a computer program**. The text of computer programs is called **a program code** \(or **a source code**, or even shorter **code**\).

## Computer Programs

**Computer programs** represent **a sequence of commands** that are written in a previously chosen **programming language**, like C\#, Java, JavaScript, Python, Ruby, PHP, C, C++, Swift, Go or another. In order to write commands, we have to know **the syntax and the semantics of the language** which we are working with, in our case - **C\#**. This is why we are going to get familiar with the syntax and the semantics of the language C\#, and with programing generally, in the current book, by learning step by step code writing from the simpler to the more complex programming constructions.
**Computer programs** represent **a sequence of commands** that are written in a previously chosen **programming language**, like C\#, Java, JavaScript, Python, Ruby, PHP, C, C++, Swift, Go or another. In order to write commands, we have to know **the syntax and the semantics of the language** which we are working with, in our case **C\#**. This is why we are going to get familiar with the syntax and the semantics of the language C\#, and with programing generally, in the current book, by learning step by step code writing from the simpler to the more complex programming constructions.

## Algorithms

Expand All @@ -24,7 +24,7 @@ For convenience when creating programs, for writing programming code, for execut

Some programming languages do not use a compiler and are being **interpreted directly** by a specialized software called an "interpreter". **The interpreter** is "**a program for executing programs**", written in some programming language. It executes the commands in the program one after another, as it understands not only a single command and sequences of commands, but also other language constructions \(evaluations, iterations, functions, etc.\). Languages like PHP, Python and JavaScript work with an interpreter and are being executed without being compiled. Due to the absence of previous compilation, in interpreted languages **the errors are being found during runtime**, after the program starts running, not previously.

**An environment for development** \(Integrated Development Environment - **IDE**\) is an union of traditional tools for development of software applications. In the development environment we write code, compile and execute the programs. Development environments integrate in them **a text editor** for writing code, **a programming language**, **a compiler or an interpreter** and **a runtime environment** for executing programs, **a debugger** for tracking the program and seeking out errors, **tools for user interface design** and other tools and add-ons.
**An environment for development** \(Integrated Development Environment **IDE**\) is an union of traditional tools for development of software applications. In the development environment we write code, compile and execute the programs. Development environments integrate in them **a text editor** for writing code, **a programming language**, **a compiler or an interpreter** and **a runtime environment** for executing programs, **a debugger** for tracking the program and seeking out errors, **tools for user interface design** and other tools and add-ons.

**Environments for development** are convenient, because they integrate everything necessary for the development of the program, without the need to exit the environment. If we don't use an environment for development, we will have to write the code in a text editor, to compile it with a command in the console, to run it with another command in the console and to write more additional commands when needed, which is very time consuming. That is why most of the programmers use an IDE in their everyday work.

Expand All @@ -42,7 +42,7 @@ The majority of software that we use daily, like a music player, a video player,

**C\# is a compiled language**, which means that we write commands that are being compiled before they're being executed. Exactly these commands, through a help program \(a compiler\), are being transformed into a file, which can be executed \(executable\). To write a language like **C\#** we need a text editor or a development environment and **.NET Runtime Environment**.

**.NET Runtime Environment** represents a virtual machine, something like a computer in the computer, which can run a compiled C\# code. With the risk of going too deep into details, we have to explain that the language C\# is compiled into an intermediary .NET code and is executed from the .NET environment, which compiles this intermediary code additionally into machine instructions \(machine code\) in order to be executed by the microprocessor. .NET environment contains libraries with classes, **CSC** compiler, **CLR** \(Common Language Runtime - CLR\) and other components, which are required for working with the language C\# and run C\# programs.
**.NET Runtime Environment** represents a virtual machine, something like a computer in the computer, which can run a compiled C\# code. With the risk of going too deep into details, we have to explain that the language C\# is compiled into an intermediary .NET code and is executed from the .NET environment, which compiles this intermediary code additionally into machine instructions \(machine code\) in order to be executed by the microprocessor. .NET environment contains libraries with classes, **CSC** compiler, **CLR** \(Common Language Runtime CLR\) and other components, which are required for working with the language C\# and run C\# programs.

**The .NET environment** is available as a free software with open source code for every modern operating system \(like Windows, Linux and Mac OS X\). It has two variations, **.NET Framework** \(the older one\) and **.NET Core** \(the newer one\), but none of that is essential when it comes to getting into programming. Let us focus on writing programs with the C\# language.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ We set **a meaningful name** to our program, for example `HelloCSharp`:![](/asse

The source code of the C\# program is written in the section `Main(string[] args)`, between the opening and the closing parentheses `{ }`. This is the main method \(action\), that is being executed with the start of a C\# program. This `Main()` method can be written in two ways:

* `static void Main(string[] args)` - with parameters from the command line \(we are not going into details\)
* `static void Main()` - without parameters from the command line.
* `static void Main(string[] args)` with parameters from the command line \(we are not going into details\)
* `static void Main()` without parameters from the command line.

Both ways are valid, as **the second one is recommended**, because it is shorter and clearer. By default, though, when creating a console application, Visual Studio uses the first way, which we can edit manually if we want to, and delete the part with the parameters `string[] args`.

Expand Down Expand Up @@ -70,7 +70,7 @@ In the table with the sent solutions the judge system is going to show one of th

### How to Register in SoftUni Judge?

Use your credentials \(username + password\) for the site softuni.bg. If you don't have a SoftUni registration, create one. It takes only a minute - a standard registration in an Internet site.
Use your credentials \(username + password\) for the site softuni.bg. If you don't have a SoftUni registration, create one. It takes only a minute a standard registration in an Internet site.

## Testing the Programs That Play Notes

Expand Down
12 changes: 6 additions & 6 deletions Content/Chapter-1-first-steps-in-programming/overview.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Chapter 1. First Steps in Programming

In this chapter, we are going to find out **what programming is** in its core and how to write simple programs and apps.
- We will get familiar with the idea of **programming languages** and development platforms, along with concepts like **compilation** and code **execution**.
- We are going to take a look at the **environments for software development** (IDEs) and how to work with them, in particular with **Visual Studio**.
- We will write and execute our **first program** with the programming language **C#** in **Visual Studio**.
- We will **exercise** with a couple of tasks: we will create **console-based** programs, a graphical application (**GUI**) and a **Web** application.
- We will learn how to check the correctness of the solutions from this book in **the Judge system of SoftUni**.
- We will get to know some of the **typical mistakes**, which are often made during code writing and how to prevent doing them.
- We will get familiar with the idea of **programming languages** and development platforms, along with concepts like **compilation** and code **execution**.
- We are going to take a look at the **environments for software development** (IDEs) and how to work with them, in particular with **Visual Studio**.
- We will write and execute our **first program** with the programming language **C#** in **Visual Studio**.
- We will **exercise** with a couple of tasks: we will create **console-based** programs, a graphical application (**GUI**) and a **Web** application.
- We will learn how to check the correctness of the solutions from this book in **the Judge system of SoftUni**.
- We will get to know some of the **typical mistakes**, which are often made during code writing and how to prevent doing them.

## Video

Expand Down
6 changes: 3 additions & 3 deletions Content/Chapter-10-methods/exercises-methods/notifications.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Problem: Notifications

Write a program, which takes an integer **`n`** and on the next rows prints **`n`** **messages** (for each message read a few lines). Each message starts with **`messageType`**: **`success`**, **`warning`** or **`error`**:
- When **`messageType`** is **`success`** read **`operation`** + **`message`** (each on a new line).
- When **`messageType`** is **`warning`** read only **`message`**.
- When **`messageType`** is **`error`** read **`operation`** + **`message`** + **`errorCode`** (each on a new line).
- When **`messageType`** is **`success`** read **`operation`** + **`message`** (each on a new line).
- When **`messageType`** is **`warning`** read only **`message`**.
- When **`messageType`** is **`error`** read **`operation`** + **`message`** + **`errorCode`** (each on a new line).

Print in the console **each read message**, formatted depending on its **`messageType`**. After the headline of the message print as much **`=`**, **as the length** of the said **headline** and print **an empty line** after each message (to understand in detail look at the examples).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Write a method **`Letterize(number)`**, which reads an integer and prints it in

## Hints and Guidelines

We can first print **the hundreds** as a text - \(the number / 100\) % 10, after that **the tens** - \(the number / 10\) % 10 and at the end **the ones** - \(the number % 10\).
We can first print **the hundreds** as a text \(the number / 100\) % 10, after that **the tens** \(the number / 10\) % 10 and at the end **the ones** \(the number % 10\).

The first special case is when the number is exactly **rounded to 100** \(e.g. 100, 200, 300 etc.\). In this case we print "one-hundred", "two-hundred", "three-hundred" etc.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Write a method **`Encrypt(char letter)`**, which encrypts a given letter in the

Example:
* j → **p16i**
* ASCII code of **j** is **106** → First digit - **1**, last digit - **6**.
* ASCII code of **j** is **106** → First digit **1**, last digit **6**.
* We concatenate the first and the last digit → **16**.
* At **the beginning** of the string, which represents the result, concatenate the symbol, which you get from the sum of the ASCII code + the last digit → 106 + 6 → 112 → **p**.
* At **the end** of the string, which represents the result, concatenate the symbol, which you get from subtracting the ASCII code - the first digit → 106 - 1 → 105 → **i**.
* At **the end** of the string, which represents the result, concatenate the symbol, which you get from subtracting the ASCII code the first digit → 106 - 1 → 105 → **i**.

Using the method shown above, write a program which takes **a sequence of characters**, **encrypts them** and prints the result on one line.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ As we mentioned, if you use **the same name for several methods with different s

It is important to say that **the return type as a result** of the method **is not a part of its signature**. If the return type was a part of the signature, then the compiler doesn't know which method exactly to invoke.

Let's look at the following example - we have two methods with different return types. Despite that Visual Studio shows that there is a mistake, because both of their signatures are the same. Therefore when trying to invoke a method named **`Print(…)`**, the compiler can't know which of the two methods to run.
Let's look at the following example we have two methods with different return types. Despite that Visual Studio shows that there is a mistake, because both of their signatures are the same. Therefore when trying to invoke a method named **`Print(…)`**, the compiler can't know which of the two methods to run.

![](/assets/chapter-10-images/17.Method-overloading-02.png)

Expand Down
Loading

0 comments on commit dfdebdb

Please sign in to comment.