Lucrare pentru colocviu de practică

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

Lampiran B. Program pengendali

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

Operatii pop si push-stiva

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

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

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

User-Defined Controls

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

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

CSC 211 Intermediate Programming

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

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

Tutorial 5 Completing the Inventory Application Introducing Programming

This is the start of the server code

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

CIS 3260 Sample Final Exam Part II

Exemplu pentru utilizarea metodelor grafice

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

DEFINING AN ABL FORM AND BINDING SOURCE

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

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

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

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

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

using namespace System::Drawing::Drawing2D; using namespace System::Collections::Generic;

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

Class Test 5. Create a simple paint program that conforms to the following requirements.

Avoiding KeyStrokes in Windows Applications using C#

Web Services in.net (2)

Capturing the Mouse. Dragging Example


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

Inheriting Windows Forms with Visual C#.NET

CSC 330 Object-Oriented Programming. Encapsulation

PS2 Random Walk Simulator

SDI & MDI Applications

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

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

APARAT DE MASURA. Descrierea programului

Flag Quiz Application

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

SMITE API Developer Guide TABLE OF CONTENTS

C# and.net (1) cont d

Web Services in.net (7)

Event-based Programming

C# 2008 and.net Programming for Electronic Engineers - Elektor - ISBN

Nano River Technologies April 2009

Implementing an ADT with a Class

Chapter 12 - Graphical User Interface Concepts: Part 1

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

The Stack ADT. Stacks. The Stack ADT. The Stack ADT. Set of objects in which the location an item is inserted and deleted is prespecified.

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

Function Overloading

Introduction. Create a New Project. Create the Main Form. Assignment 1 Lights Out! in C# GUI Programming 10 points

Visual Studio Windows Form Application #1 Basic Form Properties

IBSDK Quick Start Tutorial for C# 2010

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

The Payroll User Interface: MODEL VIEW PRESENTER

Chapter 12: Using Controls

Web Services in.net (6) cont d

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

Visual Studio.NET enables quick, drag-and-drop construction of form-based applications

UNIT-3. Prepared by R.VINODINI 1

TuneTown Lab Instructions

C++/CLI Essentials. Student Guide Revision 1.0. Object Innovations Course 431

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

OVERLOADING METHODS AND CONSTRUCTORS: The Ball Class

Menus. You ll find MenuStrip listed in the Toolbox. Drag one to your form. Where it says Type Here, type Weather. Then you ll see this:

Error! Bookmark not defined.

DRAWING AND MOVING IMAGES

Database Programming in Visual Basic.NET

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

OhioState::OpenGLPanel. OpenGL and Windows. Public methods. OpenGLPanel : Forms::Control

Ryerson University Vers HAL6891A-09 School of Computer Science CPS109 Midterm Test Fall 09 page 1 of 7

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

Creating a nice GUI. OpenGL and Windows. Note: VS 2003 shown. Create a new Project

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

Database Applications

Scope. Scope is such an important thing that we ll review what we know about scope now:

Visual C# Program: Simple Game 3

BRONX COMMUNITY COLLEGE of the City University of New York DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE

Threads are lightweight processes responsible for multitasking within a single application.

Question 1 [20 points]

Painting your window

Cross-product Development with ArcGIS. Allan Laframboise

Responding to the Mouse

Design-Time Integration

SAMPLE EXAM Final Exam Computer Programming 326 Dr. St. John Lehman College City University of New York Thursday, 16 December 2010

ROOT Course. Vincenzo Vitale, Dip. Fisica and INFN Roma 2

Note that each button has a label, specified by the Text property of the button. The Text property of the group box is also visible as its title.

Using the TekScope IVI-COM Driver from C#.NET

Drawing Geometrical Objects. Graphic courtesy of Eric Roberts

INTRODUCTION TO COMPUTER PROGRAMMING. Richard Pierse. Class 9: Writing Java Applets. Introduction

Now it only remains to supply the code. Begin by creating three fonts:

For this example, we will set up a small program to display a picture menu for a fast food take-away shop.

JAYARAM. Department of Information Technology QUESTION BANK UNIT I BASICS OF C# Integer real single character string

CSIS 1624 CLASS TEST 6

Chapter 2 Visual Basic, Controls, and Events. 2.1 An Introduction to Visual Basic 2.2 Visual Basic Controls 2.3 Visual Basic Events

1. Stack Implementation Using 1D Array

Transcription:

Roman Radu-Alexandru Calculatoare an II Lucrare pentru colocviu de practică Descriere: Aplicatia are ca scop functionalitatea unui decodificator si a unui codificator. Converteste un numar din zecimal in binar si din binar in zecimal. Dupa rulare:

Codul: public ref class Form1 : public System::Windows::Forms::Form int A,B,C,D; int temp; int x; private: System::Windows::Forms::Label^ label2; private: System::Windows::Forms::Label^ label3; private: System::Windows::Forms::Label^ label4; private: System::Windows::Forms::Label^ label5; private: System::Windows::Forms::Button^ button2; private: System::Windows::Forms::NumericUpDown^ numericupdown5; 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::NumericUpDown^ numericupdown1; protected: private: System::Windows::Forms::NumericUpDown^ numericupdown2; private: System::Windows::Forms::NumericUpDown^ numericupdown3; private: System::Windows::Forms::NumericUpDown^ numericupdown4; private: System::Windows::Forms::Label^ label1; private: System::Windows::Forms::Button^ button1; protected: 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) this->numericupdown1 = (gcnew

System::Windows::Forms::NumericUpDown()); this->numericupdown2 = (gcnew System::Windows::Forms::NumericUpDown()); this->numericupdown3 = (gcnew System::Windows::Forms::NumericUpDown()); this->numericupdown4 = (gcnew System::Windows::Forms::NumericUpDown()); this->label1 = (gcnew System::Windows::Forms::Label()); this->button1 = (gcnew System::Windows::Forms::Button()); this->numericupdown5 = (gcnew System::Windows::Forms::NumericUpDown()); this->label2 = (gcnew System::Windows::Forms::Label()); this->label3 = (gcnew System::Windows::Forms::Label()); this->label4 = (gcnew System::Windows::Forms::Label()); this->label5 = (gcnew System::Windows::Forms::Label()); this->button2 = (gcnew System::Windows::Forms::Button()); >(this->numericupdown1))->begininit(); >(this->numericupdown2))->begininit(); >(this->numericupdown3))->begininit(); >(this->numericupdown4))->begininit(); >(this->numericupdown5))->begininit(); this->suspendlayout(); numericupdown1 this->numericupdown1->location = System::Drawing::Point(46, 111); this->numericupdown1->maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) 1, 0, 0, 0); this->numericupdown1->name = L"numericUpDown1"; this->numericupdown1->size = System::Drawing::Size(30, 20); this->numericupdown1->tabindex = 0; numericupdown2 this->numericupdown2->location = System::Drawing::Point(45, 151); this->numericupdown2->maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) 1, 0, 0, 0); this->numericupdown2->name = L"numericUpDown2"; this->numericupdown2->size = System::Drawing::Size(30, 20); this->numericupdown2->tabindex = 1; numericupdown3 this->numericupdown3->location = System::Drawing::Point(46, 189); this->numericupdown3->maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) 1, 0, 0, 0); this->numericupdown3->name = L"numericUpDown3"; this->numericupdown3->size = System::Drawing::Size(30, 20); this->numericupdown3->tabindex = 2; numericupdown4 this->numericupdown4->location = System::Drawing::Point(45, 231); this->numericupdown4->maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) 1, 0, 0, 0);

this->numericupdown4->name = L"numericUpDown4"; this->numericupdown4->size = System::Drawing::Size(30, 20); this->numericupdown4->tabindex = 3; label1 this->label1->autosize = true; this->label1->location = System::Drawing::Point(252, 184); this->label1->name = L"label1"; this->label1->size = System::Drawing::Size(35, 13); this->label1->tabindex = 4; this->label1->text = L"label1"; button1 this->button1->location = System::Drawing::Point(100, 307); this->button1->name = L"button1"; this->button1->size = System::Drawing::Size(123, 23); this->button1->tabindex = 5; this->button1->text = L"Decodifica"; this->button1->usevisualstylebackcolor = true; this->button1->click += gcnew System::EventHandler(this, &Form1::button1_Click); numericupdown5 this->numericupdown5->location = System::Drawing::Point(424, 181); this->numericupdown5->maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) 15, 0, 0, 0); this->numericupdown5->name = L"numericUpDown5"; this->numericupdown5->size = System::Drawing::Size(40, 20); this->numericupdown5->tabindex = 6; label2 >AutoSize = true; >Location = System::Drawing::Point(664, 110); >Name = L"label2"; >Size = System::Drawing::Size(35, 13); >TabIndex = 7; >Text = L"label2"; label3 this->label3->autosize = true; this->label3->location = System::Drawing::Point(664, 152); this->label3->name = L"label3"; this->label3->size = System::Drawing::Size(35, 13); this->label3->tabindex = 8; this->label3->text = L"label3"; label4 this->label4->autosize = true; this->label4->location = System::Drawing::Point(664, 191); this->label4->name = L"label4"; this->label4->size = System::Drawing::Size(35, 13); this->label4->tabindex = 9; this->label4->text = L"label4"; label5 this->label5->autosize = true;

