Design a Windows Desktop application and write the code that will execute accord
ID: 3874049 • Letter: D
Question
Design a Windows Desktop application and write the code that will execute according to the program requirements.
The program needs to be wrote in visual basic and a screen shot of what the GUI would look like also. Would this be possible?
Below is the context for the patient.txt file. I was not sure how to upload the file.
Patricks, Timothy
230
Baker, Scott
138
Wheeler, Irene
187
Jones, Beata
110
Lopez, Felix
90
Chan, Su
165
Nakatama, Tong
190
Tirrell, Eric
150
Dunford, Janet
159
Chavez, Ava
278
Terrell, Robert
119
Osborne, Joan
128
King, Diane
210
Paine, Thomas
140
Levine, Otto
95
Honey, BooBoo
200
respond: I am not sure what GUI you are speaking of that you can't see? When I open the question the screenshot is readable. I was asking for a screenshot of what the GUI would look like along with the code for the program.
I am not sure on the uploading part. Has this something that has been done in the past? I am open to any ideas.
I have looked over some of the other expert questions for this type of help. I have seen code posted and a screen shot of what the interface would look like. That would be very helpful. I will actually make the program and change stuff around as I make a interface. As for time this is not something I need today if that is what is putting the more than 120 minutes issue.
REQUIREMENTS DOCUMENT Date: February 14, 2016 ate Submitted: Application Title: Patient Blood Pressure Report ressure readin This Windows application determines which patients have a systolic blood p that is considered too high Purpose: In a Windows application, a text file of patient information named patient.txt is opened. The patients who have a systolic reading above 120 are written to a second text file named consult txt for consultation. The systolic reading is the first number in blood pressure results. rogram Procedures: 1. Each day, a text file named patient.txt is opened from the USB drive. The patient.txt file Algorithms Processing, and Conditions: contains patient names, ID numbers, and systolic blood pressure results from a lab. 2. An opening graphic and title are displayed on the Windows Form object. 3. A File menu includes options to Display Patient Information, Clear, and Exit. Selecting the Display Patient Information option displays the contents of the patient.txt file on a seconod 4. The patient names and systolic blood pressure levels are assigned to an array that holds 16 5. Blood pressure systolic levels are tested to check whether the systolic number is above the 6. A 20 h Windows Form object. elements each value 120. 1l patients who have a systolic level above 1 ave their names and systolic results written to a text file named consult.txt on the USB drive. A nurse will contact these patients for her evaluation 7. The program displays the number of patients who had a systolic level above 120 and the average systolic value of today's patients Notes and Restrictions: 1. The patient.txt file is available on CengageBrain.conm 2. An appropriate image for this application should be selected from a picture available on Comments: the webExplanation / Answer
Following are the details for the program:
Program assumes that the Input Text file contains only the Patient Name, ID and the BP value in a Tab delimited format.
frmBP: Initial form to select the Text file which has a Text box (txtBP.txt) that displays the full file path after the selection of file, 4 command buttons (cmdClear for clearing the Text box content, cmdExit to end application, cmdDisplay to browse the file, CommandButton1 for displaying the patient info form.
frmPatInfo: Form to display the number of patients with Systolic BP > 120 and Average BP.
Program Code for the form frmBP:
Dim strBPFile As String,strFilePath As String,intFileNum1 As Integer, intFileNum2 As Integer,strFld() As String
Dim strFileArr(16, 2) As String
Private Sub cmdClear_Click()
txtBP.Text = "" 'Clears the text box content
End Sub
Private Sub cmdDisplay_Click()
Dim strLine As String
Dim intLineNo As Integer
Dim I As Integer
Dim intNoPat As Integer, intTotSys As Integer
intNoPat = 0
intTotSys = 0
If txtBP.Text = "" Then
MsgBox "No files selected!!"
Exit Sub
End If
intFileNum1 = FreeFile()
strBPFile = txtBP.Text
Open strBPFile For Input As #intFileNum1
If EOF(intFileNum1) = False Then
Do While Not EOF(intFileNum1)
Line Input #intFileNum1, strLine
strFld = Split(strLine, vbTab)
strFileArr(intLineNo, 0) = strFld(0)
strFileArr(intLineNo, 1) = strFld(2)
intLineNo = intLineNo + 1
If intFileNum1 = 16 Then Exit Do
Loop
Else
MsgBox "No Data to display in the file!!!"
Exit Sub
End If
For I = 0 To 15
If Val(strFileArr(I, 1)) > 120 Then
intNoPat = intNoPat + 1
If intNoPat = 1 Then
intFileNum2 = FreeFile()
Open strFilePath & "BPMoreThan120.txt" For Output As #intFileNum2
Print #intFileNum2, strFileArr(I, 0) & vbTab & strFileArr(I, 1) & vbCrLf
Else
Print #intFileNum2, strFileArr(I, 0) & vbTab & strFileArr(I, 1) & vbCrLf
End If
End If
intTotSys = intTotSys + Val(strFileArr(I, 1))
Next I
frmPatInfo.txtBP = intNoPat
frmPatInfo.txtAvgBP = Format(Val(intTotSys / 16), "#######.00")
frmPatInfo.Show
Close #intFileNum1
Close #intFileNum2
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub CommandButton1_Click()
Dim strTemp As String
strBPFile = Application.GetOpenFilename
intLineNo = 0
strLine = ""
If Len(strBPFile) = 0 Then
MsgBox "No Files Selected!!!"
Exit Sub
Else
txtBP.Text = strBPFile
strTemp = Left(strBPFile, InStr(strBPFile, "."))
strTemp = StrReverse(strTemp)
strTemp = Mid(strTemp, InStr(strTemp, ""), Len(strTemp) - InStr(strTemp, "") + 1)
strFilePath = StrReverse(strTemp)
End If
End Sub
Private Sub UserForm_Click()
End Sub
Program Code for form frmPatInfo:
Private Sub CommandButton1_Click()
Unload Me
End Sub
OUTPUT:
First form for selecting the File:
The File Open dialog box once the Browse button is selected:
The Form showing the Full File Path in the Text box once the file is selected.
The Patient Information form is displayed once the Display Button is selected:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.