Convertor Binar -> Zecimal Rosu Alin, Calculatoare, An2 Mod de Functionare: Am creat un program, in Windows Form Application, care converteste un

Similar documents
Lucrare pentru colocviu de practică

namespace Tst_Form { private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components;

Lampiran B. Program pengendali

Operatii pop si push-stiva

#pragma comment(lib, "irrklang.lib") #include <windows.h> namespace SuperMetroidCraft {

Classes in C# namespace classtest { public class myclass { public myclass() { } } }

Tutorial 5 Completing the Inventory Application Introducing Programming

Lucrare pentru colocviul de practica informatica an II calculatoare COTFAS VLAD CALC 2

Tutorial 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and Arithmetic

User-Defined Controls

CSC 211 Intermediate Programming

Inheriting Windows Forms with Visual C#.NET

This is the start of the server code

1. Windows Forms 2. Event-Handling Model 3. Basic Event Handling 4. Control Properties and Layout 5. Labels, TextBoxes and Buttons 6.

Managed C++ and.net Development STEPHEN R. G. FRASER

ListBox. Class ListBoxTest. Allows users to add and remove items from ListBox Uses event handlers to add to, remove from, and clear list

Sub To Srt Converter. This is the source code of this program. It is made in C# with.net 2.0.

APARAT DE MASURA. Descrierea programului

Ballbot. Scott Pokorny. EML 5666 Intelligent Machines Design Lab. Instructors: Dr. A. Antonio Arroyo and Dr. Eric M. Schwartz

Tutorial 19 - Microwave Oven Application Building Your Own Classes and Objects

Web Services in.net (2)

and event handlers Murach's C# 2012, C6 2013, Mike Murach & Associates, Inc. Slide 1

this.openfiledialog = new System.Windows.Forms.OpenFileDialog(); this.label4 = new System.Windows.Forms.Label(); this.

Flag Quiz Application

CIS 3260 Sample Final Exam Part II

In order to create your proxy classes, we have provided a WSDL file. This can be located at the following URL:

BackgroundWorker Component Overview 1 Multithreading with the BackgroundWorker Component 3 Walkthrough Running an Operation in the Background 10 How

Blank Form. Industrial Programming. Discussion. First Form Code. Lecture 8: C# GUI Development

CSC 330 Object-Oriented Programming. Encapsulation

Avoiding KeyStrokes in Windows Applications using C#

CALCULATOR APPLICATION

PS2 Random Walk Simulator

Chapter 12 - Graphical User Interface Concepts: Part 1

Visual Studio Windows Form Application #1 Basic Form Properties

LISTING PROGRAM. //Find the maximum and minimum values in the array int maxvalue = integers[0]; //start with first element int minvalue = integers[0];

CHAPTER 3. Writing Windows C# Programs. Objects in C#

DEFINING AN ABL FORM AND BINDING SOURCE

C# and.net (1) cont d

IBSDK Quick Start Tutorial for C# 2010

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

Laborator 3 Java. Introducere in programarea vizuala


#using <System.dll> #using <System.Windows.Forms.dll> #using <System.Drawing.dll>

Polymorphism. Polymorphism. CSC 330 Object Oriented Programming. What is Polymorphism? Why polymorphism? Class-Object to Base-Class.

UNIT-3. Prepared by R.VINODINI 1

Arrays. Arrays: Declaration and Instantiation. Array: An Array of Simple Values

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

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

Web Services in.net (7)

1. Să se determine de câte ori apare cifra c în scrierea în baza p a numărului n.

Laborator 8 Java Crearea claselor de obiecte. Variabilele (campurile) clasei de obiecte

Nano River Technologies April 2009

An array can hold values of any type. The entire collection shares a single name

SMITE API Developer Guide TABLE OF CONTENTS

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

CSIS 1624 CLASS TEST 6

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

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.

Visual Basic/C# Programming (330)

// Specify SEF file to load. edischema oschema = oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format);

Web Services in.net (6) cont d

Classes and Objects. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

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

Create your own Meme Maker in C#

Design-Time Integration

Image Data Binding. Save images in database An image needs large amount of storage space. Only binary variable length fields may hold images.

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

The Payroll User Interface: MODEL VIEW PRESENTER

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

Form Properties Window

Given the C++ declaration statement below, which of the following represents the value of exforsys? e) None of the above. 1K

