Lab - 1. Solution : 1. // Building a Simple Console Application. class HelloCsharp. static void Main() System.Console.WriteLine ("Hello from C#.

Size: px
Start display at page:

Download "Lab - 1. Solution : 1. // Building a Simple Console Application. class HelloCsharp. static void Main() System.Console.WriteLine ("Hello from C#."

Transcription

1 Lab - 1 Solution : 1 // Building a Simple Console Application class HelloCsharp static void Main() System.Console.WriteLine ("Hello from C#."); Solution: 2 & 3 // Building a WPF Application // Verifying the Application Open Visual Studio 2008 and choose "File", "New", "Project..." in the main menu. Choose "WPF Application" as project type. Choose a folder for your project and give it a name. Then press "OK"

2 Visual Studio creates the project and automatically adds some files to the solution. A Window1.xaml and an App.xaml. The structure looks quite similar to WinForms, except that the Window1.designer.cs file is no longer code but it's now declared in XAML as Window1.xaml/MainWindow.xaml Open the Window1.xaml/MainWindow.xaml file in the WPF designer and drag a Button and a TextBox from the toolbox to the Window Select the Button and switch to the event view in the properties window (click on the little yellow lightning icon). Doubleclick on the "Click" event to create a method in the codebehind that is called, when the user clicks on the button.

3 Visual Studio automatically creates a method in the code-behind file that gets called when the button is clicked. private void button1_click(object sender, RoutedEventArgs e) textbox1.text = "Hello WPF"; The textbox has automatically become assigned the name textbox1 by the WPF designer. Set text Text to "Hello WPF!" when the button gets clicked and we are done! Start the application by hit [F5] on your keyboard.

4 Solution : 4 // Generating Documentation for an Application namespace Hello /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window public MainWindow() InitializeComponent(); private void button1_click(object sender, RoutedEventArgs e) textbox1.text = "Hello WPF";

5 Solution: 1 Lab - 2 // Calculating Square Roots with Improved Accuracy public static int Isqrt(int num) if (0 == num) return 0; // Avoid zero divide int n = (num / 2) + 1; // Initial estimate, never low int n1 = (n + (num / n)) / 2; while (n1 < n) n = n1; n1 = (n + (num / n)) / 2; // end while return n; // end Isqrt() Solution: 2 // Converting Integer Numeric Data to Binary namespace ConsoleApplication1 class Program static void Main(string[] args) Console.Write("Number: "); int datanumber = int.parse(console.readline()); int remainder; string result = string.empty;

6 while (datanumber > 0) remainder = datanumber % 2; datanumber /= 2; result = remainder.tostring() + result; Console.WriteLine("Binary: 0", result); Console.ReadKey();

7 Lab - 3 Solution: 1 //Calculating the Greatest Common Divisor of Two Integers by Using Euclid's Algorithm namespace ConsoleApplication1 class Program static void Main(string[] args) Console.WriteLine("GCD of 0 and 1 is 2", 1, 1, gcd(1, 1)); Console.WriteLine("GCD of 0 and 1 is 2", 1, 10, gcd(1, 10)); Console.WriteLine("GCD of 0 and 1 is 2", 10, 100, gcd(10, 100)); Console.WriteLine("GCD of 0 and 1 is 2", 5, 50, gcd(5, 50)); Console.WriteLine("GCD of 0 and 1 is 2", 8, 24, gcd(8, 24)); Console.WriteLine("GCD of 0 and 1 is 2", 36, 17, gcd(36, 17)); Console.WriteLine("GCD of 0 and 1 is 2", 36, 18, gcd(36, 18)); Console.WriteLine("GCD of 0 and 1 is 2", 36, 19, gcd(36, 19)); for (int x = 1; x < 36; x++) Console.WriteLine("GCD of 0 and 1 is 2", 36, x, gcd(36, x)); Console.Read(); private static int gcd(int a, int b) int t;

8 // Ensure B > A if (a > b) t = b; b = a; a = t; // Find while (b!= 0) t = a % b; a = b; b = t; return a;

9 Solution: 2 // Calculating the GCD of Three, Four, or Five Integers namespace ConsoleApplication1 class Program static void Main() Console.WriteLine(GCD(new[] 10, 15, 30, 45 )); Console.ReadKey(); static int GCD(int a, int b) return b == 0? a : GCD(b, a % b); static int GCD(int[] integerset) return integerset.aggregate(gcd);

10 Lab - 4 Solution: 1 // Find the second largest element namespace ConsoleApplication1 class Program static void Main() int[] myarray = new int[] 0, 1, 2, 3, 13, 8, 5 ; int largest = int.minvalue; int second = int.minvalue; foreach (int i in myarray) if (i > largest) second = largest; largest = i; else if (i > second) second = i; System.Console.WriteLine(second); Console.ReadKey(); Solution: 2 // Multiplying Matrices namespace ConsoleApplication1 class Program static void Main(string[] args) int i, j;

11 int[,] a = new int[2, 2]; Console.WriteLine("Enter no for 2*2 matrix"); for (i = 0; i < 2; i++) for (j = 0; j < 2; j++) a[i, j] = int.parse(console.readline()); Console.WriteLine("First matrix is:"); for (i = 0; i < 2; i++) for (j = 0; j < 2; j++) Console.Write(a[i, j] + "\t"); Console.WriteLine(); int[,] b = new int[2, 2]; Console.WriteLine("Enter no for 2*2 matrix"); for (i = 0; i < 2; i++) for (j = 0; j < 2; j++) b[i, j] = int.parse(console.readline());

