The free book "Programming Basics with C#" (https://csharp-book.softuni.org) is a comprehensive entry level computer programming tutorial for absolute beginners that teaches basics of coding (variables and data, conditional statements, loops and methods), logical thinking and problem solving using the C# language.
The book comes with free video lessons for each chapter, 150+ practical exercises with an automated online evaluation system (online judge) and solution guidelines for the exercises.The book "Programming Basics with C#" introduces the readers with writing programming code at a beginners level (basic coding skills), working with development environment (IDE), using variables and data, operators and expressions, working with the console (reading input data and printing output), using conditional statements (if, if-else, switch-case), loops (for, while, do-while, foreach) and methods (declaring and calling methods, passing parameters and returning values), as well as algorithmic thinking and solving practical programming problems.
This free coding book for beginners is written by a team of developers lead by Dr. Svetlin Nakov (https://nakov.com) who has 25+ years practical software development experience and 15+ years as software development trainer. The free book "Programming Basics with C#" is an official textbook for the "Programming Basics" classes at the Software University (SoftUni), used by tens of thousands of students at the start of their software development education.
The book relies on the "explain by examples" and "learn by doing" approaches to learning the practical coding skills required to become a software engineer. Each chapter provides some concepts, explained as video lesson with lots of code examples, followed by practical exercises involving the use of the new concepts with online evaluation system (online judge). Learners watch the videos, try the sample code and solve the exercises, which come as part of each book chapter. Exercises are given in series with increasing complexity: from quite trivial, though little complicated to highly complicated, requiring more thinking and research in Internet. Most exercises come with detailed hints and guidelines about how to construct a correct solution.
Download the free C# programming basics book (as PDF, ePub and Mobi formats), watch the video lessons and the live coding demos, solve the practical exercises and evaluate your solutions at the book official Web site: https://csharp-book.softuni.org.
Conditions of Use
This book is licensed under a Creative Commons License (CC BY-NC-SA). You can download the ebook Programming Basics with C# for free.
- Title
- Programming Basics with C#
- Subtitle
- Comprehensive Introduction to Programming with C#
- Publisher
- Faber Publishing
- Author(s)
- Dr. Svetlin Ivanov Nakov
- Published
- 2019-05-01
- Edition
- 1
- Format
- eBook (pdf, epub, mobi)
- Pages
- 405
- Language
- English
- ISBN-10
- 6190009026
- ISBN-13
- 9786190009023
- License
- CC BY-NC-SA
- Book Homepage
- Free eBook, Errata, Code, Solutions, etc.
Contents
Table of Contents
Preface
Video: Book + Video Course Overview
The Book Uses C and Visual Studio
Official Textbook at SoftUni
Who Is This Book Intended for?
Why Did We Choose C ?
Learning Resources: Code + Videos + Exercises + Judge
Programming Is Learned by Writing, Not Reading!
The Software University (SoftUni)
Video: SoftUni and SoftUni Judge
SoftUni: High-Quality Practical Tech Education
Free Programming Courses at SoftUni
The SoftUni Interactive Classroom
The Automated Judge System
How to Become a Software Developer?
Video: Become a Software Engineer – 4 Essential Skills
The 4 Essential Skills of the Software Developers
Skill 1 – Coding (20%)
Skill 2 – Algorithmic Thinking (30%)
Skill 3 – Computer Science and Software Engineering (25%)
Skill 4 – Programming Languages and Technologies (25%)
The Programming Language Doesn't Matter!
More About the Book
Video: Book Authors and Contributors
The Story of This Book
Authors Team
Dr. Svetlin Nakov – The Leading Author
Translators Team
Video Lessons Team
Official Book Web Site
The Book in Other Languages: Java, JavaScript, Python, C++
Udemy Course "Comprehensive Introduction to Programming in C "
License and Distribution
Official Facebook Page of the Book
Discussion Forum for Your Questions
Reporting Bugs
Chapter 1. First Steps in Programming
Video: Chapter Overview
Introduction to Coding by Examples
Computer Programs – Concepts
Video: Computer Programs, Compilers, Interpreters
What It Means "To Program"?
Computer Programs
Algorithms
Languages, Compilers, Interpreters and Environments
Programming Languages
Compilers
Interpreters
Development Environments (IDE)
Runtime Environments, Low-Level and High-Level Languages
Video: Runtime Environments and Programming Languages
Runtime Environments
Programming Languages: Low-Level and High-Level
.NET Runtime Environment
Compilation and Execution of C Programs
Computer Programs – Examples
Video: Computer Programs – Examples
Example: A Program That Plays the Musical Note "A"
Example: A Program That Plays Musical Notes
Example: A Program That Converts USD to EUR
How to Write a Console Application?
Development Environments (IDE) and Visual Studio
Video: Installing and Running Visual Studio
Installing Visual Studio
Older Versions of Visual Studio
Online Development Environments
Project Solutions and Projects in Visual Studio
Example: Creating a Console Application "Hello C "
Video: Console Application in Visual Studio
Console App in Visual Studio: Step by Step
Writing the Program Code
Starting the Program
Testing the Program in the Judge System
How to Register in SoftUni Judge?
Testing the Programs That Play Notes
Typical Mistakes in C Programs
Video: Typical Mistakes in C Programs
Writing Outside if the Main Method
Wrong Letter Capitalization
Missing Semicolon
Missing or Wrong Quotation Mark or Parenthesis
Exercises: First Steps in Coding
Video: Chapter Summary
What We Learned in This Chapter?
The Exercises
Problem: Expression
Video: Problem "Expression"
Hints and Guidelines
Testing in the Judge System
Problem: Numbers from 1 to 20
Video: Problem "Numbers from 1 to 20"
Hints and Guidelines
Testing in the Judge System
Problem: Triangle of 55 Stars
Video: Problem "Triangle of 55 Stars"
Hints and Guidelines
Testing in the Judge System
Problem: Calculate Rectangle Area
Sample Input and Output
Video: Problem "Rectangle Area"
Hints and Guidelines
Test Your Solution
Testing in the Judge System
* Problem: A Square Made of Stars
Sample Input and Output
Video: Problem "Square of Stars"
Hints and Guidelines
Testing in the Judge System
Lab: Graphical and Web Applications
Console, Graphical and Web Applications
Exercises: GUI and Web Applications
Lab: Graphical Application "Summator" (Calculator)
Creating a New C Project
Adding Text Fields and a Button
Resizing the Controls and Starting the Application
Writing the Program Code
Testing the Application
Fixing the Bug and Retesting the Application
Lab: Web Application "Summator" (Calculator)
Creating a New ASP.NET MVC Project
Creating a View (Web Form)
Writing the Program Code
Testing the Web Application
Chapter 2.1. Simple Calculations
Video: Chapter Overview
Introduction to Simple Calculations by Examples
The System Console
Video: The System Console
The System Console Explained
Reading Integers from the Console
Video: Reading Data from the Console
Video: Reading Integers from the Console
Example: Calculating a Square Area
Video: Calculating a Square Area
Code: Calculating a Square Area
Testing in the Judge System
How Does the Example Work?
Data Types and Variables
Video: Data Types and Variables
Examples: Data Types and Variables
Declaring and Using Variables
Video: Declaring and using Variables
Examples: Declaring and using Variables
Reading Floating Point Numbers from the Console
Video: Reading Floating-Point Numbers
Example: Converting Inches into Centimeters
Testing in the Judge System
Reading a Text from the Console
Video: Reading Text from the Console
Example: Greeting by Name
Testing in the Judge System
Printing and Formatting Text and Numbers
Video: Printing Text and Numbers
Example: Printing Text and Numbers
Testing in the Judge System
Using the Dollar String Interpolation
Arithmetic Operations
Video: Arithmetic Operators
Summing up Numbers: Operator +
Subtracting Numbers: Operator -
Multiplying Numbers: Operator *
Dividing Numbers: Operator /
Dividing Integers
Dividing Floating-Point Numbers
Concatenating Text and Numbers
Video: Concatenating Text and Numbers
Examples: Concatenating Text and Numbers
Numerical Expressions
Video: Numerical Expressions
Example: Calculating Trapezoid Area
Testing in the Judge System
Example: Circle Area and Perimeter
Testing in the Judge System
Example: 2D Rectangle Area
Testing in the Judge System
Other Expressions
Exercises: Simple Calculations
Video: Chapter Summary
What We Learned in This Chapter?
The Exercises
Empty (Blank) Visual Studio Solution
Problem: Calculating Square Area
Hints and Guidelines
Testing in the Judge System
Problem: Inches to Centimeters
Hints and Guidelines
Writing Program Code and Starting the Program
Setting Up a Startup Project
Switching Between Programs
Testing a Program Locally
Testing in the Judge System
Problem: Greeting by Name
Hints and Guidelines
Testing in the Judge System
Problem: Concatenating Text and Numbers
Hints and Guidelines
Testing in the Judge System
Problem: Trapezoid Area
Hints and Guidelines
Testing in the Judge System
Problem: Circle Area and Perimeter
Input and Output
Video: Circle Perimeter and Area
Hints and Guidelines
Testing in the Judge System
Problem: Rectangle Area
Sample Input and Output
Video: Rectangle Area
Testing in the Judge System
Problem: Triangle Area
Sample Input and Output
Testing in the Judge System
Problem: Converter – from C Degrees to F Degrees
Sample Input and Output
Testing in the Judge System
Problem: Converter – from Radians to Degrees
Sample Input and Output
Testing in the Judge System
Problem: Converter – USD to BGN
Sample Input and Output
Testing in the Judge System
Problem: * Currency Converter
Sample Input and Output
Testing in the Judge System
Problem: ** Date Calculations – 1000 Days on the Earth
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Lab: GUI Applications with Numerical Expressions
Graphical Application: Converter from BGN to EUR
Video: GUI Converter from BGN to EUR
Creating a New C Project
Adding UI Controls
Events and Event Handlers
Writing the Program Code
Testing the Application
Graphical Application: * Catch the Button!
Hints and Guidelines
Useful Web Sites for C Developers
Chapter 2.2. Simple Calculations – Exam Problems
Simple Calculations – Quick Review
Reading Numbers from the Console
Reading an Integer
Reading a Floating-Point Number
Printing Text Using Placeholders
Arithmetic Operators
Operator +
Operator -
Operator *
Operator /
String Concatenation
Exam Problems
Problem: Training Lab
Input Data
Output Data
Sample Input and Output
Clarification of the Examples
Hints and Guidelines
Idea for Solution
Choosing Data Types
Solution – Variant I
Solution – Variant II
Testing in the Judge System
Problem: Vegetable Market
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Idea for Solution
Choosing Data Types
Solution
Testing in the Judge System
Problem: Change Tiles
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Idea for Solution
Choosing Data Types
Reading the Input Data
Performing the Calculations
Testing in the Judge System
Problem: Money
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Idea for Solution
Choosing Data Types
Solution
Testing in the Judge System
Problem: Daily Earnings
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Idea for Solution
Choosing Data Types
Reading the Input Data
Doing the Calculations
Printing the Result
Testing in the Judge System
Chapter 3.1. Simple Conditions
Video: Chapter Overview
Introduction to Simple Conditions by Examples
Comparing Numbers
Video: Comparing Numbers
Examples for Comparing Numbers
Comparison Operators
Simple If Conditions
Video: Simple If / If-Else Conditions
Example: Excellent Grade
Testing in the Judge System
If-Else Conditions
Example: Excellent Grade or Not
Testing in Judge System
About the Curly Braces {} After If / Else
If-Else Conditions – Examples
Video: Examples of If-Else
Example: Even or Odd Number
Hint and Guidelines
Testing in the Judge System
Example: The Larger Number
Hint and Guidelines
Testing in the Judge System
Variable Scope
Video: Variable Scope
Variable Scope – Example
Sequence of If-Else Conditions
Video: Series of If-Else Checks
Example: Digits in English
Testing in the Judge System
Debugging: Simple Operations with Debugger
Video: Debugging Code in Visual Studio
What is "Debugging"?
Debugging in Visual Studio
Exercises: Simple Conditions
Video: Chapter Summary
What We Learned in This Chapter?
Empty Visual Studio Solution (Blank Solution)
Problem: Excellent Grade
Sample Input and Output
Creating a New C Project
Writing the Program Code
Testing in the Judge System
Problem: Excellent Grade or Not
Sample Input and Output
Creating a New C Project and Writing the Code
Automatic Switching to the Current Project
Local Execution and Testing
Testing in the Judge System
Problem: Even or Odd
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Finding the Greater Number
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Typing a Digit in Words
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Bonus Score
Sample Input and Output
Video: Bonus Score
Hints and Guidelines
Testing in the Judge System
Problem: Guess the Password
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Summing Up Seconds
Sample Input and Output
Video: Summing Up Seconds
Hints and Guidelines
Testing in the Judge System
Problem: Metric Converter
Sample Input and Output
Video: Metric Converter
Hints and Guidelines
Testing in the Judge System
Problem: Numbers from 100 to 200
Sample Input and Output
Testing in the Judge System
Problem: Identical Words
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Speed Assessment
Sample Input and Output
Testing in the Judge System
Problem: Areas of Figures
Sample Input and Output
Testing in the Judge System
Problem: Time + 15 Minutes
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Equal 3 Numbers
Sample Input and Output
Testing in the Judge System
Problem: * Numbers from 0 to 100 as English Words
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Lab: GUI (Desktop) Application – Currency Converter
Video: Building a GUI App "Currency Converter"
Creating a New C Project and Adding Controls
Configuring the UI Controls
Events and Event Handlers
Writing the Program Code
Chapter 3.2. Simple Conditions – Exam Problems
Simple Conditions – Quick Review
Problem: Transportation Price
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Processing the Input Data
Calculating Taxi Rate
Calculating Transportation Price
Printing the Output Data
Testing in the Judge System
Problem: Pipes in Pool
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Processing the Input Data
Checking the Conditions and Processing Output Data
Testing in the Judge System
Problem: Sleepy Tom Cat
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Reading the Input Data
Calculating Working Days
Calculating Playing Time
Checking the Conditions
Processing the Output Data
Testing in the Judge System
Problem: Harvest
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Processing the Input Data
Performing the Calculations
Checking the Conditions and Printing the Output
Testing in the Judge System
Problem: Firm
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Reading the Input Data
Auxiliary Calculations
Checking the Conditions and Printing Output Data
Testing in the Judge System
Chapter 4.1. More Complex Conditions
Video: Chapter Overview
Introduction to Complex Conditions by Examples
Nested If-Else Conditions
The Nested If-Else Construction
Video: Nested Conditional Statements
Deep Nesting
Nested If-Else Conditions – Examples
Example: Personal Titles
Sample Input and Output
Video: Personal Titles
Solution
Testing in the Judge System
Example: Small Shop
Sample Input and Output
Video: Small Shop
Solution
Testing in the Judge System
More Complex Conditions
Logical "AND", "OR" and "NOT"
The Parenthesis () Operator
Logical "AND"
Video: Logical "AND"
How the && Operator Works?
Example: Point in a Rectangle
Sample Input and Output
Solution
Testing in the Judge System
Logical "OR"
Video: Logical "OR"
How the || Operator Works?
Example: Fruit or Vegetable
Sample Input and Output
Solution
Testing in the Judge System
Logical Negation (NOT)
Video: Logical "NOT"
Example: Invalid Number
Sample Input and Output
Solution
Testing in the Judge System
More Complex Conditions – Examples
Example: Point on a Rectangle Border
Sample Input and Output
Solution
Testing in the Judge System
Example: Fruit Shop
Video: Fruit Store
Sample Input and Output
Solution
Testing in the Judge System
Example: Trade Fees
Sample Input and Output
Video: Trade Fees
Solution
Testing in the Judge System
Switch-Case Conditional Statement
Video: Switch-Case
Example: Day of the Week
Sample Input and Output
Solution
Testing in the Judge System
Multiple Labels in Switch-Cases
Example: Animal Type
Sample Input and Output
Solution
Testing in the Judge System
Exercises: More Complex Conditions
Video: Chapter Summary
What We Learned in This Chapter?
Nested Conditions
Complex Conditions with &&, ||, ! and ()
Switch-Case Statements
Problem: Cinema
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Volleyball
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: * Point in the Figure
Sample Input and Output
Hints and Guidelines
Implementation of the Proposed Idea
Testing in the Judge System
Lab: * GUI (Desktop) Application: Point and Rectangle
Creating a New C Project and Adding Controls
Configuring the UI Controls
Handling Events
Printing Point Position Compared to the Rectangle
Visualization of the Rectangle and the Point
Compiling and Testing the Application
Chapter 4.2. More Complex Conditions – Exam Problems
More Complex Conditions – Quick Review
Nested Conditions
Switch-Case Conditions
Problem: On Time for the Exam
Sample Input and Output
Input Data
Output Data
Hints and Guidelines
Processing the Input Data
Calculating Exam Start Time and Student Arrival Time
Checking If the Student Arrived on Time or Late
Calculating Time Difference
Printing the Result
Testing in the Judge System
Problem: Trip
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Processing the Input Data
Calculations
Printing the Result
Testing in the Judge System
Problem: Operations with Numbers
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Processing the Input Data
Condition for 0
Condition for Division and Modular Division
Condition for Sum, Subtract and Multiply
Using Ternary Operator
Printing the Output
Testing in the Judge System
Problem: Game Tickets
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Processing the Input Data
Calculating Transportation Costs
Calculating Ticket Costs
Calculating Total Costs
Printing the Result
Testing in the Judge System
Problem: Hotel Room
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Processing the Input Data
Creating Helper Variables
Calculating Prices for May and October
Calculating Prices for June, September, July and August
Formatting the Output Data
Printing the Result
Testing in the Judge System
Chapter 5.1. Loops (Repetitions)
Video: Chapter Overview
Introduction to Simple Loops by Examples
For Loops (Repeating Code Blocks)
Video: Simple For-Loops
Syntax: For-Loop
Example: Numbers from 1 to 100
Video: Numbers 1...100
Hints and Guidelines
Testing in the Judge System
Example: Numbers up to 1000, Ending by 7
Video: Numbers 1...1000 Ending by 7
Hints and Guidelines
Testing in the Judge System
Example: All Latin Letters
Video: Latin Letters
Hints and Guidelines
Testing in the Judge System
Code Snippet for the for Loop in Visual Studio
Exercises: Loops (Repetitions)
Video: Chapter Summary
What We Learned in This Chapter?
Blank Solution in Visual Studio
Problem: Summing up Numbers
Sample Input and Output
Video: Summing Numbers
Hints and Guidelines
Testing in the Judge System
Problem: Max Number
Sample Input and Output
Video: Largest Number
Hints and Guidelines
Testing in the Judge System
Problem: Min Number
Video: Smallest Number
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Left and Right Sum
Sample Input and Output
Video: Left and Right Sum
Hints and Guidelines
Testing in the Judge System
Problem: Even / Odd Sum
Sample Input and Output
Video: Even / Odd Sum
Hints and Guidelines
Testing in the Judge System
Problem: Sum of Vowels
Sample Input and Output
Video: Sum of Vowels
Hints and Guidelines
Testing in the Judge System
Problem: Element Equal to the Sum of the Rest
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Even / Odd Positions
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Equal Pairs
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Lab: Turtle Graphics GUI Application
Video: Turtle Graphics
What Shall We Build?
Turtle Graphics – Concepts
Creating a New C Project
Installing Turtle Graphics NuGet Package
Adding the Buttons
Implementing the [Draw] Button
Testing the Application
Adding Complexity to the Turtle Drawing Code
Implementing the [Reset] Button
Implementing the [Show / Hide Turtle] Buttons
Exercises: Turtle Graphics
Problem: * Draw a Hexagon with the Turtle
Problem: * Draw a Star with the Turtle
Problem: * Draw a Spiral with the Turtle
Problem: * Draw a Sun with the Turtle
Problem: * Draw a Spiral Triangle with the Turtle
Chapter 5.2. Loops – Exam Problems
For Loops – Quick Review
Problem: Histogram
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Reading the Input Data
Distributing Numbers in Groups
Calculating Percentages
Printing the Output
Testing in the Judge System
Problem: Smart Lilly
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Reading the Input Data
Creating Helper Variables
Calculating Savings
Formatting and Printing the Output
Testing in the Judge System
Problem: Back to the Past
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Reading the Input Data
Iterating through the Years
Checking for Enough Heritage and Printing the Output
Testing in the Judge System
Problem: Hospital
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Reading the Input Data
Calculating the Treated and Untreated Patients
Testing in the Judge System
Problem: Division without Remainder
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Logistics
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Chapter 6.1. Nested Loops
Video: Chapter Overview
Introduction to Nested Loops by Examples
Nested Loops – Concepts
Video: Nested Loops
Nested Loops – Examples
Example: Rectangle Made of 10 x 10 Stars
Video: Rectangle of 10 x 10 Stars
Hints and Guidelines
Testing in the Judge System
Example: Rectangle Made of N x N Stars
Video: Rectangle of N x N Stars
Hints and Guidelines
Testing in the Judge System
Examples: Square Made of Stars
Hints and Guidelines
Testing in the Judge System
Example: Triangle Made of Dollars
Video: Triangle of Dollars
Hints and Guidelines
Testing in the Judge System
Example: Square Frame
Video: Square Frame
Hints and Guidelines
Testing in the Judge System
Exercises: Drawing Figures
Video: Chapter Summary
What We Learned in This Chapter?
Problem: Rhombus Made of Stars
Video: Rhombus of Stars
Hints and Guidelines
Testing in the Judge System
Problem: Christmas Tree
Video: Christmas Tree
Hints and Guidelines
Testing in the Judge System
Problem: Sunglasses
Video: Sunglasses
Hints and Guidelines
Printing the Top and Bottom Rows
Printing the Middle Rows
Testing in the Judge System
Problem: House
Video: Draw a House
Hints and Guidelines
The Roof
The Base
Reading the Input Data
Calculating Roof Length
Printing the Roof
Printing the Base
Testing in the Judge System
Problem: Diamond
Video: Draw a Diamond
Hints and Guidelines
Upper Part
Lower Part
Upper and Lower Parts of the Diamond
Reading the Input Data
Printing the Top Part of the Diamond
Printing the Bottom Part of the Diamond
Testing in the Judge System
Lab: Drawing Ratings in Web
Video: Building a Web App "Draw Ratings"
Ratings – Visualization in a Web Environment
Creating a New C Project
Creating a View Holding a HTML Form
Adding the DrawRatings(int) Method
Adding Star Images
Starting and Testing the Project
Chapter 6.2. Nested Loops – Exam Problems
Nested Loops – Quick Review
Problem: Drawing a Fort
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Reading the Input Data
Calculating and Printing the Roof
Printing the Body of the Fort
Printing the Base of the Fort
Testing in the Judge System
Problem: Butterfly
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Divide the Figure into Parts
Printing the Body and the Lower Wing
Testing in the Judge System
Problem: "Stop" Sign
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Divide the Figure into Parts
Printing the Upper Part of the Sign
Printing the Middle Row and the Lower Part
Testing in the Judge System
Problem: Arrow
Sample Input and Output
Input Data
Output Data
Hints and Guidelines
Divide the Figure into Parts
Printing the Body and the Middle Row
Printing the Lower Part of the Arrow
Testing in the Judge System
Problem: Axe
Sample Input and Output
Input Data
Output Data
Hints and Guidelines
Divide the Figure into Parts
Printing the Handle
Printing the Lower Part of the Axe
Testing in the Judge System
Chapter 7.1. More Complex Loops
Video: Chapter Overview
Introduction to More Complex Loops by Examples
For Loop with Step
Video: Loop with a Step
Loop with a Step – Explanation
Example: Numbers 1...N with Step 3
Testing in the Judge System
Example: Numbers N...1 in Reverse Order
Video: Numbers N...1
Hints and Guidelines
Testing in the Judge System
Example: Numbers from 1 to 2^n with a For Loop
Video: Numbers 1 ... 2^n
Hints and Guidelines
Testing in the Judge System
Example: Even Powers of 2
Video: Even Powers of 2
Hints and Guidelines
Testing in the Judge System
While Loop
Video: While Loop
While Loop – Explanation
Example: Sequence of Numbers 2k+1
Testing in the Judge System
Example: Number in Range [1…100]
Video: Numbers in the Range [1…100]
Hints and Guidelines
Testing in the Judge System
Greatest Common Divisor (GCD)
Video: Greatest Common Divisor (GCD)
The Euclidean Algorithm
Example: Greatest Common Divisor (GCD)
Testing in the Judge System
Do-While Loop
Video: Do-While Loop
Example: Calculating Factorial
Testing in the Judge System
Example: Summing Up Digits
Video: Sum of Digits
Hints and Guidelines
Testing in the Judge System
Infinite Loops with Break
Video: Infinite Loops with Break
Infinite Loop – Explanation
The Operator "Break"
Example: Prime Number Checking
Video: Prime Number Checking
Hints and Guidelines
Prime Checking Algorithm
Implementation of the Prime Checking Algorithm
Testing in the Judge System
Example: Enter an Even Number
Hints and Guidelines
Implementation
Testing in the Judge System
Nested Loops and Break
Wrong Implementation
Correct Implementation
Testing in the Judge System
Handling Errors: Try-Catch
Video: Using Try-Catch
What is Try-Catch?
The Try-Catch Construction
Example: Dealing with Invalid Numbers with Try-Catch
Enter Even Number – Implementation
Testing in the Judge System
Exercises: More Complex Loops
Video: Chapter Summary
What We Learned in This Chapter?
Problem: Fibonacci Numbers
Sample Input and Output
Video: Fibonacci Numbers
Hints and Guidelines
Testing in the Judge System
Problem: Numbers Pyramid
Sample Input and Output
Video: Pyramid of Numbers
Hints and Guidelines
Implementation of the Idea
Testing in the Judge System
Problem: Numbers Table
Sample Input and Output
Video: Table with Numbers
Hints and Guidelines
Implementation of the Idea
Testing in the Judge System
Lab: Web Application with Complex Loops
Problem: Web Application "Fruits Game"
Video: Fruits Game – ASP.NET MVC Web App
Fruits Game Explained
Create New C Project
Create Controls
Prepare Fruits for the View
Generate Random Fruits
Add Game Images
Visualize Fruits
Change Text in Layout
Test the Application
Shooting the Fruits
Implement the "Fire" Method
Test the Application Again
Implement "Game Over"
Final Testing of the Application
Chapter 7.2. More Complex Loops – Exam Problems
More Complex Loops – Quick Review
Problem: Dumb Passwords Generator
Sample Input and Output
Input Data
Output Data
Hints and Guidelines
Reading the Input Data
Processing the Input Data and Printing Output
Testing in the Judge System
Did you Know That…?
Problem: Magic Numbers
Input Data
Output Data
Sample Input and Output
Solution using a "For" Loop
Solution using a "While" Loop
Writing a While Loop
Infinite While Loop
Testing in the Judge System
Problem: Stop Number
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Special Numbers
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Digits
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Chapter 8.1. Practical Exam Preparation – Part I
Video: Chapter Overview
The "Programming Basics" Practical Exam
Video: The Practical Exam Explained
The Online Evaluation System (Judge)
Simple Calculations – Problems
Problem: Triangle Area
Video: Triangle Area
Problem Description
Input
Output
Sample Input and Output
Reading the Input Data
Calculate Triangle Side and Height
Calculate and Print Triangle Area
Testing in the Judge System
Problem: Moving Bricks
Video: Moving Bricks
Problem Description
Input
Output
Sample Input and Output
Reading the Input Data
Calculating Bricks per Course
Calculating and Printing the Needed Courses
Testing in the Judge System
Simple Conditions – Problems
Problem: Point on a Segment
Video: Point on a Segment
Problem Description
Input
Output
Sample Input and Output
Reading the Input Data
Calculate the Minimum Distance to the Closest End
Determining if Point is in or Out the Segment
Testing in the Judge System
Problem: Point in a Figure
Video: Point in a Figure
Problem Description
Input
Output
Sample Input and Output
Hints and Guidelines
Determining the Point Location
Testing in the Judge System
Complex Conditions – Problems
Problem: Date After 5 Days
Video: Date After 5 Days
Problem Description
Input
Output
Sample Input and Output
Reading and Processing the Input Data
Adding 5 Days
Printing the Result
Testing in the Judge System
Problem: Sums of 3 Numbers
Video: Sum of 3 Numbers
Problem Description
Input
Output
Sample Input and Output
Reading the Input Data
Composing a Template for the Solution
Writing Code in the Template
Testing in the Judge System
Simple Loops – Problems
Problem: Sums with Step of 3
Video: Sums with Step of 3
Problem Description
Input
Output
Sample Input and Output
Reading the Input Data
Allocating Numbers and Printing Results
Testing in the Judge System
Problem: Sequence of Increasing Elements
Video: Sequence of Increasing Elements
Problem Description
Input
Output
Sample Input and Output
Reading the Input Data and Creating Working Variables
Determining Increasing Sequence
Finding and Printing the Longest Sequence
Testing in the Judge System
Drawing Figures – Problems
Problem: Perfect Diamond
Video: Perfect Diamond
Problem Description
Input
Output
Sample Input and Output
Hints and Guidelines
Reading the Input Data
Printing the Top Part of the Diamond
Printing the Bottom Part of the Diamond
Testing in the Judge System
Problem: Rectangle with Stars in the Center
Video: Rectangle with Stars in the Center
Problem Description
Input
Output
Sample Input and Output
Reading the Input Data
Printing the First and the Last Rows
Printing the Middle Rows
Adding Stars in the Center of the Rectangle
Testing in the Judge System
Nested Loops – Problems
Problem: Increasing 4 Numbers
Video: Increasing 4 Numbers
Problem Description
Sample Input and Output
Input
Output
Reading the Input Data
Implementation with 2 Numbers
Implementation with 4 Numbers
Testing in the Judge System
Problem: Generating Rectangles
Video: Generating Rectangles
Problem Description
Sample Input and Output
Input
Output
Reading the Input Data
Sample Idea for the Solution
Calculating the Rectangle Area and Printing the Output
Testing in the Judge System
Practical Exam Preparation – Summary
Video: Chapter Summary
Chapter 8.2. Practical Exam Preparation – Part II
Types of Exam Problems
Problem: Distance
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Reading the Input Data
Selecting Data Type for Calculations
Converting the Input Data
Helper Variable
Calculating Travel Distance
Calculating and Printing the Output
Testing in the Judge System
Problem: Changing Tiles
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Flowers Shop
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Separating the Constant Values in Variables
Reading the Input Data
Preparing the Program Logic
Testing in the Judge System
Problem: Grades
Input Data
Output Data
Sample Input and Output
Hints and Guidelines
Reading the Input Data and Creating Helper Variables
Allocating Students into Groups
Testing in the Judge System
Problem: Christmas Hat
Input Data
Output Data
Sample Input and Output
Problem Analysis
Drawing the Dynamic Part of the Figure
Testing in the Judge System
Problem: Letters Combination
Sample Input and Output
Input Data
Output Data
Reading the Input Data
Printing All Characters from Start to End
Printing Combination of 3 Characters
Testing in the Judge System
Chapter 9.1. Problems for Champions – Part I
More Complex Problems on the Studied Material
Problem: Crossing Sequences
Example
Input Data
Output Data
Constraints
Sample Input and Output
Hints and Guidelines
Processing the Input
Generating Tribonacci Sequence
Generating Numerical Spiral
Finding Common Number for the Sequences
Alternative Solution
Testing in the Judge System
Problem: Magic Dates
Sample Input and Output
Input Data
Output Data
Constraints
Hints and Guidelines
Loop through Dates
Calculating Date Weight
Printing the Output
Testing in the Judge System
Problem: Five Special Letters
Input Data
Output Data
Constraints
Sample Input and Output
Hints and Guidelines
Reading the Input Data
Generating All Combinations
Transforming Combinations into Words
Removing Repetitive Letters
Calculating Weight
Preparing the Output
Final Touches
Testing in the Judge System
Chapter 9.2. Problems for Champions – Part II
More Complex Problems on the Studied Material
Problem: Passion Shopping Days
Input Data
Output Data
Constraints
Sample Input and Output
Hints and Guidelines
Processing the Input Data
Algorithm for Solving the Problem
Processing Command Symbols
Formatting the Output
Testing in the Judge System
Problem: Numerical Expression
Example
Input Data
Output Data
Constraints
Sample Input and Output
Hints and Guidelines
Reading the Input Data
Creating Helper Variables
Defining the Program Structure
Implementing the Proposed Idea
Calculating the Sub-Expression Value
Formatting the Output
Testing in the Judge System
Problem: Bulls and Cows
Input Data
Output Data
Constraints
Sample Input and Output
Hints and Guidelines
Reading the Input Data
Declaring a Flag
Generating Four-Digit Numbers
Creating Additional Variables
Counting the Bulls
Counting the Cows
Printing the Output
Testing in the Judge System
Chapter 10. Methods
Introduction by Examples
What Is a "Method"?
Simple Methods
Why Use Methods?
Declaring Methods
Calling Methods
Example: Blank Receipt
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Methods with Parameters
Using Parameters in Methods
Example: Sign of an Integer
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Optional Parameters
Example: Printing a Triangle
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Example: Draw a Filled Square
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Returning a Result from a Method
Types of Returned Values
The "Return" Operator
The "Return" Operator – Example
The Code After "Return" is Inaccessible
Using the Returned Value
Example: Calculating Triangle Area
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Example: Math Power
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Methods Returning Multiple Values
Declaring a ValueTuple
Method Returning Multiple Values
Method Overloading
Method Signature
Overloading Methods in C Programs
Signature and Return Value Type
Example: Greater of Two Values
Sample Input and Output
Creating the Methods
Reading the Input Data and Using the Methods
Testing in the Judge System
Nested Methods (Local Functions)
What Is a Local Function?
Why Use Local Functions?
Declaring Local Functions
Naming Methods
Naming Method Parameters
Good Practices When Working with Methods
Code Structure and Formatting
Exercises: Methods
What We Learned in This Chapter?
Defining a Method
Invoking a Method
Problem: "Hello, Name!"
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Min Method - Return the Smaller Number
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: String Repeater
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Nth Digit
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Integer to Base
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Notifications
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: Numbers to Words
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Problem: String Encryption
Sample Input and Output
Hints and Guidelines
Testing in the Judge System
Chapter 11. Tricks and Hacks
Code Formatting
The Official C Code Conventions
Code Formatting Shortcuts in Visual Studio
Naming Code Elements
Naming Projects and Files
Naming Variables
Naming – Examples
Shortcuts in Visual Studio
Code Snippets in Visual Studio
Exploring the Existing Code Snippets for C
Changing an Existing Snippet
Saving and Testing the Code Snippet
Code Debugging Techniques
Debugging in Visual Studio
Starting the Program in Debug Mode
Tricks for C Developers
Inserting Variable Values in Strings
Formatting with 2 Digits After the Decimal Point
Rounding Numbers
Other Rounding Methods
Rounding with a Placeholder
How to Write a Conditional Statement?
How to Write a 'For' Loop?
What We Learned in This Chapter?
Conclusion
Developer Skills
This Book is Only the First Step!
How to Proceed After This Book?
Study Software Engineering in SoftUni
Training Duration in SoftUni
Becoming a Programmer Takes at Least a Year!
The Entrance Exam in SoftUni
The SoftUni Curriculum for Software Engineers
How Many Hours per Day Does the Training Take?
SoftUni for People Who Work and Study
Study Software Engineering in Your Own Way
Recommended Resources for Developers
Online Communities for Beginners in Programming
Good Luck to All!