Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original
Aula12 - Condicional/Programa �rea de casas/Aula12.sln
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aula12", "Aula12\Aula12.csproj", "{18699E07-856B-4440-92F7-566A1F5D505E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{18699E07-856B-4440-92F7-566A1F5D505E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{18699E07-856B-4440-92F7-566A1F5D505E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{18699E07-856B-4440-92F7-566A1F5D505E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{18699E07-856B-4440-92F7-566A1F5D505E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Aula12 - Condicional/Programa �rea de casas/Aula12/App.config
Aula12 - Condicional/Programa �rea de casas/Aula12/Aula12.csproj
Debug
AnyCPU
{18699E07-856B-4440-92F7-566A1F5D505E}
WinExe
Properties
Aula12
Aula12
v4.5
512
AnyCPU
true
full
false
bin\Debug\
DEBUG;TRACE
prompt
4
AnyCPU
pdbonly
true
bin\Release\
TRACE
prompt
4
Form
Form1.cs
Form1.cs
ResXFileCodeGenerator
Resources.Designer.cs
Designer
True
Resources.resx
SettingsSingleFileGenerator
Settings.Designer.cs
True
Settings.settings
True
Aula12 - Condicional/Programa �rea de casas/Aula12/bin/Debug/Aula12.exe
Aula12 - Condicional/Programa �rea de casas/Aula12/bin/Debug/Aula12.exe.config
Aula12 - Condicional/Programa �rea de casas/Aula12/bin/Debug/Aula12.pdb
Aula12 - Condicional/Programa �rea de casas/Aula12/bin/Debug/Aula12.vshost.exe
Aula12 - Condicional/Programa �rea de casas/Aula12/bin/Debug/Aula12.vshost.exe.config
Aula12 - Condicional/Programa �rea de casas/Aula12/bin/Debug/Aula12.vshost.exe.manifest
Aula12 - Condicional/Programa �rea de casas/Aula12/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.Threading.Tasks;
using System.Windows.Forms;
namespace Aula12
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double A1, L1, C1;
// Declarar Variaveis
try // Inicio Usuário Bom
{
L1 = double.Parse(textBox1.Text);
C1 = double.Parse(textBox2.Text);
// Converte o texto para numero real
if (L1 <= 0 || C1 <= 0)
{
MessageBox.Show("Entradas inválidas \nDigite novamente !","Notas Inválidas",
MessageBoxButtons.OK,
MessageBoxIcon.Warning);
// Mensagem de erro
textBox1.Text = "";
textBox2.Text = "";
label4.Text = "";
// Limpar Entradas e Saidas
textBox1.Focus();
// Volta o cursor para textBox1
}
else
{
A1 = L1 * C1;
// Processamento
A1 = Math.Round(A1, 2);
// Arredonda M para 2 casas decimais.
label4.Text = A1.ToString();
// Converte numero real para texto
}// Fim usuário Bom
}
catch (Exception) // Inicio usuário Ruim
{
MessageBox.Show("Entradas inválidas", "ERRO",
MessageBoxButtons.OK, MessageBoxIcon.Error);
// Mensagem na tela
textBox1.Text = "";
textBox2.Text = "";
label4.Text = "";
// Limpar Entradas e Saidas
textBox1.Focus();
// Volta o cursor para textBox1
}// Fim usuário Ruim
}
private void button2_Click(object sender, EventArgs e)
{
double A2, L2, C2;
// Declarar Variaveis
try // Inicio Usuário Bom
{
L2 = double.Parse(textBox3.Text);
C2 = double.Parse(textBox4.Text);
// Converte o texto para numero real
if (L2 <= 0 || C2 <= 0)
{
MessageBox.Show("Entradas inválidas \nDigite novamente !", "Notas Inválidas",
MessageBoxButtons.OK,
MessageBoxIcon.Warning);
// Mensagem de erro
textBox3.Text = "";
textBox4.Text = "";
label8.Text = "";
// Limpar Entradas e Saidas
textBox2.Focus();
// Volta o cursor para textBox2
}
else
{
A2 = L2 * C2;
// Processamento
A2 = Math.Round(A2, 2);
// Arredonda M para 2 casas decimais.
label8.Text = A2.ToString();
// Converte numero real para texto
}// Fim usuário Bom
}
catch (Exception) // Inicio usuário Ruim
{
MessageBox.Show("Entradas inválidas", "ERRO",
MessageBoxButtons.OK, MessageBoxIcon.Error);
// Mensagem na tela
textBox3.Text = "";
textBox4.Text = "";
label8.Text = "";
// Limpar Entradas e Saidas
textBox2.Focus();
// Volta o cursor para textBox2
}// Fim usuário Ruim
}
private void button3_Click(object sender, EventArgs e)
{
double A1, A2;
// Declarar Variaveis
try // Inicio Usuário Bom
{
A1 = double.Parse(label4.Text);
A2 = double.Parse(label8.Text);
// Converte o texto para numero real
if (A1 > A2)
label10.Text = " A casa 1 tem a maior área ";
if (A1 < A2)
label10.Text = " A casa 2 tem a maior área ";
if (A1 == A2)
label10.Text = " A casa 1 e 2 tem a mesma área ";
}// Fim usuário Bom
catch (Exception) // Inicio usuário Ruim
{
MessageBox.Show("Entradas inválidas \nCalcule as área primeiro !", "Notas Inválidas",
MessageBoxButtons.OK,
MessageBoxIcon.Warning);
}
}
private void button4_Click(object sender, EventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
label4.Text = "";
label8.Text = "";
// Limpar Entradas e Saidas
textBox1.Focus();
// Volta o cursor
para textBox1
}
private void button5_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Deseja mesmo terminar", "Finalizando",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1) == DialogResult.Yes)
// pergunta se deseja mesmo terminar
{
Application.Exit();
// finaliza aplicação
}
}
}
}
Aula12 - Condicional/Programa �rea de casas/Aula12/Form1.Designer.cs
namespace Aula12
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#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>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.textBox4 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.button2 = new System.Windows.Forms.Button();
this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.textBox2);
this.groupBox1.Controls.Add(this.textBox1);
this.groupBox1.Controls.Add(this.button1);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(200, 162);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Casa 1";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(94, 65);
this.textBox2.MaxLength = 5;
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(67, 20);
this.textBox2.TabIndex = 6;
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(94, 30);
this.textBox1.MaxLength = 5;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(67, 20);
this.textBox1.TabIndex = 5;
//
// button1
//
this.button1.BackColor = System.Drawing.Color.SkyBlue;
this.button1.Location = new System.Drawing.Point(56, 128);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 4;
this.button1.Text = "Processar &1";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(91, 103);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(0, 13);
this.label4.TabIndex = 3;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(17, 103);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(32, 13);
this.label3.TabIndex = 2;
this.label3.Text = "Área:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(17, 68);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(71, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Comprimento:";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(17, 33);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(46, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Largura:";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.textBox4);
this.groupBox2.Controls.Add(this.textBox3);
this.groupBox2.Controls.Add(this.button2);
this.groupBox2.Controls.Add(this.label8);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Controls.Add(this.label5);
this.groupBox2.Location = new System.Drawing.Point(236, 12);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(200, 162);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Casa 2";
//
// textBox4
//
this.textBox4.Location = new System.Drawing.Point(96, 65);
this.textBox4.MaxLength = 5;
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(67, 20);
this.textBox4.TabIndex = 6;
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(96, 30);
this.textBox3.MaxLength = 5;
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(67, 20);
this.textBox3.TabIndex = 5;
//
// button2
//
this.button2.BackColor = System.Drawing.Color.SkyBlue;
this.button2.Location = new System.Drawing.Point(64, 128);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75,
23);
this.button2.TabIndex = 4;
this.button2.Text = "Processar &2";
this.button2.UseVisualStyleBackColor = false;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(93, 103);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(0, 13);
this.label8.TabIndex = 3;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(19, 103);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(32, 13);
this.label7.TabIndex = 2;
this.label7.Text = "Área:";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(19, 68);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(71, 13);
this.label6.TabIndex = 1;
this.label6.Text = "Comprimento:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(19, 33);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(46, 13);
this.label5.TabIndex = 0;
this.label5.Text = "Largura:";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(29, 188);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(62, 13);
this.label9.TabIndex = 2;
this.label9.Text = "Maior casa:";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(97, 188);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(0, 13);
this.label10.TabIndex = 3;
//
// button3
//
this.button3.AutoSize = true;
this.button3.BackColor = System.Drawing.Color.SkyBlue;
this.button3.Location = new System.Drawing.Point(68, 232);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(84, 23);
this.button3.TabIndex = 4;
this.button3.Text = "&Verificar Maior";
this.button3.UseVisualStyleBackColor = false;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button4
//
this.button4.BackColor = System.Drawing.Color.SkyBlue;
this.button4.Location = new System.Drawing.Point(188, 232);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(75, 23);
this.button4.TabIndex = 5;
this.button4.Text = "&Limpar";
this.button4.UseVisualStyleBackColor = false;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// button5
//
this.button5.BackColor = System.Drawing.Color.SkyBlue;
this.button5.Location = new System.Drawing.Point(300, 232);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(75, 23);
this.button5.TabIndex = 6;
this.button5.Text = "&Sair";
this.button5.UseVisualStyleBackColor = false;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Desktop;
this.ClientSize = new System.Drawing.Size(449, 273);
this.Controls.Add(this.button5);
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.label10);
this.Controls.Add(this.label9);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Programa área de casa";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.TextBox textBox3;
}
}
Aula12 - Condicional/Programa �rea de casas/Aula12/Form1.resx
text/microsoft-resx
2.0
System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Aula12 - Condicional/Programa �rea de casas/Aula12/obj/Debug/Aula12.csproj.FileListAbsolute.txt
C:\Users\13099593\Documents\Aula12\Aula12\bin\Debug\Aula12.exe.config
C:\Users\13099593\Documents\Aula12\Aula12\bin\Debug\Aula12.exe
C:\Users\13099593\Documents\Aula12\Aula12\bin\Debug\Aula12.pdb
C:\Users\13099593\Documents\Aula12\Aula12\obj\Debug\Aula12.csprojResolveAssemblyReference.cache
C:\Users\13099593\Documents\Aula12\Aula12\obj\Debug\Aula12.Form1.resources
C:\Users\13099593\Documents\Aula12\Aula12\obj\Debug\Aula12.Properties.Resources.resources
C:\Users\13099593\Documents\Aula12\Aula12\obj\Debug\Aula12.csproj.GenerateResource.Cache
C:\Users\13099593\Documents\Aula12\Aula12\obj\Debug\Aula12.exe
C:\Users\13099593\Documents\Aula12\Aula12\obj\Debug\Aula12.pdb
Aula12 - Condicional/Programa �rea de casas/Aula12/obj/Debug/Aula12.csproj.GenerateResource.Cache
Aula12 - Condicional/Programa �rea de casas/Aula12/obj/Debug/Aula12.csprojResolveAssemblyReference.cache
Aula12 - Condicional/Programa �rea de casas/Aula12/obj/Debug/Aula12.exe
Aula12 - Condicional/Programa �rea de casas/Aula12/obj/Debug/Aula12.Form1.resources
Aula12 - Condicional/Programa �rea de casas/Aula12/obj/Debug/Aula12.pdb
Aula12 - Condicional/Programa �rea de casas/Aula12/obj/Debug/Aula12.Properties.Resources.resources
Aula12 - Condicional/Programa �rea de casas/Aula12/obj/Debug/DesignTimeResolveAssemblyReferences.cache
Aula12 - Condicional/Programa �rea de casas/Aula12/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Aula12 - Condicional/Programa �rea de casas/Aula12/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
Aula12 - Condicional/Programa �rea de casas/Aula12/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
Aula12 - Condicional/Programa �rea de casas/Aula12/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
Aula12 - Condicional/Programa �rea de casas/Aula12/Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Aula12
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
Aula12 - Condicional/Programa �rea de casas/Aula12/Properties/AssemblyInfo.cs
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Aula12")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Aula12")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("eeafe2c0-1b60-4d72-96c5-7c9199e3002c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Aula12 - Condicional/Programa �rea de casas/Aula12/Properties/Resources.Designer.cs
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18047
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Aula12.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Aula12.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
Aula12 - Condicional/Programa �rea de casas/Aula12/Properties/Resources.resx
text/microsoft-resx
2.0
System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Aula12 - Condicional/Programa �rea de casas/Aula12/Properties/Settings.Designer.cs
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18047
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Aula12.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings :
global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
Aula12 - Condicional/Programa �rea de casas/Aula12/Properties/Settings.settings
Aula12 - Condicional/Programa �rea de casas/Projeto.doc
Informática para Engenharia Puc-Campinas
Descrição do Projeto: Programa área de casas
Desenvolvido por: Igor Felisberto Magalhães
Data: 02/10/2013
Versão: 1.0
Layout do Formulário:
Objeto
Propriedades
Valor
Form1
Text
Programa área de casa
StartPosition
Centerscreen
BackColor
Desktop
GroupBox
Text
Casa 1
GroupBox
Text
Casa 2
Label1
Text
Largura:
Label2
Text
Comprimento:
Label3
Text
Área:
Label4
Text
Label5
Text
Largura:
Label6
Text
Comprimento:
Label7
Text
Área:
Label8
Text
Label9
Text
Maior casa:
Label10
Text
TextBox1
MaxLenght
5
TextBox2
MaxLenght
5
TextBox3
MaxLenght
5
TextBox4
MaxLenght
5
Button1
Text
Processar &1
BackColor
SkyBlue
Button2
Text
Processar &2
BackColor
SkyBlue
Button3
Text
&Verificar Maior
BackColor
SkyBlue
Button4
Text
&Limpar
BackColor
SkyBlue
Button5
Text
&Sair
BackColor
SkyBlue
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Aula12
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double A1, L1, C1;
// Declarar Variaveis
try // Inicio Usuário Bom
{
L1 = double.Parse(textBox1.Text);
C1 = double.Parse(textBox2.Text);
// Converte o texto para numero real
if (L1 <= 0 || C1 <= 0)
{
MessageBox.Show("Entradas inválidas \nDigite novamente !","Notas Inválidas",
MessageBoxButtons.OK,
MessageBoxIcon.Warning);
// Mensagem de erro
textBox1.Text = "";
textBox2.Text = "";
label4.Text = "";
// Limpar Entradas e Saidas
textBox1.Focus();
// Volta o cursor para textBox1
}
else
{
A1 = L1 * C1;
// Processamento
A1 = Math.Round(A1, 2);
// Arredonda M para 2 casas decimais.
label4.Text = A1.ToString();
// Converte numero real para texto
}// Fim usuário Bom
}
catch (Exception) // Inicio usuário Ruim
{
MessageBox.Show("Entradas inválidas", "ERRO",
MessageBoxButtons.OK, MessageBoxIcon.Error);
// Mensagem na tela
textBox1.Text = "";
textBox2.Text = "";
label4.Text = "";
// Limpar Entradas e Saidas
textBox1.Focus();
// Volta o cursor para textBox1
}// Fim usuário Ruim
}
private void button2_Click(object sender, EventArgs e)
{
double A2, L2, C2;
// Declarar Variaveis
try // Inicio Usuário Bom
{
L2 = double.Parse(textBox3.Text);
C2 = double.Parse(textBox4.Text);
// Converte o texto para numero real
if (L2 <= 0 || C2 <= 0)
{
MessageBox.Show("Entradas inválidas \nDigite novamente !", "Notas Inválidas",
MessageBoxButtons.OK,
MessageBoxIcon.Warning);
// Mensagem de erro
textBox3.Text = "";
textBox4.Text = "";
label8.Text = "";
// Limpar Entradas e Saidas
textBox2.Focus();
// Volta o cursor para textBox2
}
else
{
A2 = L2 * C2;
// Processamento
A2 = Math.Round(A2, 2);
// Arredonda M para 2 casas decimais.
label8.Text = A2.ToString();
// Converte numero real para texto
}// Fim usuário Bom
}
catch (Exception) // Inicio usuário Ruim
{
MessageBox.Show("Entradas inválidas", "ERRO",
MessageBoxButtons.OK, MessageBoxIcon.Error);
// Mensagem na tela
textBox3.Text = "";
textBox4.Text = "";
label8.Text = "";
// Limpar Entradas e Saidas
textBox2.Focus();
// Volta o cursor para textBox2
}// Fim usuário Ruim
}
private void button3_Click(object sender, EventArgs e)
{
double A1, A2;
// Declarar Variaveis
try // Inicio Usuário Bom
{
A1 = double.Parse(label4.Text);
A2 = double.Parse(label8.Text);
// Converte o texto para numero real
if (A1 > A2)
label10.Text = " A casa 1 tem a maior área ";
if (A1 < A2)
label10.Text = " A casa 2 tem a maior área ";
if (A1 == A2)
label10.Text = " A casa 1 e 2 tem a mesma área ";
}// Fim usuário Bom
catch (Exception) // Inicio usuário Ruim
{
MessageBox.Show("Entradas inválidas \nCalcule as área primeiro !", "Notas Inválidas",
MessageBoxButtons.OK,
MessageBoxIcon.Warning);
}
}
private void button4_Click(object sender, EventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
label4.Text = "";
label8.Text = "";
// Limpar Entradas e Saidas
textBox1.Focus();
// Volta o cursor para textBox1
}
private void button5_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Deseja mesmo terminar",
"Finalizando",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1) == DialogResult.Yes)
// pergunta se deseja mesmo terminar
{
Application.Exit();
// finaliza aplicação
}
}
}
}
�PAGE �
Projeto