12 Console.WriteLine("second matrix is:"); for (i = 0; i < 2; i++) for (j = 0; j < 2; j++) Console.Write(b[i, j] + "\t"); Console.WriteLine(); Console.WriteLine("Matrix multiplication is:"); int[,] c = new int[2, 2]; for (i = 0; i < 2; i++) for (j = 0; j < 2; j++) c[i, j] = 0; for (int k = 0; k < 2; k++) c[i, j] += a[i, k] * b[k, j]; for (i = 0; i < 2; i++) for (j = 0; j < 2; j++)

13 Console.Write(c[i, j] + "\t"); Console.WriteLine(); Console.ReadKey(); Solution: 3 //Find sum of all the elements present in a jagged array of 3 inner arrays namespace ConsoleApplication1 class Program int[][] jagged = new int[3][]; public void ReadArrays() Console.Write("\n Enter the size of First inner array: "); jagged[0] = new int[int.parse(console.readline())]; Console.WriteLine("\n Enter the elements of First inner array: "); for (int i = 0; i < jagged[0].length; i++) jagged[0][i] = int.parse(console.readline());

14 Console.Write("\n Enter the size of Second inner array: "); jagged[1] = new int[int.parse(console.readline())]; Console.WriteLine("\n Enter the elements of Second inner array: "); for (int i = 0; i < jagged[1].length; i++) jagged[1][i] = int.parse(console.readline()); Console.Write("\n Enter the size of Third inner array: "); jagged[2] = new int[int.parse(console.readline())]; Console.WriteLine("\n Enter the elements of Third inner array: "); for (int i = 0; i < jagged[2].length; i++) jagged[2][i] = int.parse(console.readline()); public void FindSum() int sum = 0; for (int i = 0; i < jagged[0].length; i++) sum = sum + jagged[0][i]; for (int i = 0; i < jagged[1].length; i++) sum = sum + jagged[1][i]; for (int i = 0; i < jagged[2].length; i++) sum = sum + jagged[2][i]; Console.WriteLine("\n\n\n Sum of all the three inner arrays is = 0", sum); public void PrintArrays() Console.Write("\n\n Elements of First inner array: "); for (int i = 0; i < jagged[0].length; i++)

15 Console.Write(jagged[0][i] + "\t"); Console.Write("\n\n Elements of Second inner array: "); for (int i = 0; i < jagged[1].length; i++) Console.Write(jagged[1][i] + "\t"); Console.Write("\n\n Elements of Third inner array: "); for (int i = 0; i < jagged[2].length; i++) Console.Write(jagged[2][i] + "\t"); class ArrayTest public static void Main() Program JA = new Program(); JA.ReadArrays(); JA.PrintArrays(); JA.FindSum(); Console.ReadLine();

16 Lab - 5 Q) Write a C# program with a class named Animal, make the animal class as Base class and Inheritance Animal class properties in Dog class and Cat class? Animal Class using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace AnimalIh class Animal public void sleep() Console.WriteLine("Sleeping"); public void eating() Console.WriteLine("Eating");

17 Cat Class using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace AnimalIh class Cat:Animal public void meow() Console.WriteLine("Meow Meowwwwwwwww"); Dog Class using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace AnimalIh class Dog:Animal public void bark() Console.WriteLine("Whof Whof Whof Whof"); InheritanceEx Class using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Animal class InheritanceEx public static void Main(string[] args) Dog d = new Dog(); d.sleep();

18 d.bark(); Cat c = new Cat(); c.eating(); c.meow(); Console.ReadKey(); Procedure: 1. Create a New C# Console Application Project and Name it as AnimalIh. 2. By default you will get a class Named Program.cs with the Namespace AnimalIh 3. Rename Program.cs to Animal.cs and Click Yes button. 4. Write the Animal Class code inside it. 5. Goto Solution Explorer do right click on AnimalIh a drop down menu appears. 6. Select Add option you will get a submenu form that select class and name it as Cat.cs 7. Write the Cat Class code inside it. 8. Goto Solution Explorer do right click on AnimalIh a drop down menu appears. 9. Select Add option you will get a submenu form that select class and name it as Dog.cs 10. Write the Dog Class code inside it. 11. Goto Solution Explorer do right click on AnimalIh a drop down menu appears. 12. Select Add option you will get a submenu form that select class and name it as InheritanceEx.cs 13. Write the InheritanceEx Class code inside it. Save the solution and Run Debug button to get the below code. OUTPUT:

19 Lab - 6 Q1) Write a C# program to Generate Random Number using C# Console Application? Constructor without Parameters: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; namespace RandomNumberGeneration class RandomNG static void Main(string[] args) Random r = new Random(); // Constructor without parameters int a = r.next(1000); string result = Convert.ToString(a); MessageBox.Show(result); OUTPUT:

20 Q2) Write a C# program to Generate Day, using C# Console Application? Constructor with Parameters: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; namespace DateTimeEx class DateAndTime static void Main(string[] args) DateTime dt = new DateTime(2013, 11, 21);// Constructor with parameters int iday = dt.day; int imonth = dt.month; int iyear = dt.year; Console.WriteLine("MID-2 Exam Date:0-1-2",iday,imonth,iyear); // To Get Current Day Month and Year string Day = DateTime.Now.ToString("dd"); string Month = DateTime.Now.ToString("mm"); string Year = DateTime.Now.ToString("yyyy"); MessageBox.Show("Todays Date:"+Day+"-"+ Month+"-"+ Year); OUTPUT:

