Click here to Skip to main content
15,899,026 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: store procedure in ms acess and by vb.net Pin
Dave Kreskowiak5-Oct-09 2:14
mveDave Kreskowiak5-Oct-09 2:14 
QuestionMod Function?? Pin
PAguilar094-Oct-09 19:05
PAguilar094-Oct-09 19:05 
AnswerRe: Mod Function?? Pin
Christian Graus4-Oct-09 19:21
protectorChristian Graus4-Oct-09 19:21 
GeneralRe: Mod Function?? Pin
PAguilar094-Oct-09 19:43
PAguilar094-Oct-09 19:43 
GeneralRe: Mod Function?? Pin
Christian Graus4-Oct-09 19:48
protectorChristian Graus4-Oct-09 19:48 
Questionpicture in jpeg format Pin
BORGO CESARE4-Oct-09 8:14
BORGO CESARE4-Oct-09 8:14 
AnswerRe: picture in jpeg format Pin
Christian Graus4-Oct-09 10:26
protectorChristian Graus4-Oct-09 10:26 
QuestionVariables not declared in private subs [Solved] Pin
Sezotove3-Oct-09 16:07
Sezotove3-Oct-09 16:07 
Okay Im in an Intro to Software Dev. Class and im supposed to make a simple tax program this ive done, and it works perfectly... Now im supposed to take that program and split it up into different modules...or thats what it is called in pseudo-code. Here is the code i have and its in the 6th and 7th "Private Sub" is where the variables are claiming to not be declared. I can not figure it out what so ever. Thanks in advanced

Isaac


Module Module1
    Const dblSTATE_TAX As Double = 0.04
    Const dblCOUNTY_TAX As Double = 0.02

    Sub Main()
        'Chapter 3:     SalesTax Program
        'Programmer:    Isaac Peek
        'Date:          October 02, 2009
        'Purpose:       Revision for chapter 2 so there are modules
        '               
        '               
        '
        'Declaration
        Dim decPurchaseAmount As Decimal = 0
        Dim decTotalAmount As Decimal = 0
        Dim decTAX As Decimal = 0
        Dim decTotalTax As Decimal = 0

        'Input
        getPurchaseAmount(decPurchaseAmount)

        'Process and Output
        showPurchaseAmount(decPurchaseAmount)
        showStateTax(dblSTATE_TAX)
        showCountyTax(dblCOUNTY_TAX)
        showTAX(decTAX)
        showTotalAmount(decTotalAmount)
        showTotalTax(decTotalTax)
        showTermination()

    End Sub
    Private Sub getPurchaseAmount(ByRef decPurchaseAmount As Decimal) 'ByRef is input and output
        Console.WriteLine("Please enter the amount of your purchase: ")
        decPurchaseAmount = CDec(Console.ReadLine())
    End Sub
    Private Sub showPurchaseAmount(ByVal decPurchaseAmount As Decimal)
        Console.WriteLine("Your Purchase amount is: " & decPurchaseAmount)
    End Sub
    Private Sub showStateTax(ByVal dblSTATE_TAX As Decimal)
        Console.WriteLine("The State tax is: " & dblSTATE_TAX)
    End Sub
    Private Sub showCountyTax(ByVal dblCOUNTY_TAX As Decimal)
        Console.WriteLine("The County tax is: " & dblCOUNTY_TAX)
    End Sub
    Private Sub showTAX(ByVal decTAX As Decimal)
        decTAX = dblSTATE_TAX + dblCOUNTY_TAX
    End Sub
    Private Sub showTotalTax(ByVal decTotalTax As Decimal)
        decTotalTax = decPurchaseAmount * decTAX
        Console.WriteLine("The total tax is: " & decTotalTax)
    End Sub
    Private Sub showTotalAmount(ByVal decTotalAmount As Decimal)
        decTotalAmount = (decPurchaseAmount * decTAX + decPurchaseAmount
        Console.WriteLine("The Total Purchase amount is: " & decTotalAmount)
    End Sub
    Private Sub showTermination()
        Console.WriteLine()
        Console.WriteLine("Press the enter key to terminate the program.")
        Console.Read()
    End Sub

End Module 


modified on Monday, October 5, 2009 2:25 PM

AnswerRe: Variables not declared in private subs Pin
Christian Graus3-Oct-09 16:55
protectorChristian Graus3-Oct-09 16:55 
GeneralRe: Variables not declared in private subs Pin
Sezotove3-Oct-09 16:59
Sezotove3-Oct-09 16:59 
GeneralRe: Variables not declared in private subs Pin
Christian Graus3-Oct-09 17:23
protectorChristian Graus3-Oct-09 17:23 
GeneralRe: Variables not declared in private subs Pin
Sezotove3-Oct-09 17:27
Sezotove3-Oct-09 17:27 
AnswerRe: Variables not declared in private subs Pin
Christian Graus3-Oct-09 17:27
protectorChristian Graus3-Oct-09 17:27 
GeneralRe: Variables not declared in private subs Pin
Sezotove3-Oct-09 17:32
Sezotove3-Oct-09 17:32 
GeneralRe: Variables not declared in private subs Pin
Christian Graus4-Oct-09 10:25
protectorChristian Graus4-Oct-09 10:25 
AnswerRe: Variables not declared in private subs Pin
The Man from U.N.C.L.E.5-Oct-09 7:01
The Man from U.N.C.L.E.5-Oct-09 7:01 
GeneralRe: Variables not declared in private subs Pin
Sezotove5-Oct-09 8:22
Sezotove5-Oct-09 8:22 
QuestionCalculating avarge time ?? Pin
Bob Beaubien3-Oct-09 5:59
Bob Beaubien3-Oct-09 5:59 
AnswerRe: Calculating avarge time ?? Pin
Abhishek Sur3-Oct-09 6:48
professionalAbhishek Sur3-Oct-09 6:48 
AnswerRe: Calculating avarge time ?? Pin
Dave Kreskowiak3-Oct-09 9:56
mveDave Kreskowiak3-Oct-09 9:56 
GeneralRe: Calculating avarge time ?? Pin
Bob Beaubien3-Oct-09 15:39
Bob Beaubien3-Oct-09 15:39 
GeneralRe: Calculating avarge time ?? Pin
Dave Kreskowiak4-Oct-09 2:20
mveDave Kreskowiak4-Oct-09 2:20 
QuestionButton more then one click Pin
Bob Beaubien2-Oct-09 18:45
Bob Beaubien2-Oct-09 18:45 
AnswerRe: Button more then one click Pin
dan!sh 2-Oct-09 19:26
professional dan!sh 2-Oct-09 19:26 
AnswerRe: Button more then one click Pin
Abhishek Sur3-Oct-09 6:58
professionalAbhishek Sur3-Oct-09 6:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.