SlideShare a Scribd company logo
1 of 4
Exercice 1:
Public Class Form1
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim Montant As String
Dim Resultat As Double
Montant = TextBox1.Text
If Not IsNumeric(Montant) Then
MsgBox("Le montant doit être une valeur numérique")
ElseIf (CheckBox1.Checked = False) And (CheckBox2.Checked = False) Then
MsgBox("Aucun Choix entre Dollar et Dinar n'a été fait")
ElseIf (CheckBox1.Checked = True) And (CheckBox2.Checked = True) Then
MsgBox("Il faut choisir entre Dollar ou Dinar")
ElseIf (CheckBox1.Checked = True) Then
Label3.Text = " $ "
Label4.Text = "DT"
Resultat = Val(Montant) / 0.53732
TextBox2.Text = Resultat
Else
Label3.Text = "DT"
Label4.Text = "$"
Resultat = Val(Montant) * 0.53732
TextBox2.Text = Resultat
End If
End Sub
Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CheckBox2.CheckedChanged
If CheckBox2.Checked = True And CheckBox1.Checked = False Then
Label3.Text = "DT"
Label4.Text = "$"
ElseIf CheckBox2.Checked = False And CheckBox1.Checked = True Then
Label3.Text = "$"
Label4.Text = "DT"
ElseIf (CheckBox2.Checked = False) And (CheckBox1.Checked = False) Then
Label3.Text = ""
Label4.Text = ""
TextBox2.Text = ""
MsgBox("Aucun Choix entre Dollar et Dinar n'a été fait")
ElseIf (CheckBox2.Checked = True) And (CheckBox1.Checked = True) Then
Label3.Text = ""
Label4.Text = ""
TextBox2.Text = ""
MsgBox("Il faut choisir entre Dollar ou Dinar")
End If
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked = True And CheckBox2.Checked = False Then
Label3.Text = "$"
Label4.Text = "DT"
ElseIf CheckBox1.Checked = False And CheckBox2.Checked = True Then
Label3.Text = "DT"
Label4.Text = "$"
ElseIf (CheckBox1.Checked = False) And (CheckBox2.Checked = False) Then
Label3.Text = ""
Label4.Text = ""
TextBox2.Text = ""
MsgBox("Aucun Choix entre Dollar et Dinar n'a été fait")
ElseIf (CheckBox1.Checked = True) And (CheckBox2.Checked = True) Then
Label3.Text = ""
Label4.Text = ""
TextBox2.Text = ""
MsgBox("Il faut choisir entre Dollar ou Dinar")
End If
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox1.TextChanged
End Sub
End Class
Exercice 2:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim parfait As Boolean
Dim reel As String
parfait = False
If Not IsNumeric(TextBox1.Text) Then
MsgBox("La partie entière doit être numérique")
ElseIf Val(TextBox1.Text) < 0 Then
MsgBox("La partie entière doit être positive")
ElseIf Not IsNumeric(TextBox2.Text) Then
MsgBox("La partie décimale doit être numérique")
ElseIf Val(TextBox2.Text) < 0 Then
MsgBox("La partie décimale doit être positive")
Else
parfait = True
End If
If (parfait = True) Then
If (RadioButton1.Checked = True) Then
reel = TextBox1.Text & "," & TextBox2.Text
TextBox3.Text = reel
Else
reel = "-" & TextBox1.Text & "," & TextBox2.Text
TextBox3.Text = reel
End If
End If
End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles RadioButton1.CheckedChanged
TextBox3.Text = ""
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles RadioButton2.CheckedChanged
TextBox3.Text = ""
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox1.TextChanged
TextBox3.Text = ""
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox2.TextChanged
TextBox3.Text = ""
End Sub
End Class
Exercice 3:
Public Class Form1
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles RadioButton1.CheckedChanged
If RadioButton1.Checked = True Then
Button2.Text = "Calculer Moyenne"
Label2.Text = "Moyenne:"
TextBox2.Text = ""
End If
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles RadioButton2.CheckedChanged
If RadioButton2.Checked = True Then
Button2.Text = "Calculer Minimum"
Label2.Text = "Minimum:"
TextBox2.Text = ""
End If
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles RadioButton3.CheckedChanged
If RadioButton3.Checked = True Then
Button2.Text = "Calculer Maximum"
Label2.Text = "Maximum:"
TextBox2.Text = ""
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim N As String
Dim note As String
ComboBox1.Items.Clear()
TextBox2.Text = ""
N = TextBox1.Text
If Not IsNumeric(N) Then
MsgBox("Le nombre d'étudiants doit être une valeur numérique")
ElseIf Val(N) < 1 Then
MsgBox("Le nombre d'étudiants doit être une valeur positive")
Else
For i = 1 To Val(N)
Do
note = InputBox("Donner la note de l'étudiant numéro" & i)
Loop Until (IsNumeric(note)) And (Val(note) >= 0) And (Val(note) <=
20)
ComboBox1.Items.Insert(i - 1, note)
Next
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim moyenne, somme, min, max As Double
If ComboBox1.Items.Count = 0 Then
MsgBox("La liste ne contient aucun élément")
Else
If (RadioButton1.Checked = True) Then
somme = 0
For j = 0 To (ComboBox1.Items.Count - 1)
somme = somme + ComboBox1.Items(j)
Next
moyenne = somme / ComboBox1.Items.Count
TextBox2.Text = moyenne
ElseIf (RadioButton2.Checked = True) Then
Min = ComboBox1.Items(0)
For j = 1 To (ComboBox1.Items.Count - 1)
If (min > ComboBox1.Items(j)) Then
min = ComboBox1.Items(j)
End If
Next
TextBox2.Text = min
Else
max = ComboBox1.Items(0)
For j = 1 To (ComboBox1.Items.Count - 1)
If (max < ComboBox1.Items(j)) Then
max = ComboBox1.Items(j)
End If
Next
TextBox2.Text = max
End If
End If
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox1.TextChanged
ComboBox1.Items.Clear()
TextBox2.Text = ""
End Sub
End Class

