Please help I have this major problem with vb not that good but can you give me tips on finishing the code off and I have put the in details what problems does and the question that I need to do. I have this program with some missing data and some incorrect code. The xxxxxx signs are the variables and missing code.
The outline off the program
The file contains an unknown number of lines, each of contains three items of
data : x xxxxxxxxx?x x xxx., which is a string, xxxx xxx (integer), and xxxx xxxxxxxxx (also integer). The three data items are in order to shown, so a typical line in the file would have form.
?xxxx, x x?, 22990, 5220
showing xxxxx xxx of ?22990, and a xxxx xxxxxxxxx of ?5220 for. xxxxx, x x.
How ever, some of the figures for xxx and xxxxxxxxx are missing, and are represented in the file by -999. a line like.
?xxxxx, x?, -999, 0
for example, would indicate a missing value for xxxxx xxx, and xxxxx xxxxxxxxx of 0
A zero values does not indicate missing data.
?xxxxx, x?, 15225, -999
would indicate xxxxx xxx of ?15225 and a missing value for the xxxxx xxxxxxxxx.
When the program detects a missing value, it is to ask the user to enter it.
Apart from the possible presence of -999 to indicate a missing value, all of the numbers in the file may be to valid, i.e. to between 0 and 32767 (the maximum permissible integer). My program should assume that any missing data entered by the user also lie in this range.
The program is to take the figures for each xxxxxxxx in the file, and calculate the xxx xx xxxx, and the xxxxxxx?x xxxxxxxx, according to the following rules
? The xxxxxxx xx is to be calculated as the xxxxx xxx xxxxx xxx xxxxx xxxxxxxxx unless the xxxxx xxxxxxxxx is greater than the xxxxx xxx, in which case the xxxxxx xxx is 0
? xx xxx xx xxxx xx xxx xxxxx ?5000 xx xxx xxxxxxx xxx;
20% is xxxx xx xxxx ?10000;
45% is xxxx xx xxxxxxx xxxxx ?15000
xxx is to be calculated correct 2 decimal places
{ to calculate 20% of a figure, multiply it by 0.2: for 45% multiply by 0.45.}
? Anyone xxxxxx xx xxx xx xxxxxxxxxxxx xx ?xxx xxxxx?;
Anyone xxxxxx xxxx 20% xxx xx xxxxxxxxxxx xx ?xxxxxxxxx xxxxx?:
Anyone else is xxxxxxxxxxx xx ?xxxx xxxxx?
The program is to output the following line of information for each xxxxxxxx xxxx, xxxxx xxx, xxx , xxxxxxxxx
The output should be displayed in a picture box and also written to an output file named (I:xxx_xxxx.txt) the number of records dealt with so far should then be displayed in the text box.
After all of the input file is processed, the program is to display a message to tell the user that processing is complete.
I project xxxxxx.vbp has a partially completed interface, with two Command buttons, a text box, and a picture box. It also has some incomplete/ incorrect codefor function xxxxxxxx already entered, and numerour comments.
What needs to be done
1. write a subprogram xxxxxxxxx, to check whether there are missing values for the xxxxx xxx xxx/xx xxxxx xxxxxxxxx, and obtain any missing values from the user (i.e. to implement your refinement of step ?xxxxx xxx xxx xxxxx xxxxxxx xxxx?)
When the subprogram ends, the arguments should contain the complete set of data
2. The function xxxxxxxxxx is intended to take in the values, of the xxxxx xxx xxx xxxxx xxxxxxxx viathe first two parameters, and calculate the xxx xxxxxxx xxx xxx xxxxxxxx (?xxx xxxxxxx?, ?xxxxxxx xxxxx? xx ?xxxx xxxxxx?). The string representing the xxx xxxxxxx is to be stored in the argument; and the xxx xxxxxxx is to be returned as and logical errors. For this I need to rewrite the code.
3. The code for event procedure xxxxxxxx_xxxxx() requires a loop starting where indicate by the comments
?start of main processing loop
And finishing where indicated by the comment
?End of main processing loop
the code
----------------------------
Option Explicit
Dim xxxxxxxxxxx As Integer
------------------------------
Private Sub Form_Load()
'OPEN THE input file
'open the output file
'INITIALISE xxxxxxxxxxx
End Sub
2) ------------------------------------
Private Sub cmdDiscardWaste_Click()
'DECLARE LOCAL VARIABLES
'START THE MAIN PROCESSING LOOP
'GET next line of data from input
'increment xxxxxxxxxxx and display xxxxx in text box (xxxxxxxx)
'Check for and obtain missing data using sub xxxxxxxxxx
'Calculate xxx xxxxxxx AND xxxxxxxx using function xxxxxxxxxxx
'DISPLAY xxxxxxxxx 'x xxxxxxx in the picturebox (xxxxxxxxx)
Question
naz
please i need help on this vb question
Please help I have this major problem with vb not that good but can you give me tips on finishing the code off and I have put the in details what problems does and the question that I need to do. I have this program with some missing data and some incorrect code. The xxxxxx signs are the variables and missing code.
The outline off the program
The file contains an unknown number of lines, each of contains three items of
data : x xxxxxxxxx?x x xxx., which is a string, xxxx xxx (integer), and xxxx xxxxxxxxx (also integer). The three data items are in order to shown, so a typical line in the file would have form.
?xxxx, x x?, 22990, 5220
showing xxxxx xxx of ?22990, and a xxxx xxxxxxxxx of ?5220 for. xxxxx, x x.
How ever, some of the figures for xxx and xxxxxxxxx are missing, and are represented in the file by -999. a line like.
?xxxxx, x?, -999, 0
for example, would indicate a missing value for xxxxx xxx, and xxxxx xxxxxxxxx of 0
A zero values does not indicate missing data.
?xxxxx, x?, 15225, -999
would indicate xxxxx xxx of ?15225 and a missing value for the xxxxx xxxxxxxxx.
When the program detects a missing value, it is to ask the user to enter it.
Apart from the possible presence of -999 to indicate a missing value, all of the numbers in the file may be to valid, i.e. to between 0 and 32767 (the maximum permissible integer). My program should assume that any missing data entered by the user also lie in this range.
The program is to take the figures for each xxxxxxxx in the file, and calculate the xxx xx xxxx, and the xxxxxxx?x xxxxxxxx, according to the following rules
? The xxxxxxx xx is to be calculated as the xxxxx xxx xxxxx xxx xxxxx xxxxxxxxx unless the xxxxx xxxxxxxxx is greater than the xxxxx xxx, in which case the xxxxxx xxx is 0
? xx xxx xx xxxx xx xxx xxxxx ?5000 xx xxx xxxxxxx xxx;
20% is xxxx xx xxxx ?10000;
45% is xxxx xx xxxxxxx xxxxx ?15000
xxx is to be calculated correct 2 decimal places
{ to calculate 20% of a figure, multiply it by 0.2: for 45% multiply by 0.45.}
? Anyone xxxxxx xx xxx xx xxxxxxxxxxxx xx ?xxx xxxxx?;
Anyone xxxxxx xxxx 20% xxx xx xxxxxxxxxxx xx ?xxxxxxxxx xxxxx?:
Anyone else is xxxxxxxxxxx xx ?xxxx xxxxx?
The program is to output the following line of information for each xxxxxxxx xxxx, xxxxx xxx, xxx , xxxxxxxxx
The output should be displayed in a picture box and also written to an output file named (I:xxx_xxxx.txt) the number of records dealt with so far should then be displayed in the text box.
After all of the input file is processed, the program is to display a message to tell the user that processing is complete.
I project xxxxxx.vbp has a partially completed interface, with two Command buttons, a text box, and a picture box. It also has some incomplete/ incorrect codefor function xxxxxxxx already entered, and numerour comments.
What needs to be done
1. write a subprogram xxxxxxxxx, to check whether there are missing values for the xxxxx xxx xxx/xx xxxxx xxxxxxxxx, and obtain any missing values from the user (i.e. to implement your refinement of step ?xxxxx xxx xxx xxxxx xxxxxxx xxxx?)
When the subprogram ends, the arguments should contain the complete set of data
2. The function xxxxxxxxxx is intended to take in the values, of the xxxxx xxx xxx xxxxx xxxxxxxx viathe first two parameters, and calculate the xxx xxxxxxx xxx xxx xxxxxxxx (?xxx xxxxxxx?, ?xxxxxxx xxxxx? xx ?xxxx xxxxxx?). The string representing the xxx xxxxxxx is to be stored in the argument; and the xxx xxxxxxx is to be returned as and logical errors. For this I need to rewrite the code.
3. The code for event procedure xxxxxxxx_xxxxx() requires a loop starting where indicate by the comments
?start of main processing loop
And finishing where indicated by the comment
?End of main processing loop
the code
----------------------------
Option Explicit
Dim xxxxxxxxxxx As Integer
------------------------------
Private Sub Form_Load()
'OPEN THE input file
'open the output file
'INITIALISE xxxxxxxxxxx
End Sub
2) ------------------------------------
Private Sub cmdDiscardWaste_Click()
'DECLARE LOCAL VARIABLES
'START THE MAIN PROCESSING LOOP
'GET next line of data from input
'increment xxxxxxxxxxx and display xxxxx in text box (xxxxxxxx)
'Check for and obtain missing data using sub xxxxxxxxxx
'Calculate xxx xxxxxxx AND xxxxxxxx using function xxxxxxxxxxx
'DISPLAY xxxxxxxxx 'x xxxxxxx in the picturebox (xxxxxxxxx)
'And store them in the outputfile
'End of main loop.
End Sub
3 )----------------------------------------------------------------
'Private Function xxxxxxxxxxx(xxx xx xxxxxxx, xxxxxxxxx xx xxxxxxxx, xxx xx xxxxxx)
Dim xxx xx xxxxxx, xxxxxxxxxx, xxxxxxxxxx xx xxxxxxx
xxxxxxxxxx = xxx - xxxxxxxxx
Select Case xxxxxxxxx
Case Is <= 5000
xxx = 0
xxx = "xxx xxxxxx"
Case 5001 xx 15000
xxx = 0.2 * (xxxxxxxxxx - 5000)
xxx = "xxxxxxxx xxxxxx"
Case xxxx
xxx = 0.45 * (xxxxxxxxxx)
End Select
End Function
______________________________________
Private Sub cmdQuit_Click()
'xxxx xxx xxxxx xxxxx
End Sub
-------------------------------------------------------------
cya naz
Link to comment
Share on other sites
23 answers to this question
Recommended Posts