Using the Quinn-Curtis.Net Software (QCChart2D and QCRTGraph) with Managed C++ (MC++)

Classes and Objects. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

string spath; string sedifile = "277_005010X228.X12"; string sseffile = "277_005010X228.SemRef.EVAL0.SEF";

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

Chapter 12. Tool Strips, Status Strips, and Splitters

Chapter 6 Dialogs. Creating a Dialog Style Form

Windows Forms in Action by Erik Brown Chapter 3. Copyright 2006 Manning Publications

XNA 4.0 RPG Tutorials. Part 11b. Game Editors

Chapter 2. Ans. C (p. 55) 2. Which is not a control you can find in the Toolbox? A. Label B. PictureBox C. Properties Window D.

// Specify SEF file to load. oschema = (edischema) oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format);

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

Mainly three tables namely Teacher, Student and Class for small database of a school. are used. The snapshots of all three tables are shown below.

namespace csharp_gen277x214 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

namespace Gen837X222A1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

Capturing the Mouse. Dragging Example

EEE-425 Programming Languages (2013) 1

Dr.Qadri Hamarsheh. Overview of ASP.NET. Advanced Programming Language (630501) Fall 2011/2012 Lectures Notes # 17. Data Binding.

IDoc based adapterless communication between SAP NetWeaver Application Server (SAP NetWeaver AS) and Microsoft BizTalk Server

Visual Basic/C# Programming (330)

C13. INTERFATA PARALELA PROGRAMABILA (PPI) I8255A (PIO)

THE HONG KONG POLYTECHNIC UNIVERSITY Faculty of Engineering. Computer Programming Closed-book Written Test 3 Date: 28 March 2009 Time: 2:30 3:30 pm

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

Introduction to.net. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

namespace csharp_gen837x223a2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

Teacher Training Solutions

Conventions in this tutorial

Se cer 2 variante: una cu implementarea statica si a doua cu implementarea dinamica a structurilor de date necesare. Comentati variantele.

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

Hands-On Lab. Lab: Client Object Model. Lab version: Last updated: 2/23/2011

Transcription:

Convertor Binar -> Zecimal Rosu Alin, Calculatoare, An2 Mod de Functionare: Am creat un program, in Windows Form Application, care converteste un numar binar, in numar zecimal. Acest program are 4 numericupdown-uri (A, B, C, D). A fiind cel mai semnificativ bit (MSB), iar D fiind cel mai putin semnificativ bit. Are 2 butoane (Ruleaza, Reset). Butonul Ruleaza are pus ca event la click o functie care va afisa numarul format din cei 4 biti de intrare. Butonul Reset seteaza biti de intrare pe 0, resetand astfel programul. Rezultatul este afisat intr-un text box. Am adaugat pe mijloc si un PictureBox care ne arata schema logica a convertorului; Printscreen:

Codul Sursa: #pragma once namespace alinrosusem2 using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; / <summary> / Summary for Form1 / / WARNING: If you change the name of this class, you will need to change the / 'Resource File Name' property for the managed resource compiler tool / associated with all.resx files this class depends on. Otherwise, / the designers will not be able to interact properly with localized / resources associated with this form. / </summary> public ref class Form1 : public System::Windows::Forms::Form public: Form1(void) InitializeComponent(); TODO: Add the constructor code here protected: / <summary> / Clean up any resources being used. / </summary> ~Form1() if (components) delete components; private: System::Windows::Forms::Button^ button1; protected: private: System::Windows::Forms::Button^ button2; private: System::Windows::Forms::Label^ label1; private: System::Windows::Forms::TextBox^ textbox1;

private: System::Windows::Forms::NumericUpDown^ numericupdown1; private: System::Windows::Forms::NumericUpDown^ numericupdown2; private: System::Windows::Forms::PictureBox^ picturebox1; private: System::Windows::Forms::NumericUpDown^ numericupdown3; private: System::Windows::Forms::Label^ label2; private: System::Windows::Forms::Label^ label3; private: System::Windows::Forms::Label^ label4; private: System::Windows::Forms::NumericUpDown^ numericupdown4; private: System::Windows::Forms::Label^ label5; private: System::Windows::Forms::Label^ label6; private: / <summary> / Required designer variable. / </summary> System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code / <summary> / Required method for Designer support - do not modify / the contents of this method with the code editor. / </summary> void InitializeComponent(void) System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid)); this->button1 = (gcnew System::Windows::Forms::Button()); this->button2 = (gcnew System::Windows::Forms::Button()); this->label1 = (gcnew this->textbox1 = (gcnew System::Windows::Forms::TextBox()); this->numericupdown1 = (gcnew System::Windows::Forms::NumericUpDown()); this->numericupdown2 = (gcnew System::Windows::Forms::NumericUpDown()); this->picturebox1 = (gcnew System::Windows::Forms::PictureBox()); this->numericupdown3 = (gcnew System::Windows::Forms::NumericUpDown()); this->label2 = (gcnew this->label3 = (gcnew this->label4 = (gcnew this->numericupdown4 = (gcnew System::Windows::Forms::NumericUpDown()); this->label5 = (gcnew this->label6 = (gcnew

>(this->numericupdown1))->begininit(); >(this->numericupdown2))->begininit(); >(this->picturebox1))->begininit(); >(this->numericupdown3))->begininit(); >(this->numericupdown4))->begininit(); this->suspendlayout(); button1 this->button1->location = System::Drawing::Point(26, 212); this->button1->name = L"button1"; this->button1->size = System::Drawing::Size(75, 23); this->button1->tabindex = 0; this->button1->text = L"Ruleaza"; this->button1->usevisualstylebackcolor = true; this->button1->click += gcnew System::EventHandler(this, &Form1::button1_Click); button2 this->button2->location = System::Drawing::Point(26, 252); this->button2->name = L"button2"; this->button2->size = System::Drawing::Size(75, 23); this->button2->tabindex = 1; this->button2->text = L"Reset"; this->button2->usevisualstylebackcolor = true; this->button2->click += gcnew System::EventHandler(this, &Form1::button2_Click); label1 this->label1->autosize = true; this->label1->location = System::Drawing::Point(639, 116); this->label1->name = L"label1"; this->label1->size = System::Drawing::Size(46, 13); this->label1->tabindex = 2; this->label1->text = L"Rezultat"; textbox1 >Location = System::Drawing::Point(627, 132); >Name = L"textBox1";

>Size = System::Drawing::Size(100, 20); >TabIndex = 4; numericupdown1 this->numericupdown1->location = System::Drawing::Point(26, 28); this->numericupdown1->name = L"numericUpDown1"; this->numericupdown1->size = System::Drawing::Size(120, 20); this->numericupdown1->tabindex = 6; numericupdown2 this->numericupdown2->location = System::Drawing::Point(26, 70); this->numericupdown2->name = L"numericUpDown2"; this->numericupdown2->size = System::Drawing::Size(120, 20); this->numericupdown2->tabindex = 7; picturebox1 this->picturebox1->backgroundimage = (cli::safe_cast<system::drawing::image^ >(resources- >GetObject(L"pictureBox1.BackgroundImage"))); this->picturebox1->location = System::Drawing::Point(143, 24); this->picturebox1->name = L"pictureBox1"; this->picturebox1->size = System::Drawing::Size(490, 247); this->picturebox1->tabindex = 8; this->picturebox1->tabstop = false; numericupdown3 this->numericupdown3->location = System::Drawing::Point(26, 109); this->numericupdown3->name = L"numericUpDown3"; this->numericupdown3->size = System::Drawing::Size(120, 20); this->numericupdown3->tabindex = 9; label2 this->label2->autosize = true; this->label2->location = System::Drawing::Point(23, 9); this->label2->name = L"label2"; this->label2->size = System::Drawing::Size(46, 13); this->label2->tabindex = 10; this->label2->text = L"A (MSB)"; label3 this->label3->autosize = true;

this->label3->location = System::Drawing::Point(23, 54); this->label3->name = L"label3"; this->label3->size = System::Drawing::Size(14, 13); this->label3->tabindex = 11; this->label3->text = L"B"; label4 this->label4->autosize = true; this->label4->location = System::Drawing::Point(23, 93); this->label4->name = L"label4"; this->label4->size = System::Drawing::Size(14, 13); this->label4->tabindex = 12; this->label4->text = L"C"; this->label4->click += gcnew System::EventHandler(this, &Form1::label4_Click); numericupdown4 this->numericupdown4->location = System::Drawing::Point(26, 147); this->numericupdown4->name = L"numericUpDown4"; this->numericupdown4->size = System::Drawing::Size(120, 20); this->numericupdown4->tabindex = 13; label5 this->label5->autosize = true; this->label5->location = System::Drawing::Point(23, 132); this->label5->name = L"label5"; this->label5->size = System::Drawing::Size(44, 13); this->label5->tabindex = 14; this->label5->text = L"D (LSB)"; label6 this->label6->autosize = true; this->label6->location = System::Drawing::Point(140, 8); this->label6->name = L"label6"; this->label6->size = System::Drawing::Size(132, 13); this->label6->tabindex = 15; this->label6->text = L"Convertor Binar -> Zecimal"; Form1 this->autoscaledimensions = System::Drawing::SizeF(6, 13); this->autoscalemode = System::Windows::Forms::AutoScaleMode::Font; this->clientsize = System::Drawing::Size(729, 312); this->controls->add(this->label6); this->controls->add(this->label5);

this->controls->add(this->numericupdown4); this->controls->add(this->label4); this->controls->add(this->label3); this->controls->add(this->label2); this->controls->add(this->numericupdown3); this->controls->add(this->numericupdown2); this->controls->add(this->numericupdown1); this->controls->add(this->textbox1); this->controls->add(this->label1); this->controls->add(this->button2); this->controls->add(this->button1); this->controls->add(this->picturebox1); this->name = L"Form1"; this->text = L"Convertor Binar -> Zecimal"; this->load += gcnew System::EventHandler(this, &Form1::Form1_Load); >(this->numericupdown1))->endinit(); >(this->numericupdown2))->endinit(); >(this->picturebox1))->endinit(); >(this->numericupdown3))->endinit(); >(this->numericupdown4))->endinit(); this->resumelayout(false); this->performlayout(); void functie(void) >numericupdown2->value==0)&&(this->numericupdown3->value==0)&&(this- >Text=System::Convert::ToString("0"); >numericupdown2->value==0)&&(this->numericupdown3->value==0)&&(this- >Text=System::Convert::ToString("1"); >numericupdown2->value==0)&&(this->numericupdown3->value==1)&&(this-

>Text=System::Convert::ToString("2"); >numericupdown2->value==0)&&(this->numericupdown3->value==1)&&(this- >Text=System::Convert::ToString("3"); >numericupdown2->value==1)&&(this->numericupdown3->value==0)&&(this- >Text=System::Convert::ToString("4"); >numericupdown2->value==1)&&(this->numericupdown3->value==0)&&(this- >Text=System::Convert::ToString("5"); >numericupdown2->value==1)&&(this->numericupdown3->value==1)&&(this- >Text=System::Convert::ToString("6"); >numericupdown2->value==1)&&(this->numericupdown3->value==1)&&(this- >Text=System::Convert::ToString("7"); >numericupdown2->value==0)&&(this->numericupdown3->value==0)&&(this- >Text=System::Convert::ToString("8"); >numericupdown2->value==0)&&(this->numericupdown3->value==0)&&(this-

>Text=System::Convert::ToString("9"); >numericupdown2->value==0)&&(this->numericupdown3->value==1)&&(this- >Text=System::Convert::ToString("10"); >numericupdown2->value==0)&&(this->numericupdown3->value==1)&&(this- >Text=System::Convert::ToString("11"); >numericupdown2->value==1)&&(this->numericupdown3->value==0)&&(this- >Text=System::Convert::ToString("12"); >numericupdown2->value==1)&&(this->numericupdown3->value==0)&&(this- >Text=System::Convert::ToString("13"); >numericupdown2->value==1)&&(this->numericupdown3->value==1)&&(this- >Text=System::Convert::ToString("14"); >numericupdown2->value==1)&&(this->numericupdown3->value==1)&&(this- >Text=System::Convert::ToString("15"); #pragma endregion private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e)

private: System::Void button1_click(system::object^ sender, System::EventArgs^ e) functie(); private: System::Void button2_click(system::object^ sender, System::EventArgs^ e) this->numericupdown1->value=0; this->numericupdown2->value=0; this->numericupdown3->value=0; this->numericupdown4->value=0; functie(); private: System::Void label4_click(system::object^ sender, System::EventArgs^ e) ;