begin process at 2008 08 22 05:57:45
1 229 779 membres
50 nouveaux aujourd'hui
14 267 membres club

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 !

CALCULATRICE POUR EMPRUNT À TAUX FIXE + TABLEAU D'AMORTISSEMENT


Information sur la source

Description

Un petit programme écrit lorsque j'avais besoin de contracter un emprunt à taux fixe pour acheter une maison.

Il comporte une forme principale, plus une secondaire pour le tableau d'amortissement, et une tertiaire d'info.

Je file en Source le contenu du boutton de commande principal, le reste peut être consulté dans les fichiers fournis dans le zip.

Merci pour vos commentaires et vos notations.

Bon développements à tous ;)

Source

  • 'Aquisition des informations
  • ca = Val(Text1)
  • n = Val(Text2)
  • tx = Val(Text3)
  • If tx = 0 Then tx = 0.0000001
  • txm = tx / 100 / 12
  • 'Amortissement le 1er mois
  • a(1) = ca * txm / ((1 + txm) ^ n - 1)
  • 'Intérêt 1er mois
  • i(1) = ca * txm
  • 'somme prélevée mensuelle
  • pr = i(1) + a(1)
  • 'Début de la boucle du tableau d'amortissement
  • c(1) = ca
  • ttint = 0
  • For xx = 2 To n
  • c(xx) = c(xx - 1) - a(xx - 1)
  • i(xx) = c(xx) * txm
  • a(xx) = pr - i(xx)
  • ttint = ttint + i(xx)
  • Next xx
  • derr = a(n) - c(n)
  • a(n) = c(n)
  • i(n) = i(n) + derr
  • If tx = 0.000001 Then
  • i(1) = 0
  • For xx = 2 To n
  • a(xx) = c(1) / n
  • i(xx) = 0
  • c(xx) = c(xx - 1) - a(xx)
  • Next xx
  • ttint = 0
  • derr = 0
  • a(n) = c(n)
  • End If
  • ttint = ttint + i(1) + derr
  • 'Affichage
  • Text4 = Int(ttint * 100 + 0.5) / 100
  • If Option1.Value = True Then
  • Text7 = Int((Val(Text6) * 100 / Val(Text1)) * 100) / 100
  • Else
  • Text6 = Int((Val(Text7) / 100 * Val(Text1)) * 100) / 100
  • End If
  • Text8 = Val(Text6) * Val(Text2)
  • Text5 = Int((pr + Val(Text6)) * 100 + 0.5) / 100
  • Text11 = Val(Text4) + Val(Text8)
  • 'Taux d'endettement
  • Label15 = Str$(Int(((Val(Text10) + Val(Text12) + Val(Text5)) * 100 / Val(Text9)) * 100) / 100)
  • If Val(Label15) < 33.1 Then
  • Label15.ForeColor = &H8000&
  • Else
  • Label15.ForeColor = &H80&
  • End If
  • deb = 1
  • fin = 2
'Aquisition des informations
ca = Val(Text1)
n = Val(Text2)
tx = Val(Text3)
If tx = 0 Then tx = 0.0000001
txm = tx / 100 / 12

'Amortissement le 1er mois
a(1) = ca * txm / ((1 + txm) ^ n - 1)

'Intérêt 1er mois
i(1) = ca * txm

'somme prélevée mensuelle
pr = i(1) + a(1)

'Début de la boucle du tableau d'amortissement
c(1) = ca
ttint = 0
For xx = 2 To n
    c(xx) = c(xx - 1) - a(xx - 1)
    i(xx) = c(xx) * txm
    a(xx) = pr - i(xx)
    ttint = ttint + i(xx)
Next xx

derr = a(n) - c(n)
a(n) = c(n)
i(n) = i(n) + derr

If tx = 0.000001 Then
    i(1) = 0
    For xx = 2 To n
        a(xx) = c(1) / n
        i(xx) = 0
        c(xx) = c(xx - 1) - a(xx)
    Next xx
    ttint = 0
    derr = 0
    a(n) = c(n)
End If

ttint = ttint + i(1) + derr


'Affichage
Text4 = Int(ttint * 100 + 0.5) / 100
If Option1.Value = True Then
    Text7 = Int((Val(Text6) * 100 / Val(Text1)) * 100) / 100
Else
    Text6 = Int((Val(Text7) / 100 * Val(Text1)) * 100) / 100
End If
Text8 = Val(Text6) * Val(Text2)
Text5 = Int((pr + Val(Text6)) * 100 + 0.5) / 100

Text11 = Val(Text4) + Val(Text8)


'Taux d'endettement
Label15 = Str$(Int(((Val(Text10) + Val(Text12) + Val(Text5)) * 100 / Val(Text9)) * 100) / 100)

If Val(Label15) < 33.1 Then
    Label15.ForeColor = &H8000&
Else
    Label15.ForeColor = &H80&
End If

deb = 1
fin = 2

Conclusion

Je donne rarement des noms aux objets et aux formes dans ce genre de petit programme que j'écris en moins d'une demi heure; je vous prie de bien vouloir m'excuser pour celà.

En espérant tout de même qu'il vous soit utile.
Amitiés
Pour les "Membres Club", vous pouvez télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip

    Aucun commentaire pour le moment.

Ajouter un commentaire

Discussions en rapport avec ce code source

Pub



Appels d'offres

Snippets en rapport

CalendriCode

Août 2008
LMMJVSD
    123
45678910
11121314151617
18192021222324
25262728293031

VS Express FR Gratuit !

VS Express en français et 100% gratuit !

Téléchargements

Logiciels à télécharger sur le même thème :

Boutique

Boutique de goodies CodeS-SourceS