29 de outubro de 2023

Faça você mesmo uma calculadora virtual

Você pode fazer uma calculadora virtual básica. Ela pode somar, subtrair, multiplicar e dividir. Primeiro ela irá perguntar se quer somar, se não quiser aperte não, e ela perguntará se quer subtrair, e assim por diante.
Abra o bloco de notas e digite:

Dim a,b,c,d,e,f,g,h,i,j,k,l
a=msgbox(”Você quer somar?”,vbYesNo)
if a =vbYes then
b=inputbox (”Digite o Primeiro Valor”)
c=inputbox (”Digite o Segundo Valor”)
msgbox b*1+c
else
d=msgbox(”Você quer subtrair?”,vbyesNo)
if d =vbYes then
e=inputbox (”Digite o Primeiro Valor”)
f=inputbox (”Digite o Segundo Valor”)
msgbox e-f
else
g=msgbox(”Você quer multiplicar?”,vbYesNo)
if g =vbYes then
h=inputbox (”Digite o Primeiro Valor”)
i=inputbox(”Digite o Segundo Valor”)
msgbox h*i
else
j=msgbox(”Você quer dividir?”,vbYesNo)
if j=vbYes then
k=inputbox (”Digite o Primeiro Valor”)
l=inputbox(”Digite o Segundo Valor”)
msgbox k/l
end if
end if
end if
end if

Depois salve em .vbs

Nenhum comentário: