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 EN VBS AVEC PLUSIEUR AUTRE OPTION ET CALCULE MAINTENANT LES EXPOSANTS (MIS À JOUR!!! IL N'Y A PU AUCUNE ERREUR...)


Information sur la source

Catégorie :VBScript Niveau : Initié Date de création : 04/06/2004 Date de mise à jour : 07/07/2004 18:42:11 Vu : 10 009

Note :
10 / 10 - par 1 personne
10,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10

Commentaire sur cette source (5)
Ajouter un commentaire et/ou une note

Description

calculatrice en vbs avec plusieur autre option et calcule maintenant les exposants (Mis à jour!!! Il N'y a pu aucune erreur...)
 

Source

  • On error resume next
  • do until que < 0
  • '**********************************************************************
  • 'variable
  • rien = ""
  • un = "1"
  • deux = "2"
  • troi = "3"
  • quatre = "4"
  • cinq = "5"
  • six = "6"
  • sept = "7"
  • huit = "8"
  • '**********************************************************************
  • com = InputBox ("Calculatrice (1), Aire, périmètre, circonférance, (2), Quitter (3),","Commande","")
  • do while com = rien
  • com = InputBox ("Calculatrice (1), Aire, périmètre, circonférance, (2), Quitter (3),","Commande","")
  • Loop
  • '**********************************************************************
  • If com = un then
  • '**********************************************************************
  • opt = InputBox ("Addition (1), Soustraction (2), Multiplication (3), Division (4), % d'un nombre (5), Exposant (6), Raçine carré (7), Retour (8)","calculatrice","")
  • do while opt = rien
  • opt = InputBox ("Addition (1), Soustraction (2), Multiplication (3), Division (4), % d'un nombre (5), Exposant (6), Raçine carré (7), Retour (8)","calculatrice","")
  • Loop
  • '***************************************
  • If opt = un then
  • 'Addition
  • num = InputBox ("1er nombre.")
  • num = num --InputBox ("2e nombre.")
  • MsgBox"La rep. est "&num&" .",vbinformation,"Calculatrice"
  • End If
  • '***************************************
  • If opt = deux then
  • 'Soustraction
  • num = InputBox ("1er nombre.")
  • num = num -InputBox ("2e nombre.")
  • MsgBox"La rep. est "&num&" .",vbinformation,"Calculatrice"
  • End If
  • '***************************************
  • If opt = troi then
  • 'Multiplication
  • num = InputBox ("1er nombre.")
  • num = num *InputBox ("2e nombre.")
  • MsgBox"La rep. est "&num&" .",vbinformation,"Calculatrice"
  • End If
  • '***************************************
  • If opt = quatre then
  • 'Division
  • num = InputBox ("1er nombre.")
  • num = num /InputBox ("2e nombre.")
  • MsgBox"La rep. est "&num&" .",vbinformation,"Calculatrice"
  • End If
  • '***************************************
  • If opt = cinq then
  • 'Pourcentage d'un nombre
  • argent = InputBox ("Nombre","Pourcentage d'un nombre.","")
  • pour = InputBox ("Pourcentage","Pourcentage d'un nombre.","")
  • pour = pour /100
  • argent = argent*pour
  • MsgBox"Le % de ce nombre est "&argent&" .",vbinformation,"Calculatrice"
  • End If
  • '***************************************
  • If opt = six then
  • 'exposant
  • a = InputBox ("1er nombre.","Calculatrice","")
  • b = InputBox ("2e nombre.","Calculatrice","")
  • c = a^b
  • MsgBox""&a&" exp."&b&" = "&c&"",vbinformation,"Calculatrice"
  • End if
  • '***************************************
  • If opt = sept then
  • 'Raçine Carré
  • a = InputBox ("Nombre dont tu veux extraire le raçine carré.","Calculatrice","")
  • b = a^0.5
  • MsgBox"La raçine carré du nombre "&a&" est "&b&".",vbinformation,"Calculatrice"
  • End If
  • '***************************************
  • If opt = huit then
  • End If
  • '***************************************
  • End If
  • '**********************************************************************
  • If com = deux then
  • '**********************************************************************
  • opt = InputBox ("Circonférance du cercle. (1), Aire du cerle. (2), Le rayon à partir de la circonférance (3), Le rayon à partir de l'aire (4), Retour (5)")
  • do while opt = rien
  • opt = InputBox ("Circonférance du cercle. (1), Aire du cerle. (2), Le rayon à partir de la circonférance (3), Le rayon à partir de l'aire (4), Retour (5)")
  • Loop
  • '*****************
  • If opt = un then
  • '*****************
  • 'Circonférance
  • pie = 3.1416
  • rayon = InputBox ("Rayon")
  • rayon = 2 * rayon
  • circ = rayon * pie
  • MsgBox"La Circonférance est "&circ&" .",vbinformation,"Calculatrice"
  • End If
  • '*****************
  • If opt = deux then
  • '*****************
  • 'Aire
  • pie = 3.1416
  • rayon = InputBox("Rayon")
  • rayon = rayon * rayon
  • aire = rayon * pie
  • MsgBox"L'air du cercle est "&aire&" .",vbinformation,"Calculatrice"
  • End If
  • '*****************
  • If opt = troi then
  • '*****************
  • 'Le rayon à partir de la circonférance
  • pie = 3.1416
  • circ = InputBox ("Circonférance")
  • circ = circ /2
  • circ = circ /pie
  • rayon = circ
  • MsgBox"Le rayon est "&rayon&" .",vbinformation,"Calculatrice"
  • End If
  • '*****************
  • If opt = quatre then
  • '*****************
  • 'Le rayon à partir de l aire
  • pie = 3.1416
  • aire = InputBox ("Aire")
  • aire = aire /pie
  • rayon = aire
  • a = rayon^0.5
  • MsgBox"Le rayon est "&a&" .",vbinformation,"Calculatrice"
  • End If
  • '*****************
  • If opt = cinq then
  • '*****************
  • End If
  • End If
  • '**********************************************************************
  • If com = troi then exit do
  • '**********************************************************************
  • Loop
On error resume next
do until que < 0
'**********************************************************************
'variable

rien   = ""
un     = "1"
deux   = "2"
troi   = "3"
quatre = "4"
cinq   = "5"
six    = "6"
sept   = "7"
huit   = "8"

'**********************************************************************

com = InputBox ("Calculatrice (1),                                                    Aire, périmètre, circonférance, (2),                          Quitter (3),","Commande","")
do while com = rien
com = InputBox ("Calculatrice (1),                                                    Aire, périmètre, circonférance, (2),                          Quitter (3),","Commande","")
Loop

'**********************************************************************
If com = un then
'**********************************************************************
opt = InputBox ("Addition (1),                                                    Soustraction (2),                                           Multiplication (3),                                            Division (4),                                                           % d'un nombre (5),                                                Exposant (6),                                                        Raçine carré (7),                                               Retour (8)","calculatrice","")
do while opt = rien
opt = InputBox ("Addition (1),                                                    Soustraction (2),                                           Multiplication (3),                                            Division (4),                                                           % d'un nombre (5),                                                Exposant (6),                                                        Raçine carré (7),                                               Retour (8)","calculatrice","")
Loop
'***************************************
If opt = un then
'Addition
num = InputBox ("1er nombre.")
num = num --InputBox ("2e nombre.")
MsgBox"La rep. est "&num&" .",vbinformation,"Calculatrice"
End If
'***************************************
If opt = deux then
'Soustraction
num = InputBox ("1er nombre.")
num = num -InputBox ("2e nombre.")
MsgBox"La rep. est "&num&" .",vbinformation,"Calculatrice"
End If
'***************************************
If opt = troi then
'Multiplication
num = InputBox ("1er nombre.")
num = num *InputBox ("2e nombre.")
MsgBox"La rep. est "&num&" .",vbinformation,"Calculatrice"
End If
'***************************************
If opt = quatre then
'Division
num = InputBox ("1er nombre.")
num = num /InputBox ("2e nombre.")
MsgBox"La rep. est "&num&" .",vbinformation,"Calculatrice"
End If
'***************************************
If opt = cinq then
'Pourcentage d'un nombre
argent = InputBox ("Nombre","Pourcentage d'un nombre.","")
pour = InputBox ("Pourcentage","Pourcentage d'un nombre.","")
pour = pour /100
argent = argent*pour
MsgBox"Le % de ce nombre est "&argent&" .",vbinformation,"Calculatrice"
End If
'***************************************
If opt = six then
'exposant
a = InputBox ("1er nombre.","Calculatrice","")
b = InputBox ("2e nombre.","Calculatrice","")
c = a^b
MsgBox""&a&" exp."&b&" = "&c&"",vbinformation,"Calculatrice"

End if
'***************************************
If opt = sept then
'Raçine Carré

a = InputBox ("Nombre dont tu veux extraire le raçine carré.","Calculatrice","")
b = a^0.5
MsgBox"La raçine carré du nombre "&a&" est "&b&".",vbinformation,"Calculatrice"

End If
'***************************************
If opt = huit then
End If
'***************************************
End If
'**********************************************************************
If com = deux then
'**********************************************************************
opt = InputBox ("Circonférance du cercle. (1),                               Aire du cerle. (2),                                                   Le rayon à partir de la circonférance (3),                 Le rayon à partir de l'aire (4),                             Retour (5)")
do while opt = rien
opt = InputBox ("Circonférance du cercle. (1),                               Aire du cerle. (2),                                                   Le rayon à partir de la circonférance (3),                 Le rayon à partir de l'aire (4),                             Retour (5)")
Loop
'*****************
If opt = un then
'*****************

'Circonférance
pie = 3.1416
rayon = InputBox ("Rayon")
rayon = 2 * rayon
circ = rayon * pie
MsgBox"La Circonférance est "&circ&" .",vbinformation,"Calculatrice"

End If

'*****************
If opt = deux then
'*****************

'Aire
pie = 3.1416
rayon = InputBox("Rayon")
rayon = rayon * rayon
aire = rayon * pie
MsgBox"L'air du cercle est "&aire&" .",vbinformation,"Calculatrice"

End If

'*****************
If opt = troi then
'*****************

'Le rayon à partir de la circonférance
pie = 3.1416
circ = InputBox ("Circonférance")
circ = circ /2
circ = circ /pie
rayon = circ
MsgBox"Le rayon est "&rayon&" .",vbinformation,"Calculatrice"

End If

'*****************
If opt = quatre then
'*****************

'Le rayon à partir de l aire
pie = 3.1416
aire = InputBox ("Aire")
aire = aire /pie
rayon = aire
a = rayon^0.5
MsgBox"Le rayon est "&a&" .",vbinformation,"Calculatrice"

End If

'*****************
If opt = cinq then
'*****************
End If
End If
'**********************************************************************
If com = troi then exit do
'**********************************************************************
Loop

Conclusion

Si vous voulez me proposer quelque chose ou m'écrire
mon e-mail est crocodile306@hotmail.com
 

Commentaires et avis

signaler à un administrateur
Commentaire de ouaton le 07/06/2004 16:48:44

c'est pas mal!!!

signaler à un administrateur
Commentaire de kickbar le 15/06/2004 19:59:45

je suis désolé mais ces avec les critiques que l'on avance
c'est mal coder ya aucune mise en forme une fois le script lancer on comprend presque rien a l'interieur
mais bon tout le monde et passé par la bravo si c'est un de tes premier code
esseye de faire une gestion des erreur de l utilisateur
et de mettre en forme t msgbox et inputbox

signaler à un administrateur
Commentaire de vbPink le 25/08/2006 01:35:34

"# com = InputBox ("Calculatrice (1), Aire, périmètre, circonférance, (2), Quitter (3),","Commande","")
# do while com = rien
# com = InputBox ("Calculatrice (1), Aire, périmètre, circonférance, (2), Quitter (3),","Commande","")
# Loop"

Ça, par exemple, c'est un peu inutile ;)

Tu aurais pu résumer à ça :

"Do
Com = InputBox ("Calculatrice (1), Aire, périmètre, circonférance, (2), Quitter (3),","Commande","")
Loop Until Len(Com) > 0"

signaler à un administrateur
Commentaire de kiki67100 le 17/01/2007 19:38:45

salut tout le monde la source et plutot pas mal
la gestion de l'utilisateur serais le bienvenue

signaler à un administrateur
Commentaire de kiki67100 le 05/02/2007 08:24:25

salut tout le monde la source et plutot pas mal
la gestion des erreur de l'utilisateur serais le bienvenue

Ajouter un commentaire



Nos sponsors

Sondage...

CalendriCode

Juillet 2009
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
2728293031  

Consulter la suite du CalendriCode

Comparez les prix Nouvelle version

Photothèque Nouveau !



Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés
Temps d'éxécution de la page : 0,312 sec

Google Coop CodeS-SourceS Google Coop CodeS-SourceS


Certaines images présentes sur le site (notament certains avatars) sont issues des collections IconShock, donc si vous souhaitez utiliser ces icons vous devez les acheter, ne les copiez pas et ne utilisez pas dans vos sites et applications sans les avoir commandé.