|
Trouver une ressource
Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum. Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !
CALCUL DU TAUX D'ALCOOLEMIE
Information sur la source
Description
Calcul du taux d'alcoolemie en fonction du sexe et du poids du sujet et nombre d'heure de récupération
Source
- ' Conçu avec SharpDevelop 2.2.1
- ' Programmeur : DODICH
- ' Date : Décembre 2007
- '
- '
- Imports System.Math
- Imports System.DateTime
- Imports System.Drawing.Color
-
-
- Public Partial Class MainForm
-
- Dim ToolTip1 As New ToolTip
- Dim A, B, C, D, E As Decimal 'Variable alcool et total
- Dim K As Decimal 'Homme = 0.7 / Femme = 0.6
- Dim M As Integer 'Poids
- Dim T, R As Decimal 'T: Taux, R: Récup
-
- Public Sub New()
-
- Me.InitializeComponent()
- 'Affichage des infos sur les images
- ToolTip1.SetToolTip(Me.PictureBox1, "Calculer le taux d'alcoolémie")
- ToolTip1.SetToolTip(Me.PictureBox2, "Ajouter une bière")
- ToolTip1.SetToolTip(Me.PictureBox3, "Ajouter un verre de vin")
- ToolTip1.SetToolTip(Me.PictureBox4, "Ajouter un verre de vin")
- ToolTip1.SetToolTip(Me.PictureBox5, "Ajouter une dose d'alcool fort")
- ToolTip1.SetToolTip(Me.PictureBox6, "Ajouter une dose d'alcool doux")
- ToolTip1.SetToolTip(Me.PictureBox7, "Ajouter une dose d'alcool fort")
- ToolTip1.SetToolTip(Me.PictureBox10, "Afficher l'aide")
- K = 0.7
- M = 80
-
- End Sub
-
- Sub PictureBox1Click(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- Alcoolemie()
-
- End Sub
-
- Sub Alcoolemie
-
- On Error Resume Next
-
- E = A + B + C + D 'Total des consommation
- TextBox5.Text = E
- If radioButton1.Checked = True Then K = 0.7 'Homme
- If radioButton2.Checked = True Then K = 0.6 'Femme
-
- TextBox6.Text = (E * 0.8) / (K * M) 'Formule alcoolemie
- T = TextBox6.Text
- Label14.Text = Math.Round(T, 2) 'Arrondi 2 chiffres après la virgule
-
- R = Label14.Text - 0.5
- TextBox7.Text = R / 0.15 * 60 'Alcool à évacuer
- If TextBox7.Text < 0 Then TextBox7.Text = 0
-
- Dim Heure As String
- Heure = Int(TextBox7.Text / 60) & " heure(s) et " & TextBox7.Text Mod 60 & " minute(s)"
- Label17.Text = Heure 'Affichage du nombre d'heure(s) pour récupérer
-
- If TextBox7.Text < 0.5 Then
- 'Affichage du texte en bleu ou en rouge
- Label14.ForeColor = System.Drawing.Color.SteelBlue
- Label15.ForeColor = System.Drawing.Color.SteelBlue
- Label17.Visible = False
- Else
- Label14.ForeColor = System.Drawing.Color.Firebrick
- Label15.ForeColor = System.Drawing.Color.Firebrick
- Label17.Visible = True
- End If
-
- End Sub
-
- Sub NumericUpDown4ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- TextBox1.Text = (numericUpDown4.Value * 250) * (numericUpDown7.Value / 100)
- A = TextBox1.Text 'valeur de 25cl de bière
-
- End Sub
-
- Sub NumericUpDown7ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- TextBox1.Text = (numericUpDown4.Value * 250) * (numericUpDown7.Value / 100)
- A = TextBox1.Text
-
- End Sub
-
- Sub NumericUpDown6ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- TextBox2.Text = (numericUpDown6.Value * 20) * (numericUpDown5.Value / 100)
- B = TextBox2.Text
-
- End Sub
-
- Sub NumericUpDown5ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- TextBox2.Text = (numericUpDown6.Value * 20) * (numericUpDown5.Value / 100)
- B = TextBox2.Text
-
- End Sub
-
- Sub NumericUpDown1ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- M = NumericUpDown1.Value
-
- End Sub
-
- Sub Timer1Tick(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- Label2.Text = Now.ToLongTimeString 'Affichage de l'heure
-
- End Sub
-
- Sub NumericUpDown9ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- TextBox3.Text = (numericUpDown9.Value * 100) * (numericUpDown8.Value / 100)
- C = TextBox3.Text
-
- End Sub
-
- Sub NumericUpDown8ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- TextBox3.Text = (numericUpDown9.Value * 100) * (numericUpDown8.Value / 100)
- C = TextBox3.Text
-
- End Sub
-
- Sub NumericUpDown11ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- TextBox4.Text = (numericUpDown11.Value * 60) * (numericUpDown10.Value / 100)
- D = TextBox4.Text
-
- End Sub
-
- Sub NumericUpDown10ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- TextBox4.Text = (numericUpDown11.Value * 60) * (numericUpDown10.Value / 100)
- D = TextBox4.Text
-
- End Sub
-
- Sub PictureBox2Click(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- numericUpDown4.Value = numericUpDown4.Value + 1
-
- End Sub
-
- Sub PictureBox3Click(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- numericUpDown9.Value = numericUpDown9.Value + 1
-
- End Sub
-
- Sub PictureBox4Click(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- numericUpDown9.Value = numericUpDown9.Value + 1
-
- End Sub
-
- Sub PictureBox5Click(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- numericUpDown6.Value = numericUpDown6.Value + 1
-
- End Sub
-
- Sub PictureBox7Click(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- numericUpDown6.Value = numericUpDown6.Value + 1
-
- End Sub
-
- Sub PictureBox6Click(ByVal sender As Object, ByVal e As EventArgs)
-
- On Error Resume Next
-
- numericUpDown11.Value = numericUpDown11.Value + 1
-
- End Sub
-
- Sub PictureBox10Click(ByVal sender As Object, ByVal e As EventArgs)
-
- PictureBox8.Visible = True 'Affichage de l'aide
-
- End Sub
-
- Sub PictureBox8Click(ByVal sender As Object, ByVal e As EventArgs)
-
- PictureBox8.Visible = False 'Masquer l'aide
-
- End Sub
-
- End Class
' Conçu avec SharpDevelop 2.2.1
' Programmeur : DODICH
' Date : Décembre 2007
'
'
Imports System.Math
Imports System.DateTime
Imports System.Drawing.Color
Public Partial Class MainForm
Dim ToolTip1 As New ToolTip
Dim A, B, C, D, E As Decimal 'Variable alcool et total
Dim K As Decimal 'Homme = 0.7 / Femme = 0.6
Dim M As Integer 'Poids
Dim T, R As Decimal 'T: Taux, R: Récup
Public Sub New()
Me.InitializeComponent()
'Affichage des infos sur les images
ToolTip1.SetToolTip(Me.PictureBox1, "Calculer le taux d'alcoolémie")
ToolTip1.SetToolTip(Me.PictureBox2, "Ajouter une bière")
ToolTip1.SetToolTip(Me.PictureBox3, "Ajouter un verre de vin")
ToolTip1.SetToolTip(Me.PictureBox4, "Ajouter un verre de vin")
ToolTip1.SetToolTip(Me.PictureBox5, "Ajouter une dose d'alcool fort")
ToolTip1.SetToolTip(Me.PictureBox6, "Ajouter une dose d'alcool doux")
ToolTip1.SetToolTip(Me.PictureBox7, "Ajouter une dose d'alcool fort")
ToolTip1.SetToolTip(Me.PictureBox10, "Afficher l'aide")
K = 0.7
M = 80
End Sub
Sub PictureBox1Click(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
Alcoolemie()
End Sub
Sub Alcoolemie
On Error Resume Next
E = A + B + C + D 'Total des consommation
TextBox5.Text = E
If radioButton1.Checked = True Then K = 0.7 'Homme
If radioButton2.Checked = True Then K = 0.6 'Femme
TextBox6.Text = (E * 0.8) / (K * M) 'Formule alcoolemie
T = TextBox6.Text
Label14.Text = Math.Round(T, 2) 'Arrondi 2 chiffres après la virgule
R = Label14.Text - 0.5
TextBox7.Text = R / 0.15 * 60 'Alcool à évacuer
If TextBox7.Text < 0 Then TextBox7.Text = 0
Dim Heure As String
Heure = Int(TextBox7.Text / 60) & " heure(s) et " & TextBox7.Text Mod 60 & " minute(s)"
Label17.Text = Heure 'Affichage du nombre d'heure(s) pour récupérer
If TextBox7.Text < 0.5 Then
'Affichage du texte en bleu ou en rouge
Label14.ForeColor = System.Drawing.Color.SteelBlue
Label15.ForeColor = System.Drawing.Color.SteelBlue
Label17.Visible = False
Else
Label14.ForeColor = System.Drawing.Color.Firebrick
Label15.ForeColor = System.Drawing.Color.Firebrick
Label17.Visible = True
End If
End Sub
Sub NumericUpDown4ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
TextBox1.Text = (numericUpDown4.Value * 250) * (numericUpDown7.Value / 100)
A = TextBox1.Text 'valeur de 25cl de bière
End Sub
Sub NumericUpDown7ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
TextBox1.Text = (numericUpDown4.Value * 250) * (numericUpDown7.Value / 100)
A = TextBox1.Text
End Sub
Sub NumericUpDown6ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
TextBox2.Text = (numericUpDown6.Value * 20) * (numericUpDown5.Value / 100)
B = TextBox2.Text
End Sub
Sub NumericUpDown5ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
TextBox2.Text = (numericUpDown6.Value * 20) * (numericUpDown5.Value / 100)
B = TextBox2.Text
End Sub
Sub NumericUpDown1ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
M = NumericUpDown1.Value
End Sub
Sub Timer1Tick(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
Label2.Text = Now.ToLongTimeString 'Affichage de l'heure
End Sub
Sub NumericUpDown9ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
TextBox3.Text = (numericUpDown9.Value * 100) * (numericUpDown8.Value / 100)
C = TextBox3.Text
End Sub
Sub NumericUpDown8ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
TextBox3.Text = (numericUpDown9.Value * 100) * (numericUpDown8.Value / 100)
C = TextBox3.Text
End Sub
Sub NumericUpDown11ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
TextBox4.Text = (numericUpDown11.Value * 60) * (numericUpDown10.Value / 100)
D = TextBox4.Text
End Sub
Sub NumericUpDown10ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
TextBox4.Text = (numericUpDown11.Value * 60) * (numericUpDown10.Value / 100)
D = TextBox4.Text
End Sub
Sub PictureBox2Click(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
numericUpDown4.Value = numericUpDown4.Value + 1
End Sub
Sub PictureBox3Click(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
numericUpDown9.Value = numericUpDown9.Value + 1
End Sub
Sub PictureBox4Click(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
numericUpDown9.Value = numericUpDown9.Value + 1
End Sub
Sub PictureBox5Click(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
numericUpDown6.Value = numericUpDown6.Value + 1
End Sub
Sub PictureBox7Click(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
numericUpDown6.Value = numericUpDown6.Value + 1
End Sub
Sub PictureBox6Click(ByVal sender As Object, ByVal e As EventArgs)
On Error Resume Next
numericUpDown11.Value = numericUpDown11.Value + 1
End Sub
Sub PictureBox10Click(ByVal sender As Object, ByVal e As EventArgs)
PictureBox8.Visible = True 'Affichage de l'aide
End Sub
Sub PictureBox8Click(ByVal sender As Object, ByVal e As EventArgs)
PictureBox8.Visible = False 'Masquer l'aide
End Sub
End Class
Sources de la même categorie
Sources en rapport avec celle ci
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
calcul du taux de rendemnt actuarial [ par sofy2006 ]
salut tt le monde j ai besoin de calculer le taux de rendement actuarial d'une obligation sous VB6 et je ne sais pas commentMErci
operateur sous acces et vb [ par ab2000 ]
salut!j'ai un petit problème avec un code que je n'arrive a lui trouve une syntaxe.en fait je faire des calcul avec des opérateur qui son referencie d
Affichage de +14 décimales [ par Rytox ]
Bonjour !!J'ai créé un programme qui calcul la valeur de Pi en rentrant le nombre de décimales à calculer mais le problème est qu'il n'affiche et n'en
Probléme en WinForms [ par baatoutmehdi ]
Salut,je vais aller droite au but,Là je suis en train de développer une application, en WinForms, de calcul de coûts des appels pour un opérateur télé
affichage en excel [ par debutant225 ]
bonjourj'ai un probleme je voudrai faire afficher dans une cellule le resultat d'un calcul. en fait quand je fais un calcul entre 2 cellules le resul
calcul scientifique avec excel 2003 en vba [ par nasilo ]
Bonjour,Est-il possible dans excel à l'aide de VBA de procéder à des calculs scientifiques du genre itérations complexestype par exemple comme :=-0.8
Besoin de maîtriser le multi-threading [ par baatoutmehdi ]
Bonjour à tous, En ce moment je suis en train de développer une application vb.net en WinForms de calcul de coûts Néanmoins, le programme est très l
manque d'un .exe [ par Sankaman61 ]
bonjour j'envoie ce message pour savoir pourquoi dans le logiciel sur le calcul de matèriaux qui à pour lien :http://www.vbfrance.com/code
|
Téléchargements
Logiciels à télécharger sur le même thème :
Comparez les prix Nouvelle version
|