21 Lab - 7 Q1) Write a C# Program to Demonstrate Method Overloading? using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; namespace PolymorphismEx class OverloadingEx public void Add(int x, int y) int c = x + y; string result = Convert.ToString(c); MessageBox.Show("Addition of Numbers - "+result); public void Add(String a, String b) String c = a + b; MessageBox.Show("Addition of Strings - " + c); static void Main(string[] args) OverloadingEx ol = new OverloadingEx(); ol.add(20, 30); ol.add("object", "Oriented"); OUTPUT:

22 Q2) Write a C# Program to Demonstrate Method Overriding? OverridingM Class using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; namespace OverridingEx class OverridingM public virtual void cal(int a, int b) MessageBox.Show("Calculation is started"); Calculation Class using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace OverridingEx class Calculation:OverridingM public override void cal(int a, int b) int c = a + b; Console.WriteLine("Overriding method Add"); base.cal(a,b); Console.WriteLine(c); Console.ReadKey();

23 OverridingMain Class using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace OverridingEx class OverridingMain public static void Main(string[] args) Calculation c = new Calculation(); c.cal(10, 20); OUTPUT:

Engr 123 Spring 2018 Notes on Visual Studio

Engr 123 Spring 2018 Notes on Visual Studio Engr 123 Spring 2018 Notes on Visual Studio We will be using Microsoft Visual Studio 2017 for all of the programming assignments in this class. Visual Studio is available on the campus network. For your

More information

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain Duhok Polytechnic University Amedi Technical Institute/ IT Dept. By Halkawt Rajab Hussain 2016-04-02 Objects and classes: Basics of object and class in C#. Private and public members and protected. Static

More information

RegEx - Numbers matching. Below is a sample code to find the existence of integers within a string.

RegEx - Numbers matching. Below is a sample code to find the existence of integers within a string. RegEx - Numbers matching Below is a sample code to find the existence of integers within a string. Sample code pattern to check for number in a string: using System; using System.Collections.Generic; using

More information

CALCULATOR APPLICATION

CALCULATOR APPLICATION CALCULATOR APPLICATION Form1.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;

More information

RegEx-validate IP address. Defined below is the pattern for checking an IP address with value: String Pattern Explanation

RegEx-validate IP address. Defined below is the pattern for checking an IP address with value: String Pattern Explanation RegEx-validate IP address Defined below is the pattern for checking an IP address with value: 240.30.20.60 String Pattern Explanation 240 ^[0-9]1,3 To define the starting part as number ranging from 1

More information

INFORMATICS LABORATORY WORK #2

INFORMATICS LABORATORY WORK #2 KHARKIV NATIONAL UNIVERSITY OF RADIO ELECTRONICS INFORMATICS LABORATORY WORK #2 SIMPLE C# PROGRAMS Associate Professor A.S. Eremenko, Associate Professor A.V. Persikov 2 Simple C# programs Objective: writing

More information

Object oriented lab /second year / review/lecturer: yasmin maki

Object oriented lab /second year / review/lecturer: yasmin maki 1) Examples of method (function): Note: the declaration of any method is : method name ( parameters list ).. Method body.. Access modifier : public,protected, private. Return

More information

Programming in C# with Microsoft Visual Studio 2010

Programming in C# with Microsoft Visual Studio 2010 Programming in C# with Microsoft Visual Studio 2010 Course 10266; 5 Days, Instructor-led Course Description: The course focuses on C# program structure, language syntax, and implementation details with.net

More information

10266 Programming in C Sharp with Microsoft Visual Studio 2010

10266 Programming in C Sharp with Microsoft Visual Studio 2010 10266 Programming in C Sharp with Microsoft Visual Studio 2010 Course Number: 10266A Category: Visual Studio 2010 Duration: 5 days Course Description The course focuses on C# program structure, language

More information

"Charting the Course... MOC Programming in C# with Microsoft Visual Studio Course Summary

Charting the Course... MOC Programming in C# with Microsoft Visual Studio Course Summary Course Summary NOTE - The course delivery has been updated to Visual Studio 2013 and.net Framework 4.5! Description The course focuses on C# program structure, language syntax, and implementation details

More information

GradeBook code. Main Program

GradeBook code. Main Program // Program 4 // CIS 199-01/-76 // Due: Tuesday April 20 by class // By: Charles Rady GradeBook code Main Program // File: Program.cs // This file serves as a simple test program for the gradebook class.

More information

Inheritance in java is a mechanism in which one object acquires all the properties and behaviors of parent object.

Inheritance in java is a mechanism in which one object acquires all the properties and behaviors of parent object. Inheritance in Java 1. Inheritance 2. Types of Inheritance 3. Why multiple inheritance is not possible in java in case of class? Inheritance in java is a mechanism in which one object acquires all the

More information

Developing for Mobile Devices Lab (Part 1 of 2)

Developing for Mobile Devices Lab (Part 1 of 2) Developing for Mobile Devices Lab (Part 1 of 2) Overview Through these two lab sessions you will learn how to create mobile applications for Windows Mobile phones and PDAs. As developing for Windows Mobile

More information

Now find the button component in the tool box. [if toolbox isn't present click VIEW on the top and click toolbox]

Now find the button component in the tool box. [if toolbox isn't present click VIEW on the top and click toolbox] C# Tutorial - Create a Tic Tac Toe game with Working AI This project will be created in Visual Studio 2010 however you can use any version of Visual Studio to follow along this tutorial. To start open

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

CSCE 110: Programming I

CSCE 110: Programming I CSCE 110: Programming I Sample Questions for Exam #1 February 17, 2013 Below are sample questions to help you prepare for Exam #1. Make sure you can solve all of these problems by hand. For most of the

More information

Programming Using C# QUEEN S UNIVERSITY BELFAST. Practical Week 7

Programming Using C# QUEEN S UNIVERSITY BELFAST. Practical Week 7 Programming Using C# QUEEN S UNIVERSITY BELFAST Practical Week 7 Table of Contents PRACTICAL 7... 2 EXERCISE 1... 2 TASK 1: Zoo Park (Without Inheritance)... 2 TASK 2: Zoo Park with Inheritance... 5 TASK

More information

You can call the project anything you like I will be calling this one project slide show.

You can call the project anything you like I will be calling this one project slide show. C# Tutorial Load all images from a folder Slide Show In this tutorial we will see how to create a C# slide show where you load everything from a single folder and view them through a timer. This exercise

More information

Department of Networks College of Bardarash Technical Institute DUHOK Polytechnic University Subject: Programming Fundamental by JAVA Course Book

Department of Networks College of Bardarash Technical Institute DUHOK Polytechnic University Subject: Programming Fundamental by JAVA Course Book 1 Department of Networks College of Bardarash Technical Institute DUHOK Polytechnic University Subject: Programming Fundamental by JAVA Course Book Year 1 Lecturer's name: MSc. Sami Hussein Ismael Academic

More information

Programming using C# LECTURE 07. Inheritance IS-A and HAS-A Relationships Overloading and Overriding Polymorphism

Programming using C# LECTURE 07. Inheritance IS-A and HAS-A Relationships Overloading and Overriding Polymorphism Programming using C# LECTURE 07 Inheritance IS-A and HAS-A Relationships Overloading and Overriding Polymorphism What is Inheritance? A relationship between a more general class, called the base class

More information

DC69 C# and.net JUN 2015

DC69 C# and.net JUN 2015 Solutions Q.2 a. What are the benefits of.net strategy advanced by Microsoft? (6) Microsoft has advanced the.net strategy in order to provide a number of benefits to developers and users. Some of the major

More information

To start we will be using visual studio Start a new C# windows form application project and name it motivational quotes viewer

To start we will be using visual studio Start a new C# windows form application project and name it motivational quotes viewer C# Tutorial Create a Motivational Quotes Viewer Application in Visual Studio In this tutorial we will create a fun little application for Microsoft Windows using Visual Studio. You can use any version

More information

Conventions in this tutorial

Conventions in this tutorial This document provides an exercise using Digi JumpStart for Windows Embedded CE 6.0. This document shows how to develop, run, and debug a simple application on your target hardware platform. This tutorial

More information

Yes, this is still a listbox!

Yes, this is still a listbox! Yes, this is still a listbox! Step 1: create a new project I use the beta 2 of Visual Studio 2008 ( codename Orcas ) and Expression Blend 2.0 September preview for this tutorial. You can download the beta2

More information

Learn C# Errata. 3-9 The Nullable Types The Assignment Operators

Learn C# Errata. 3-9 The Nullable Types The Assignment Operators 1 The following pages show errors from the original edition, published in July 2008, corrected in red. Future editions of this book will be printed with these corrections. We apologize for any inconvenience

More information

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain Duhok Polytechnic University Amedi Technical Institute/ IT Dept. By Halkawt Rajab Hussain 2016-04-02 Overview. C# program structure. Variables and Constant. Conditional statement (if, if/else, nested if

More information

Advanced Programming C# Lecture 2. dr inż. Małgorzata Janik

Advanced Programming C# Lecture 2. dr inż. Małgorzata Janik Advanced Programming C# Lecture 2 dr inż. Małgorzata Janik majanik@if.pw.edu.pl Winter Semester 2017/2018 C# Classes, Properties, Controls Constructions of Note using namespace like import in Java: bring

More information

Cleveland State University. Lecture Notes Feb Iteration Arrays ArrayLists. V. Matos

Cleveland State University. Lecture Notes Feb Iteration Arrays ArrayLists. V. Matos Cleveland State University IST311 V. Matos Lecture Notes Feb 17-22-24 Iteration Arrays ArrayLists Observe that various ideas discussed in class are given as separate code fragments in one large file. You

More information

Programming in Visual Basic with Microsoft Visual Studio 2010

Programming in Visual Basic with Microsoft Visual Studio 2010 Programming in Visual Basic with Microsoft Visual Studio 2010 Course 10550; 5 Days, Instructor-led Course Description This course teaches you Visual Basic language syntax, program structure, and implementation

More information

PROGRAMMING IN VISUAL BASIC WITH MICROSOFT VISUAL STUDIO Course: 10550A; Duration: 5 Days; Instructor-led

PROGRAMMING IN VISUAL BASIC WITH MICROSOFT VISUAL STUDIO Course: 10550A; Duration: 5 Days; Instructor-led CENTER OF KNOWLEDGE, PATH TO SUCCESS Website: PROGRAMMING IN VISUAL BASIC WITH MICROSOFT VISUAL STUDIO 2010 Course: 10550A; Duration: 5 Days; Instructor-led WHAT YOU WILL LEARN This course teaches you

More information

This is an open-book test. You may use the text book Be Sharp with C# but no other sources, written or electronic, will be allowed.

This is an open-book test. You may use the text book Be Sharp with C# but no other sources, written or electronic, will be allowed. UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 124 DATE: 5 September 2011 TIME: 3½ hours MARKS: 150 ASSESSORS: Prof. P.J. Blignaut & Mr. M.B. Mase MODERATOR: Dr. A. van

More information

Working with Objects. Overview. This chapter covers. ! Overview! Properties and Fields! Initialization! Constructors! Assignment

Working with Objects. Overview. This chapter covers. ! Overview! Properties and Fields! Initialization! Constructors! Assignment 4 Working with Objects 41 This chapter covers! Overview! Properties and Fields! Initialization! Constructors! Assignment Overview When you look around yourself, in your office; your city; or even the world,

More information

Start Visual Studio and create a new windows form application under C# programming language. Call this project YouTube Alarm Clock.

Start Visual Studio and create a new windows form application under C# programming language. Call this project YouTube Alarm Clock. C# Tutorial - Create a YouTube Alarm Clock in Visual Studio In this tutorial we will create a simple yet elegant YouTube alarm clock in Visual Studio using C# programming language. The main idea for this

More information

Experiment 5 : Creating a Windows application to interface with 7-Segment LED display

Experiment 5 : Creating a Windows application to interface with 7-Segment LED display Experiment 5 : Creating a Windows application to interface with 7-Segment LED display Objectives : 1) To understand the how Windows Forms in the Windows-based applications. 2) To create a Window Application

More information

CSCE 145 Exam 2 Review No Answers. This exam totals to 100 points. Follow the instructions. Good luck!

CSCE 145 Exam 2 Review No Answers. This exam totals to 100 points. Follow the instructions. Good luck! CSCE 145 Exam 2 Review No Answers This exam totals to 100 points. Follow the instructions. Good luck! Chapter 5 This chapter was mostly dealt with objects expect questions similar to these. 1. Create accessors

More information

Visual Studio.NET.NET Framework. Web Services Web Forms Windows Forms. Data and XML classes. Framework Base Classes. Common Language Runtime

Visual Studio.NET.NET Framework. Web Services Web Forms Windows Forms. Data and XML classes. Framework Base Classes. Common Language Runtime Intro C# Intro C# 1 Microsoft's.NET platform and Framework.NET Enterprise Servers Visual Studio.NET.NET Framework.NET Building Block Services Operating system on servers, desktop, and devices Web Services

More information

if (say==0) { k.commandtext = "Insert into kullanici(k_adi,sifre) values('" + textbox3.text + "','" + textbox4.text + "')"; k.

if (say==0) { k.commandtext = Insert into kullanici(k_adi,sifre) values(' + textbox3.text + ',' + textbox4.text + '); k. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient;

More information

Create a Java project named week10

Create a Java project named week10 Objectives of today s lab: Through this lab, students will examine how casting works in Java and learn about Abstract Class and in Java with examples. Create a Java project named week10 Create a package

More information

DigiPen Institute of Technology

DigiPen Institute of Technology DigiPen Institute of Technology Presents Session Two: Overview of C# Programming DigiPen Institute of Technology 5001 150th Ave NE, Redmond, WA 98052 Phone: (425) 558-0299 www.digipen.edu 2005 DigiPen

More information

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++ No. of Printed Pages : 3 I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination 05723. June, 2015 BCS-031 : PROGRAMMING IN C ++ Time : 3 hours Maximum Marks : 100 (Weightage 75%)

More information

First start a new Windows Form Application from C# and name it Interest Calculator. We need 3 text boxes. 4 labels. 1 button

First start a new Windows Form Application from C# and name it Interest Calculator. We need 3 text boxes. 4 labels. 1 button Create an Interest Calculator with C# In This tutorial we will create an interest calculator in Visual Studio using C# programming Language. Programming is all about maths now we don t need to know every

More information

Standard Version of Starting Out with C++, 4th Edition. Chapter 19 Recursion. Copyright 2003 Scott/Jones Publishing

Standard Version of Starting Out with C++, 4th Edition. Chapter 19 Recursion. Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 19 Recursion Copyright 2003 Scott/Jones Publishing Topics 19.1 Introduction to Recursion 19.2 The Recursive Factorial Function 19.3 The Recursive

More information

The Open Core Interface SDK has to be installed on your development computer. The SDK can be downloaded at:

The Open Core Interface SDK has to be installed on your development computer. The SDK can be downloaded at: This document describes how to create a simple Windows Forms Application using some Open Core Interface functions in C# with Microsoft Visual Studio Express 2013. 1 Preconditions The Open Core Interface

More information

CSIS 1624 CLASS TEST 6

CSIS 1624 CLASS TEST 6 CSIS 1624 CLASS TEST 6 Instructions: Use visual studio 2012/2013 Make sure your work is saved correctly Submit your work as instructed by the demmies. This is an open-book test. You may consult the printed

More information

Problem Statement. B1: average speed

Problem Statement. B1: average speed Problem Statement B1: average speed A woman runs on tracks of different lengths each day. She always times the last lap. Use the time for the last lap (in seconds) and the length of the track (in miles)

More information

IBSDK Quick Start Tutorial for C# 2010

IBSDK Quick Start Tutorial for C# 2010 IB-SDK-00003 Ver. 3.0.0 2012-04-04 IBSDK Quick Start Tutorial for C# 2010 Copyright @2012, lntegrated Biometrics LLC. All Rights Reserved 1 QuickStart Project C# 2010 Example Follow these steps to setup

More information

Step4: Now, Drag and drop the Textbox, Button and Text block from the Toolbox.

Step4: Now, Drag and drop the Textbox, Button and Text block from the Toolbox. Name of Experiment: Display the Unicode for the key-board characters. Exp No:WP4 Background: Student should have a basic knowledge of C#. Summary: After going through this experiment, the student is aware

More information

Teacher Training Solutions

Teacher Training Solutions Teacher Training Solutions Practical 7 Exercise 1 Task 1 class Animal private String name; private String diet; private String location; private double weight; private int age; private String colour; Page

More information

Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK.

Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK. Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK. Before you start - download the game assets from above or on MOOICT.COM to

More information

LISTING PROGRAM. // // TODO: Add constructor code after the InitializeComponent() call. //

LISTING PROGRAM. // // TODO: Add constructor code after the InitializeComponent() call. // 1. MainForm.cs using System.Collections.Generic; using System.Drawing; LISTING PROGRAM / / Description of MainForm. / public partial class MainForm : Form public MainForm() The InitializeComponent()

More information

We are going to use some graphics and found a nice little batman running GIF, off course you can use any image you want for the project.

We are going to use some graphics and found a nice little batman running GIF, off course you can use any image you want for the project. C# Tutorial - Create a Batman Gravity Run Game Start a new project in visual studio and call it gravityrun It should be a windows form application with C# Click OK Change the size of the to 800,300 and

More information

DC69 C# &.NET DEC 2015

DC69 C# &.NET DEC 2015 Q.2 a. Briefly explain the advantage of framework base classes in.net. (5).NET supplies a library of base classes that we can use to implement applications quickly. We can use them by simply instantiating

More information

This is an open-book test. You may use the text book Be Sharp with C# but no other sources, written or electronic, will be allowed.

This is an open-book test. You may use the text book Be Sharp with C# but no other sources, written or electronic, will be allowed. UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 124 DATE: 1 September 2014 TIME: 3 hours MARKS: 105 ASSESSORS: Prof. P.J. Blignaut BONUS MARKS: 3 MODERATOR: Dr. L. De Wet

More information

Form Properties Window

Form Properties Window C# Tutorial Create a Save The Eggs Item Drop Game in Visual Studio Start Visual Studio, Start a new project. Under the C# language, choose Windows Form Application. Name the project savetheeggs and click

More information

Getting Started with Banjos4Hire

Getting Started with Banjos4Hire Getting Started with Banjos4Hire Rob Miles Department of Computer Science Data Objects There are a number of objects that you will need to keep track of in the program Banjo Customer Rental You can use

More information

204111: Computer and Programming

204111: Computer and Programming 204111: Computer and Programming Week 4: Control Structures t Monchai Sopitkamon, Ph.D. Overview Types of control structures Using selection structure Using repetition structure Types of control ol structures

More information

UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 214 MODULE TEST 1

UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 214 MODULE TEST 1 UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 214 MODULE TEST 1 DATE: 12 March 2014 TIME: 4 hours MARKS: 220 ASSESSORS: Prof. P.J. Blignaut & Mr G.J. Dollman BONUS MARKS:

More information

In-Class Worksheet #4

In-Class Worksheet #4 CSE 459.24 Programming in C# Richard Kidwell In-Class Worksheet #4 Creating a Windows Forms application with Data Binding You should have Visual Studio 2008 open. 1. Create a new Project either from the

More information

IT 374 C# and Applications/ IT695 C# Data Structures

IT 374 C# and Applications/ IT695 C# Data Structures IT 374 C# and Applications/ IT695 C# Data Structures Module 2.1: Introduction to C# App Programming Xianrong (Shawn) Zheng Spring 2017 1 Outline Introduction Creating a Simple App String Interpolation

More information

MATFOR In Visual C# ANCAD INCORPORATED. TEL: +886(2) FAX: +886(2)

MATFOR In Visual C# ANCAD INCORPORATED. TEL: +886(2) FAX: +886(2) Quick Start t t MATFOR In Visual C# ANCAD INCORPORATED TEL: +886(2) 8923-5411 FAX: +886(2) 2928-9364 support@ancad.com www.ancad.com 2 MATFOR QUICK START Information in this instruction manual is subject

More information

FDSc in ICT. Building a Program in C#

FDSc in ICT. Building a Program in C# FDSc in ICT Building a Program in C# Objectives To build a complete application in C# from scratch Make a banking app Make use of: Methods/Functions Classes Inheritance Scenario We have a bank that has

More information

Start Visual Studio, create a new project called Helicopter Game and press OK

Start Visual Studio, create a new project called Helicopter Game and press OK C# Tutorial Create a helicopter flying and shooting game in visual studio In this tutorial we will create a fun little helicopter game in visual studio. You will be flying the helicopter which can shoot

More information

Getter and Setter Methods

Getter and Setter Methods Example 1 namespace ConsoleApplication14 public class Student public int ID; public string Name; public int Passmark = 50; class Program static void Main(string[] args) Student c1 = new Student(); Console.WriteLine("please..enter

More information

C# Language Changes and Updates

C# Language Changes and Updates C# Language Changes and Updates C# Language Changes and Updates Objectives Discover the new C# language features. Learn about some new and useful.net classes. Understand breaking changes. Debug and build

More information

DAD Lab. 1 Introduc7on to C#

DAD Lab. 1 Introduc7on to C# DAD 2017-18 Lab. 1 Introduc7on to C# Summary 1..NET Framework Architecture 2. C# Language Syntax C# vs. Java vs C++ 3. IDE: MS Visual Studio Tools Console and WinForm Applica7ons 1..NET Framework Introduc7on

More information

Langage C# et environnement.net M1 Année

Langage C# et environnement.net M1 Année Cahier de TP C# et.net SÉANCE 1 : BASIC OOL CONCEPTS...1 SÉANCE 2 : DELEGATES, EVENTS, THREAD-SAFE CONTROL ACCESS, RESOURCE MANAGEMENT...3 SÉANCE 3 : INHERITANCE, POLYMORPHISM, CONTAINERS, SERIALIZATION...5

More information

Introduction to C# Applications

Introduction to C# Applications 1 2 3 Introduction to C# Applications OBJECTIVES To write simple C# applications To write statements that input and output data to the screen. To declare and use data of various types. To write decision-making

More information

Problem Statement. A1: being lapped on the track

Problem Statement. A1: being lapped on the track Problem Statement A1: being lapped on the track You and your friend are running laps on the track at the rec complex. Your friend passes you exactly X times in one of your laps (that is, you start the

More information

Representing Recursive Relationships Using REP++ TreeView

Representing Recursive Relationships Using REP++ TreeView Representing Recursive Relationships Using REP++ TreeView Author(s): R&D Department Publication date: May 4, 2006 Revision date: May 2010 2010 Consyst SQL Inc. All rights reserved. Representing Recursive

More information

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Computer Science And Engineering

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Computer Science And Engineering INTERNAL ASSESSMENT TEST 1 Date : 19 08 2015 Max Marks : 50 Subject & Code : C# Programming and.net & 10CS761 Section : VII CSE A & C Name of faculty : Mrs. Shubha Raj K B Time : 11.30 to 1PM 1. a What

More information

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain Duhok Polytechnic University Amedi Technical Institute/ IT Dept. By Halkawt Rajab Hussain 2016-04-02 : Structure declaration and initialization. Access to fields of structure. Array of Structs. 11/10/2016

More information

Instructions for writing Web Services using Microsoft.NET:

Instructions for writing Web Services using Microsoft.NET: Instructions for writing Web Services using Microsoft.NET: Pre-requisites: Operating System: Microsoft Windows XP Professional / Microsoft Windows 2000 Professional / Microsoft Windows 2003 Server.NET

More information

Your First Windows Form

Your First Windows Form Your First Windows Form From now on, we re going to be creating Windows Forms Applications, rather than Console Applications. Windows Forms Applications make use of something called a Form. The Form is

More information

Click on the empty form and apply the following options to the properties Windows.

Click on the empty form and apply the following options to the properties Windows. Start New Project In Visual Studio Choose C# Windows Form Application Name it SpaceInvaders and Click OK. Click on the empty form and apply the following options to the properties Windows. This is the

More information

Visual C# 2010 Express

Visual C# 2010 Express Review of C# and XNA What is C#? C# is an object-oriented programming language developed by Microsoft. It is developed within.net environment and designed for Common Language Infrastructure. Visual C#

More information

C# Programming. Unit 1: Introducing C# and the.net FrameworkThis module explains the.net Framework, and using C# and

C# Programming. Unit 1: Introducing C# and the.net FrameworkThis module explains the.net Framework, and using C# and C# Programming 1. Sound Knowledge of C++. Course Summary: This course presents Microsoft's C# programming language and the use of Visual Studio 2008 or 2010 to develop Windows applications using the.net

More information

Objectives. Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments

Objectives. Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments Basics Objectives Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments 2 Class Keyword class used to define new type specify

More information

A method is a code block that contains a series of statements. Methods. Console.WriteLine(); Console.ReadKey(); Console.ReadKey(); int.

A method is a code block that contains a series of statements. Methods. Console.WriteLine(); Console.ReadKey(); Console.ReadKey(); int. A method is a code block that contains a series of statements Methods Built-in User Define Built-in Methods (Examples): Console.WriteLine(); int.parse(); Methods Void (Procedure) Return (Function) Procedures

More information

Answer the following questions on the answer sheet that is provided. The computer must be switched off while you are busy with Section A.

Answer the following questions on the answer sheet that is provided. The computer must be switched off while you are busy with Section A. UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 114 DATE: 25 April 2013 TIME: 180 minutes MARKS: 100 ASSESSORS: Prof. P.J. Blignaut & Mr. F. Radebe (+2 bonus marks) MODERATOR:

More information

Software Practice 1 - Inheritance and Interface Inheritance Overriding Polymorphism Abstraction Encapsulation Interfaces

Software Practice 1 - Inheritance and Interface Inheritance Overriding Polymorphism Abstraction Encapsulation Interfaces Software Practice 1 - Inheritance and Interface Inheritance Overriding Polymorphism Abstraction Encapsulation Interfaces Prof. Hwansoo Han T.A. Minseop Jeong T.A. Wonseok Choi 1 In Previous Lecture We

More information

UCT Algorithm Circle: Number Theory

UCT Algorithm Circle: Number Theory UCT Algorithm Circle: 7 April 2011 Outline Primes and Prime Factorisation 1 Primes and Prime Factorisation 2 3 4 Some revision (hopefully) What is a prime number? An integer greater than 1 whose only factors

More information

Loops / Repetition Statements

Loops / Repetition Statements Loops / Repetition Statements Repetition statements allow us to execute a statement multiple times Often they are referred to as loops C has three kinds of repetition statements: the while loop the for

More information

Carleton University Department of Systems and Computer Engineering SYSC Foundations of Imperative Programming - Winter Lab 8 - Structures

Carleton University Department of Systems and Computer Engineering SYSC Foundations of Imperative Programming - Winter Lab 8 - Structures Carleton University Department of Systems and Computer Engineering SYSC 2006 - Foundations of Imperative Programming - Winter 2012 Lab 8 - Structures Objective To write functions that manipulate structures.

More information

Getting started 7. Storing values 21. Creating variables 22 Reading input 24 Employing arrays 26 Casting data types 28 Fixing constants 30 Summary 32

Getting started 7. Storing values 21. Creating variables 22 Reading input 24 Employing arrays 26 Casting data types 28 Fixing constants 30 Summary 32 Contents 1 2 3 Contents Getting started 7 Introducing C# 8 Installing Visual Studio 10 Exploring the IDE 12 Starting a Console project 14 Writing your first program 16 Following the rules 18 Summary 20

More information

Visual Basic/C# Programming (330)

Visual Basic/C# Programming (330) Page 1 of 12 Visual Basic/C# Programming (330) REGIONAL 2017 Production Portion: Program 1: Calendar Analysis (400 points) TOTAL POINTS (400 points) Judge/Graders: Please double check and verify all scores

More information

CS/COE 1501 cs.pitt.edu/~bill/1501/ More Math

CS/COE 1501 cs.pitt.edu/~bill/1501/ More Math CS/COE 1501 cs.pitt.edu/~bill/1501/ More Math Exponentiation x y Can easily compute with a simple algorithm: Runtime? ans = 1 i = y while i > 0: ans = ans * x i-- 2 Just like with multiplication, let s

More information

Computer Programming: C++

Computer Programming: C++ The Islamic University of Gaza Engineering Faculty Department of Computer Engineering Fall 2017 ECOM 2003 Muath i.alnabris Computer Programming: C++ Experiment #7 Arrays Part II Passing Array to a Function

More information

Basic memory model Using functions Writing functions. Basics Prototypes Parameters Return types Functions and memory Names and namespaces

Basic memory model Using functions Writing functions. Basics Prototypes Parameters Return types Functions and memory Names and namespaces Basic memory model Using functions Writing functions Basics Prototypes Parameters Return types Functions and memory Names and namespaces When a program runs it requires main memory (RAM) space for Program

More information

This is the empty form we will be working with in this game. Look under the properties window and find the following and change them.

This is the empty form we will be working with in this game. Look under the properties window and find the following and change them. We are working on Visual Studio 2010 but this project can be remade in any other version of visual studio. Start a new project in Visual Studio, make this a C# Windows Form Application and name it zombieshooter.

More information

Lesson11-Inheritance-Abstract-Classes. The GeometricObject case

Lesson11-Inheritance-Abstract-Classes. The GeometricObject case Lesson11-Inheritance-Abstract-Classes The GeometricObject case GeometricObject class public abstract class GeometricObject private string color = "White"; private DateTime datecreated = new DateTime(2017,

More information

SUN Certified Programmer for J2SE 5.0 Upgrade. Download Full Version :

SUN Certified Programmer for J2SE 5.0 Upgrade. Download Full Version : SUN 310-056 Certified Programmer for J2SE 5.0 Upgrade Download Full Version : https://killexams.com/pass4sure/exam-detail/310-056 QUESTION: 125 1. package geometry; 2. public class Hypotenuse { 3. public

More information

IST311 Chapter13.NET Files (Part2)

IST311 Chapter13.NET Files (Part2) IST311 Chapter13.NET Files (Part2) using System; using System.Collections.Generic; using System.ComponentModel; using System.IO; using System.Linq; using System.Net; using System.Net.Sockets; using System.Text;

More information

Lesson07-Arrays-Part4. Program class. namespace Lesson07ArraysPart4Prep { class Program { static double METER_TO_INCHES = 100 / 2.

Lesson07-Arrays-Part4. Program class. namespace Lesson07ArraysPart4Prep { class Program { static double METER_TO_INCHES = 100 / 2. Lesson07-Arrays-Part4 Program class namespace Lesson07ArraysPart4Prep class Program static double METER_TO_INCHES = 100 / 2.54; static void Main(string[] args) Experiment01(); //Tuples Experiment02();

More information

-.Net Lab Programs Index S.no. Particulars Page no Write a Program in C# to demonstrate Command line arguments processing.

-.Net Lab Programs Index S.no. Particulars Page no Write a Program in C# to demonstrate Command line arguments processing. Index S.no. Particulars Page no 1 Write a Program in C# to check whether a number is Palindrome or not. 6 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Write a Program in C# to demonstrate Command line arguments

More information

C# Programming Tutorial Lesson 1: Introduction to Programming

C# Programming Tutorial Lesson 1: Introduction to Programming C# Programming Tutorial Lesson 1: Introduction to Programming About this tutorial This tutorial will teach you the basics of programming and the basics of the C# programming language. If you are an absolute

More information

C# Crash Course Dimitar Minchev

C# Crash Course Dimitar Minchev C# Crash Course Dimitar Minchev BIO Dimitar Minchev PhD of Informatics, Assistant Professor in Faculty of Computer Science and Engineering, Burgas Free University, Bulgaria. Education Bachelor of Informatics,

More information

Creating and Running Your First C# Program

Creating and Running Your First C# Program Creating and Running Your First C# Program : http://eembdersler.wordpress.com Choose the EEE-425Programming Languages (Fall) Textbook reading schedule Pdf lecture notes Updated class syllabus Midterm and

More information

Lecture 4 Overview of Classes, Containers & Generics

Lecture 4 Overview of Classes, Containers & Generics Lecture 4 Overview of Classes, Containers & Generics What is a Programming Object? An object is an instance of a class. A class is a template for an object. Everything's an object!!! Statements such as

More information

EEE-425 Programming Languages (2013) 1

EEE-425 Programming Languages (2013) 1 Creating and Running Your First C# Program : http://eembdersler.wordpress.com Choose the EEE-425Programming Languages (Fall) Textbook reading schedule Pdf lecture notes Updated class syllabus Midterm and

More information

Unit 1 Workbook ICS3U

Unit 1 Workbook ICS3U Unit 1 Workbook ICS3U Huntsville High School Computer Science Ian McTavish Name: Table of Contents Unit 1... 3 Expectations for Evaluation... 3 Assessment Due Dates... 3 February 3, 2012... 3 Typing Challenge...

More information