More Related Content

What's hot (16)

Sistema de ventas
Sistema de ventasSistema de ventas
Sistema de ventas
 
Introj Query Pt2
Introj Query Pt2Introj Query Pt2
Introj Query Pt2
 
Visual Studio.Net - Sql Server
Visual Studio.Net - Sql ServerVisual Studio.Net - Sql Server
Visual Studio.Net - Sql Server
 
Dr Jammi Ashok - Introduction to Java Material (OOPs)
 Dr Jammi Ashok - Introduction to Java Material (OOPs) Dr Jammi Ashok - Introduction to Java Material (OOPs)
Dr Jammi Ashok - Introduction to Java Material (OOPs)
 
Reservasi hotel
Reservasi hotelReservasi hotel
Reservasi hotel
 
Código Acerca Editor_Net
Código Acerca Editor_NetCódigo Acerca Editor_Net
Código Acerca Editor_Net
 
Vs c# lecture11
Vs c# lecture11Vs c# lecture11
Vs c# lecture11
 
Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2
 
Chapter 11.5
Chapter 11.5Chapter 11.5
Chapter 11.5
 
Database connectivity with data reader by varun tiwari
Database connectivity with data reader by varun tiwariDatabase connectivity with data reader by varun tiwari
Database connectivity with data reader by varun tiwari
 
PROGRAMA DE EJEMPLO
PROGRAMA DE EJEMPLOPROGRAMA DE EJEMPLO
PROGRAMA DE EJEMPLO
 
Event handling in Java(part 1)
Event handling in Java(part 1)Event handling in Java(part 1)
Event handling in Java(part 1)
 
Java eventhandling
Java eventhandlingJava eventhandling
Java eventhandling
 
Event handling
Event handlingEvent handling
Event handling
 
Advance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handlingAdvance Java Programming(CM5I) Event handling
Advance Java Programming(CM5I) Event handling
 
Aplikasi rawat-inap-vbnet
Aplikasi rawat-inap-vbnetAplikasi rawat-inap-vbnet
Aplikasi rawat-inap-vbnet
 

Viewers also liked (13)

Bab iii
Bab iiiBab iii
Bab iii
 
Thesis_TB_Jan2016
Thesis_TB_Jan2016Thesis_TB_Jan2016
Thesis_TB_Jan2016
 
Thesis_TB_Jan2016
Thesis_TB_Jan2016Thesis_TB_Jan2016
Thesis_TB_Jan2016
 
Bab ii
Bab iiBab ii
Bab ii
 
InsideICP_121411_calcine
InsideICP_121411_calcineInsideICP_121411_calcine
InsideICP_121411_calcine
 
prova
provaprova
prova
 
Les friandises Arena
Les friandises ArenaLes friandises Arena
Les friandises Arena
 
Daftar isi
Daftar isiDaftar isi
Daftar isi
 
Petit dejeuner
Petit dejeunerPetit dejeuner
Petit dejeuner
 
Bab iv
Bab ivBab iv
Bab iv
 
Le repas de noel
Le repas de noelLe repas de noel
Le repas de noel
 
Kata pengantar
Kata pengantarKata pengantar
Kata pengantar
 
Christine Beltran's Art Portfolio
Christine Beltran's Art PortfolioChristine Beltran's Art Portfolio
Christine Beltran's Art Portfolio
 

Similar to Correction s+ rie_vb

DOT NET LAB PROGRAM PERIYAR UNIVERSITY
DOT NET LAB PROGRAM PERIYAR UNIVERSITYDOT NET LAB PROGRAM PERIYAR UNIVERSITY
DOT NET LAB PROGRAM PERIYAR UNIVERSITYGOKUL SREE
 
Latihan visual basic 2010/Looping/Perulangan
Latihan visual basic 2010/Looping/PerulanganLatihan visual basic 2010/Looping/Perulangan
Latihan visual basic 2010/Looping/PerulanganNurul Arhaiyyu
 
Inventory management
Inventory managementInventory management
Inventory managementRajeev Sharan
 
Ejercicio sql server vs visual .net
Ejercicio sql server vs visual .netEjercicio sql server vs visual .net
Ejercicio sql server vs visual .netAyuda Universidad
 
Ensayo Convergencia Informatica
Ensayo Convergencia InformaticaEnsayo Convergencia Informatica
Ensayo Convergencia Informaticamiguel camelo
 
Membuat aplikasi penjualan buku sederhana
Membuat aplikasi penjualan buku sederhanaMembuat aplikasi penjualan buku sederhana
Membuat aplikasi penjualan buku sederhanaYusman Kurniadi
 
Ejercicio de Visual Basic IF THEN ELSE
Ejercicio de Visual Basic IF THEN ELSEEjercicio de Visual Basic IF THEN ELSE
Ejercicio de Visual Basic IF THEN ELSERicardoGuti50
 
Linear Search Program in Visual Basic 2008
Linear Search Program in Visual Basic 2008Linear Search Program in Visual Basic 2008
Linear Search Program in Visual Basic 2008atsumagaysay
 
Christian rodriguez then else
Christian rodriguez then   elseChristian rodriguez then   else
Christian rodriguez then elsegabo2200
 
Federico landinez docx
Federico landinez docxFederico landinez docx
Federico landinez docxgabo2200
 
Federico landinez docx
Federico landinez docxFederico landinez docx
Federico landinez docxgabo2200
 
Guevara rene if then., else
Guevara rene  if then., elseGuevara rene  if then., else
Guevara rene if then., elsegabo2200
 
Federico landinez docx
Federico landinez docxFederico landinez docx
Federico landinez docxgabo2200
 

Similar to Correction s+ rie_vb (20)

DOT NET LAB PROGRAM PERIYAR UNIVERSITY
DOT NET LAB PROGRAM PERIYAR UNIVERSITYDOT NET LAB PROGRAM PERIYAR UNIVERSITY
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
 
