Skip to content

SofiyaGit/Introduction-to-Programming

Repository files navigation

Homework: Introduction to Programming

Problem 1. Play with Visual Studio

  • Install Visual Studio on your laptop or home computer. Go to the official Visual Studio site and download the Community 2013 with Update 4 version.
  • Start Visual Studio and familiarize yourself with it. Create a simple C# program (console application), compile and run it.

You do not have to submit anything in your homework for this problem.

Problem 2. Blank Solution in Visual Studio

  • Create a blank solution in Visual Studio called “Intro-Programming-Homework”. This solution will hold all your homework projects, code and files. For each problem (exercises) add a separate project with self-descriptive name like “Hello-World” and “Print-Your-Name”.

    You do not have to submit anything in your homework for this problem.

Problem 3. Play with MSDN Library

  • Play with Microsoft Developer Network (MSDN) Library Documentation.
    • Find information about Console.WriteLine() method in MSDN.
    • Find information about the Console class.
    • Find information about the class keyword.

You do not have to submit anything in your homework for this problem.

Problem 4. Hello World

  • Create, compile and run a “Hello C#” console application.
  • Ensure you have named the application well (e.g. “”HelloCSharp”).

You should submit the Visual Studio project holding the HelloCSharp class as part of your homework.

Problem 5. Print Your Name

  • Modify the previous application to print your name.
  • Ensure you have named the application well (e.g. “PrintMyName”).

You should submit a separate project Visual Studio project holding the PrintMyName class as part of your homework.

Problem 6. Print Numbers

  • Write a program to print the numbers 1, 101 and 1001, each at a separate line.
  • Name the program correctly.

You should submit in your homework the Visual Studio project holding the source code of the PrintNumbers program.

Problem 7. Print First and Last Name

  • Create console application that prints your first and last name, each at a separate line.

Problem 8. Square Root

  • Create a console application that calculates and prints the square root of the number 12345.
  • Find in Internet “how to calculate square root in C#”.

Problem 9. Print a Sequence

  • Write a program that prints the first 10 members of the sequence: 2, -3, 4, -5, 6, -7, ...

Problem 10. Reformat C# Code

  • Reformat the following C# code to make it readable according to the C# best practices for code formatting. Change the casing of the identifiers in the code (e.g. use PascalCase for the class name): HorribleCode.cs
using

System;

class hoRRiblEcoDe
{
	static
	 void

		Main()
	{
		Console.

	WriteLine("Hi, I am horribly formatted program"
); Console.
	  WriteLine("Numbers and squares:")
; for (int i = 0;
i < 10;
i++)
		{
			Console.WriteLine(i +
				" --> " + i
				*
				i);
		}
	}
}

Problem 11. Programming Languages

  • Perform a research (e.g. in Google or Wikipedia) and provide a short list with information about the most popular programming languages. How similar are they to C#? How do they differ from C#?
  • Write in a text file called “programming-languages.txt” at least five languages along with 2-3 sentences about each of them. Use English.

Problem 12. Development Environments

  • Perform a research (e.g. in Google or Wikipedia) and provide a short list with popular development environments (IDEs) like Visual Studio.
  • Write in a text file called “list-of-IDEs.txt” at least five IDEs along with 2-3 sentences about each of them. Use English.

Problem 13. C# and .NET Differences

  • Describe the difference between C# and .NET Framework in 2-3 sentences.
  • Write your description in a text file called “csharp-and-dot-net-framework.txt”. Use English.

Problem 14.* Current Date and Time

  • Create a console application that prints the current date and time. Find out how in Internet.

Problem 15.* Age after 10 Years

  • Write a program to read your birthday from the console and print how old you are now and how old you will be after 10 years.

Problem 16.* Print Long Sequence

  • Write a program that prints the first 1000 members of the sequence: 2, -3, 4, -5, 6, -7, …
  • You might need to learn how to use loops in C# (search in Internet).

Problem 17.* Play with the Debugger in Visual Studio

  • Write a program that prints at the console the numbers from 1 to 1000, each at a separate line.
  • You might need to learn how to use loops (search in Internet).
  • Set a breakpoint in the line, which prints the next number in the Visual Studio code editor. Run the program through the debugger using the [F5] key. When the debugger stops at the breakpoint trace the code execution with [F10] key.

You do not have to submit anything in your homework for this problem. Just play with the debugger to learn how it works.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages