Free VB? /\/\ my first phyton program

Questions about programming languages and debugging
Post Reply
eppik
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 212
Joined: 26 Mar 2006, 16:00
15
Location: Infinite Loop
Contact:

Free VB? /\/\ my first phyton program

Post by eppik »

Is there any free software to work in VB or is there just the microsoft on that costs hundreds of dollars.

plz do .not. make me get a crack or smthng....

-----------------------------------------------------------------------------------

So ive started phyton today and i decided to start easy so i made a program (in my main language portuguese) that claculates the areas and volumes of different poligons (rectangle, circle, triangle,piramids,cilinders,cubes[and other like cubes i dont know how to sai it in english] and others)

heres the script:

Code: Select all

# -*- coding: cp1252 -*-
# Print out the selector
print "Bem vindo ao programa de calculos aritmeticos"
print "_____________________________________________"
print "---------------------------------------------"
print "............................................."
print
print
print
print "Selecione os calculos que deseja efectuar"
print
print "1  Areas"
print "2  Volumes"

# Selecionador
modo = input ("> ")
if modo == 1:
    # Area Calculation program
    print
    print
    print "Bem vindo ao programa de calculo de areas"
    print "-------------------------------------------"
    print
    print
    # Print out the menu:
    print "Selecione o poligono"
    print "1  quadrado/rectangulo"
    print "2  circulo"
    print "3  triangulo equilatero"
    print "4  Paralelogramo"

    # Get the user's choice:
    poligon = input("> > > ")
    # Calculate the Volume:
    if poligon == 1:
        height =input("Insira a altura: ")
        width = input("Insira a largura: ")
        area = height*width
        print "The area is", area
    if poligon == 2:
        radius = input("Insira o Raio da circunferencia: ")
        area = 3.14* (radius**2)
        print "A Area do circulo e", area
    if poligon == 3:
        base = input("Insira a largura da base: ")
        altura = input("Insira a altura do triangulo: ")
        area = (base*altura)/2
        print "A area do triangulo e", area
    if poligon == 4:
        base = input("Insira a largura da base: ")
        altura = input("Insira a altura do paralelogramo: ")
        area = base*altura
if modo == 2:
    # Volumes
    print
    print
    print "Bem vindo ao programa de calculo de volumes"
    print "-------------------------------------------"
    print
    print
    # Imprimir este menu
    print "Seleccione o volume"
    print "1  Paralelipipedo"
    print "2  Cilindro"
    print "3  Piramide quadrangular"
    print "4  Piramide triangular"
    # selecionador
    vol = input("> > > ")
    #selecçao
    if vol == 1:
        print "Vamos calcular o volume de um paralelipipedo"
        print
        comprimento = input("Insira o comprimento do paralelipipedo")
        largura = input("Insira a largura do paralelipipedo")
        altura = input("Insira a altura do paralelipipedo")
        volume = comprimento*largura*altura
        print "O volume do paralelipipedo e", volume
    if vol == 2:
        print "Vamos calcular o volume de um cilindro"
        print
        print "Primeiro calculamos a area da base: "
        raio = input("Insira o raio da base circular: ")
        area = 3.14* (raio**2)
        print "a area calculada foi de", area
        print
        altura = input("Agora insira a altura do cilindro: ")
        volume = area*altura
        print "A area do cilindro e de", volume
    if vol == 3:
        print "vamos calcular o volume de uma piramide quadrangular"
        print
        print "Primeiro calculamos a area da base: "
        print
        largura = input("Insira a largura da base: ")
        area = largura*largura
        print "A area da base e", area
        print
        altura = input("Agora insira a altura da piramide: ")
        volume = 2(area*altura)
        print "O volume da piramide e", volume   
# -*- coding: cp1252 -*-

P.S.: in the volumes part the 4th selection is not assigned to anything

Post Reply