.net progrmming part4
.net progrmming part4.net progrmming part4
.net progrmming part4
 
Latihan visual basic 2010/Looping/Perulangan
Latihan visual basic 2010/Looping/PerulanganLatihan visual basic 2010/Looping/Perulangan
Latihan visual basic 2010/Looping/Perulangan
 
Inventory management
Inventory managementInventory management
Inventory management
 
Ejercicio sql server vs visual .net
Ejercicio sql server vs visual .netEjercicio sql server vs visual .net
Ejercicio sql server vs visual .net
 
Colegio municipal
Colegio municipalColegio municipal
Colegio municipal
 
Ensayo Convergencia Informatica
Ensayo Convergencia InformaticaEnsayo Convergencia Informatica
Ensayo Convergencia Informatica
 
Trabajo de case
Trabajo de caseTrabajo de case
Trabajo de case
 
Calculator code
Calculator codeCalculator code
Calculator code
 
Docimp
DocimpDocimp
Docimp
 
Membuat aplikasi penjualan buku sederhana
Membuat aplikasi penjualan buku sederhanaMembuat aplikasi penjualan buku sederhana
Membuat aplikasi penjualan buku sederhana
 
VB net lab.pdf
VB net lab.pdfVB net lab.pdf
VB net lab.pdf
 
Ejercicio de Visual Basic IF THEN ELSE
Ejercicio de Visual Basic IF THEN ELSEEjercicio de Visual Basic IF THEN ELSE
Ejercicio de Visual Basic IF THEN ELSE
 
Trabajo de case
Trabajo de caseTrabajo de case
Trabajo de case
 
Linear Search Program in Visual Basic 2008
Linear Search Program in Visual Basic 2008Linear Search Program in Visual Basic 2008
Linear Search Program in Visual Basic 2008
 
Christian rodriguez then else
Christian rodriguez then   elseChristian rodriguez then   else
Christian rodriguez then else
 
Federico landinez docx
Federico landinez docxFederico landinez docx
Federico landinez docx
 
Federico landinez docx
Federico landinez docxFederico landinez docx
Federico landinez docx
 
Guevara rene if then., else
Guevara rene  if then., elseGuevara rene  if then., else
Guevara rene if then., else
 
Federico landinez docx
Federico landinez docxFederico landinez docx
Federico landinez docx
 