this->label5->location = System::Drawing::Point(664, 232); this->label5->name = L"label5"; this->label5->size = System::Drawing::Size(35, 13); this->label5->tabindex = 10; this->label5->text = L"label5"; button2 this->button2->location = System::Drawing::Point(501, 307); this->button2->name = L"button2"; this->button2->size = System::Drawing::Size(115, 23); this->button2->tabindex = 11; this->button2->text = L"Codifica"; this->button2->usevisualstylebackcolor = true; this->button2->click += gcnew System::EventHandler(this, &Form1::button2_Click); Form1 this->autoscaledimensions = System::Drawing::SizeF(6, 13); this->autoscalemode = System::Windows::Forms::AutoScaleMode::Font; this->clientsize = System::Drawing::Size(725, 372); this->controls->add(this->button2); this->controls->add(this->label5); this->controls->add(this->label4); this->controls->add(this->label3); this->controls->add(this->label2); this->controls->add(this->numericupdown5); this->controls->add(this->button1); this->controls->add(this->label1); this->controls->add(this->numericupdown4); this->controls->add(this->numericupdown3); this->controls->add(this->numericupdown2); this->controls->add(this->numericupdown1); this->name = L"Form1"; this->text = L"Aplicatie"; this->paint += gcnew System::Windows::Forms::PaintEventHandler(this, &Form1::desen); >(this->numericupdown1))->endinit(); >(this->numericupdown2))->endinit(); >(this->numericupdown3))->endinit(); >(this->numericupdown4))->endinit(); >(this->numericupdown5))->endinit(); this->resumelayout(false); this->performlayout(); #pragma endregion private: System::Void desen(system::object^ sender, System::Windows::Forms::PaintEventArgs^ e) Graphics^ g = e->graphics; g->clear(color::aliceblue); Pen^ creion_prim = gcnew Pen(Color::Black); creion_prim->width = 2; g->drawline(creion_prim,this->width/2,this- >Height,this->Width/2,0);

System::Drawing::SolidBrush^ pensula; pensula=gcnew System::Drawing::SolidBrush(System::Drawing::Color::Red); System::Drawing::Font^ fontul_meu; fontul_meu=gcnew System::Drawing::Font("Radu",10); g- >DrawString("Decodificator",fontul_meu,pensula,120,20); g->drawstring("codificator",fontul_meu,pensula,520,20); g->drawrectangle(creion_prim,110,80,100,200); System::Drawing::SolidBrush^ pensula2; pensula2=gcnew System::Drawing::SolidBrush(System::Drawing::Color::Black); System::Drawing::Font^ fontul_meu2; fontul_meu2=gcnew System::Drawing::Font("Radu",20); g->drawstring("dec.",fontul_meu2,pensula2,120,120); g->drawline(creion_prim,90,120,110,120); g->drawline(creion_prim,90,160,110,160); g->drawline(creion_prim,90,200,110,200); g->drawline(creion_prim,90,240,110,240); g->drawline(creion_prim,210,190,250,190); g->drawrectangle(creion_prim,510,80,100,200); g->drawline(creion_prim,480,190,510,190); g->drawstring("cod.",fontul_meu2,pensula2,520,120); g->drawline(creion_prim,610,120,640,120); g->drawline(creion_prim,610,160,640,160); g->drawline(creion_prim,610,200,640,200); g->drawline(creion_prim,610,240,640,240); (C*2)+(B*4)+(A*8)); int A=System::Convert::ToDouble(this->numericUpDown1- int B=System::Convert::ToDouble(this->numericUpDown2- int C=System::Convert::ToDouble(this->numericUpDown3- int D=System::Convert::ToDouble(this->numericUpDown4- this->label1->text=system::convert::tostring((d*1)+ x=system::convert::todouble(this->numericupdown5- if(x==1) this->label5- >Text=System::Convert::ToString("1"); this->label4- this->label3- else if(x<4) this->label5- this->label4- this->label3->text=system::convert::tostring(x

>Text=System::Convert::ToString(x/2); else if(x<8) this->label5- this->label4->text=system::convert::tostring(x temp=x/2; this->label3->text=system::convert::tostring(temp >Text=System::Convert::ToString(temp/2); else this->label5->text=system::convert::tostring(x temp=x/2; this->label4->text=system::convert::tostring(temp temp=temp/2; this->label3->text=system::convert::tostring(temp >Text=System::Convert::ToString(temp/2); private: System::Void button1_click(system::object^ sender, System::EventArgs^ e) this->label1- >Text=System::Convert::ToString((D*1)+(C*2)+(B*4)+(A*8)); private: System::Void button2_click(system::object^ sender, System::EventArgs^ e) x=system::convert::todouble(this->numericupdown5- if(x==1) this->label5- >Text=System::Convert::ToString("1"); this->label4- this->label3- else if(x<4) this->label5- this->label4- this->label3->text=system::convert::tostring(x >Text=System::Convert::ToString(x/2); else if(x<8) this->label5- this->label4->text=system::convert::tostring(x temp=x/2; this->label3->text=system::convert::tostring(temp >Text=System::Convert::ToString(temp/2);

else this->label5->text=system::convert::tostring(x temp=x/2; this->label4->text=system::convert::tostring(temp temp=temp/2; this->label3->text=system::convert::tostring(temp >Text=System::Convert::ToString(temp/2);