d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Visual Logic Help
Add Reply New Topic New Poll
Member
Posts: 390
Joined: Aug 11 2009
Gold: 0.00
Oct 29 2012 09:14pm
I'm currently within my first semester of college and have decided to go with programming since it has always interested me. Unfortunately I have no programming background what so ever.

Now in my current programming class we're working with Visual Logic to be taught the importance of using logic within programming. The current assignment were doing is working with multiple control breaks while using a file for our data input. I'm completely stuck at creating a control break within my original one to go through the rest of my data that's under a different sales id being input through a file input command.

I have my pseudocode typed out for what I currently have if anybody would be kind of enough to take a peak at it and let me know what I need to do/change for it to function properly. If need be I can post my assignment directions as well since my explanation is probably fairly shitty.
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Oct 29 2012 09:21pm
Quote (Slinksx @ Oct 29 2012 11:14pm)
I'm currently within my first semester of college and have decided to go with programming since it has always interested me. Unfortunately I have no programming background what so ever.

It has always interested you, but you never tried it in your spare time? i suggest rethinking this as a career path.

Quote

Now in my current programming class we're working with Visual Logic to be taught the importance of using logic within programming. The current assignment were doing is working with multiple control breaks while using a file for our data input. I'm completely stuck at creating a control break within my original one to go through the rest of my data that's under a different sales id being input through a file input command.

I have my pseudocode typed out for what I currently have if anybody would be kind of enough to take a peak at it and let me know what I need to do/change for it to function properly. If need be I can post my assignment directions as well since my explanation is probably fairly shitty.


always post your code if you seek help.
Member
Posts: 390
Joined: Aug 11 2009
Gold: 0.00
Oct 29 2012 09:32pm
Quote (carteblanche @ Oct 29 2012 10:21pm)
It has always interested you, but you never tried it in your spare time? i suggest rethinking this as a career path.

Yeah I've been thinking about it honestly.

But anyway here is the mess.

BEGIN
Declarations
previousSalesId = 0
currentSalesId = 0
totalSalesPerId = 0
salesAmountPerId = 0
totalSales = 0
sub = 1
make array monthNameArray, 12

call initializing()
call processing()
END

initializing()
call clearArray()
input “Enter the number of the month.” sub
call loadArray()
output “Brewster’s Used Cars, Inc.”
output “Sales for “ + monthNameArray(sub)
output
“Salesperson ID Sale Amount”
output “==========================”
RETURN

clearArray()
FOR sub 1 to 12 step 1
monthNameArray(sub) = “”
sub = 1
RETURN

loadArray()
monthNameArray(1) = “January”
monthNameArray(2) = “February”
monthNameArray(3) = “March”
monthNameArray(4) = “April”
monthNameArray(5) = “May”
monthNameArray(6) = “June”
monthNameArray(7) = “July”
monthNameArray(8) = “August”
monthNameArray(9) = “September”
monthNameArray(10) = “October”
monthNameArray(11) = “November”
monthNameArray(12) = “December”
RETURN

processing()
call readData()
previousSalesId = currentSalesId
WHILE currentSalesId <> 999
IF currentSalesId <> previousSalesId
ELSE
call idControlBreak
ENDIF
call readData()
call displayDetails()

readData()
input ch7hwtestdata.txt currentSalesId
IF currentSalesId <> 999
input ch7hwtestdata.txt salesAmountPerId
ENDIF
RETURN

idControlBreak()
totalSalesPerId = totalSalesPerId + salesAmountPerId
output currentSalesId + “ “ + formatcurrency(salesAmountPerId)
previousSalesId = currentSalesId
RETURN

displayDetails()
output “Total sales for this salesperson: “ + formatcurrency(totalSalesPerId)



Go Back To Programming & Development Topic List
Add Reply New Topic New Poll