Recently uploaded

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Recently uploaded (20)

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Correction s+ rie_vb

  • 1. Exercice 1: Public Class Form1 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Montant As String Dim Resultat As Double Montant = TextBox1.Text If Not IsNumeric(Montant) Then MsgBox("Le montant doit être une valeur numérique") ElseIf (CheckBox1.Checked = False) And (CheckBox2.Checked = False) Then MsgBox("Aucun Choix entre Dollar et Dinar n'a été fait") ElseIf (CheckBox1.Checked = True) And (CheckBox2.Checked = True) Then MsgBox("Il faut choisir entre Dollar ou Dinar") ElseIf (CheckBox1.Checked = True) Then Label3.Text = " $ " Label4.Text = "DT" Resultat = Val(Montant) / 0.53732 TextBox2.Text = Resultat Else Label3.Text = "DT" Label4.Text = "$" Resultat = Val(Montant) * 0.53732 TextBox2.Text = Resultat End If End Sub Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged If CheckBox2.Checked = True And CheckBox1.Checked = False Then Label3.Text = "DT" Label4.Text = "$" ElseIf CheckBox2.Checked = False And CheckBox1.Checked = True Then Label3.Text = "$" Label4.Text = "DT" ElseIf (CheckBox2.Checked = False) And (CheckBox1.Checked = False) Then Label3.Text = "" Label4.Text = "" TextBox2.Text = "" MsgBox("Aucun Choix entre Dollar et Dinar n'a été fait") ElseIf (CheckBox2.Checked = True) And (CheckBox1.Checked = True) Then Label3.Text = "" Label4.Text = "" TextBox2.Text = "" MsgBox("Il faut choisir entre Dollar ou Dinar") End If End Sub Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged If CheckBox1.Checked = True And CheckBox2.Checked = False Then Label3.Text = "$" Label4.Text = "DT"
  • 2. ElseIf CheckBox1.Checked = False And CheckBox2.Checked = True Then Label3.Text = "DT" Label4.Text = "$" ElseIf (CheckBox1.Checked = False) And (CheckBox2.Checked = False) Then Label3.Text = "" Label4.Text = "" TextBox2.Text = "" MsgBox("Aucun Choix entre Dollar et Dinar n'a été fait") ElseIf (CheckBox1.Checked = True) And (CheckBox2.Checked = True) Then Label3.Text = "" Label4.Text = "" TextBox2.Text = "" MsgBox("Il faut choisir entre Dollar ou Dinar") End If End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged End Sub End Class Exercice 2: Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim parfait As Boolean Dim reel As String parfait = False If Not IsNumeric(TextBox1.Text) Then MsgBox("La partie entière doit être numérique") ElseIf Val(TextBox1.Text) < 0 Then MsgBox("La partie entière doit être positive") ElseIf Not IsNumeric(TextBox2.Text) Then MsgBox("La partie décimale doit être numérique") ElseIf Val(TextBox2.Text) < 0 Then MsgBox("La partie décimale doit être positive") Else parfait = True End If If (parfait = True) Then If (RadioButton1.Checked = True) Then reel = TextBox1.Text & "," & TextBox2.Text TextBox3.Text = reel Else reel = "-" & TextBox1.Text & "," & TextBox2.Text TextBox3.Text = reel End If End If End Sub Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged TextBox3.Text = "" End Sub Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged TextBox3.Text = "" End Sub
  • 3. Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged TextBox3.Text = "" End Sub Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged TextBox3.Text = "" End Sub End Class Exercice 3: Public Class Form1 Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged If RadioButton1.Checked = True Then Button2.Text = "Calculer Moyenne" Label2.Text = "Moyenne:" TextBox2.Text = "" End If End Sub Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged If RadioButton2.Checked = True Then Button2.Text = "Calculer Minimum" Label2.Text = "Minimum:" TextBox2.Text = "" End If End Sub Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged If RadioButton3.Checked = True Then Button2.Text = "Calculer Maximum" Label2.Text = "Maximum:" TextBox2.Text = "" End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim N As String Dim note As String ComboBox1.Items.Clear() TextBox2.Text = "" N = TextBox1.Text If Not IsNumeric(N) Then MsgBox("Le nombre d'étudiants doit être une valeur numérique") ElseIf Val(N) < 1 Then MsgBox("Le nombre d'étudiants doit être une valeur positive") Else For i = 1 To Val(N) Do note = InputBox("Donner la note de l'étudiant numéro" & i)
  • 4. Loop Until (IsNumeric(note)) And (Val(note) >= 0) And (Val(note) <= 20) ComboBox1.Items.Insert(i - 1, note) Next End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim moyenne, somme, min, max As Double If ComboBox1.Items.Count = 0 Then MsgBox("La liste ne contient aucun élément") Else If (RadioButton1.Checked = True) Then somme = 0 For j = 0 To (ComboBox1.Items.Count - 1) somme = somme + ComboBox1.Items(j) Next moyenne = somme / ComboBox1.Items.Count TextBox2.Text = moyenne ElseIf (RadioButton2.Checked = True) Then Min = ComboBox1.Items(0) For j = 1 To (ComboBox1.Items.Count - 1) If (min > ComboBox1.Items(j)) Then min = ComboBox1.Items(j) End If Next TextBox2.Text = min Else max = ComboBox1.Items(0) For j = 1 To (ComboBox1.Items.Count - 1) If (max < ComboBox1.Items(j)) Then max = ComboBox1.Items(j) End If Next TextBox2.Text = max End If End If End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged ComboBox1.Items.Clear() TextBox2.Text = "" End Sub End Class