draw a flowchart of the following pseudo-code Declare struct array vacc v[10] with arrays vaccName,vaccCode,country of size 15,2,15 respectively and qty and populaion as members START OF MAIN FUNCTION Do Print 1:create inventory" Print 2: display vaccine info " Print 3: search vaccine Print enter your choice (0 to exit):" Input ch if ch=1 create_inventory() else if ch=2 display_vaccine() else if ch=3 search_vaccine() else break End if While ch!=0 End do while END OF MAIN FUNCTION START OF FUNCTION create_inventory() Set option=1 infile = open file dist.txt in write mode If infile is NULL Print Vaccine.txt file not found End if While(option != 0) Print Enter Vaccine Name : Input vaccName Print Enter Vaccine Code : Input vaccCode Print Enter Counry : Input country Print Enter Dosage Required : Input qty Print Enter Population Covered : Input populaion Write to file vaccName,vaccCode,country,qty,populaion Print Enter 1 to continue and 0 to exit : Input option if option = 0 Close infile Endif End while END OF FUNCTION create_inventory() START OF FUNCTION display_vaccine() infile = open file Vaccine.txt in read mode If infile is NULL Print Vaccine.txt file not found End if Print "Vaccine Name","Vaccine Code","Country","Dosage","Population" While not EOF of infile read vaccName,vaccCode,country,qty,populaion from infile Print vaccName,vaccCode,country,qty,populaion End while Close infile END OF FUNCTION display_vaccine() START OF FUNCTION update_vacc_qty() infile = open file dist.txt in write mode If infile is NULL Print dist.txt file not found End if While(option != 0) Print Enter Vaccine Name : Input vaccName Print Enter Vaccine Code : Input vaccCode Print Enter Counry : Input country Print Enter Dosage Required : Input qty Print Enter Population Covered : Input populaion Write to file vaccName,vaccCode,country,qty,populaion Print Enter 1 to continue and 0 to exit : Input option if option = 0 Close infile Endif End while Set t=0 While not EOF of infile read vaccName,vaccCode,country,qty,populaion from infile Copy vaccName to v[t].vaccName Copy vaccCode to v[t].vaccCode Copy country to v[t].country v[t].qty=qty v[t].population=population t=t+1 End while For i from 0 to t-2 For j from 0 to t-i-2 if (v[j].qty < v[j + 1].qty) temp = v[j] v[j] = v[j + 1] v[j + 1] = temp End if End for End for Print "Vaccine Name","Vaccine Code","Country","Dosage","Population" For i from 0 to t-1 Print v[i].vaccName,v[i].vaccCode,v[i].country,v[i].qty,v[i].population End for Close infile END OF FUNCTION update_vacc_qty() START OF FUNCTION search_vaccine() infile = open file Vaccine.txt in read mode Print Enter Vaccine Code to Search : Input vcode If infile is NULL Print Vaccine.txt file not found End if Copy vcode to temp While not EOF of infile read vaccName,vaccCode,country,qty,populaion from infile if(vaccCode[0] == temp[0] and vaccCode[1] == temp[1]) Print "Vaccine Name","Vaccine Code","Country","Dosage","Population" Print vaccName,vaccCode,country,qty,populaion End while Close infile END OF FUNCTION search_vaccine()
draw a flowchart of the following pseudo-code
Declare struct array vacc v[10] with arrays vaccName,vaccCode,country of size 15,2,15
respectively and qty and populaion as members
START OF MAIN FUNCTION
Do
Print 1:create inventory"
Print 2: display vaccine info "
Print 3: search vaccine
Print enter your choice (0 to exit):"
Input ch
if ch=1 create_inventory()
else if ch=2 display_vaccine()
else if ch=3 search_vaccine()
else break
End if
While ch!=0
End do while
END OF MAIN FUNCTION
START OF FUNCTION create_inventory()
Set option=1
infile = open file dist.txt in write mode
If infile is NULL
Print Vaccine.txt file not found
End if
While(option != 0)
Print Enter Vaccine Name :
Input vaccName
Print Enter Vaccine Code :
Input vaccCode
Print Enter Counry :
Input country
Print Enter Dosage Required :
Input qty
Print Enter Population Covered :
Input populaion
Write to file vaccName,vaccCode,country,qty,populaion
Print Enter 1 to continue and 0 to exit :
Input option
if option = 0
Close infile
Endif
End while
END OF FUNCTION create_inventory()
START OF FUNCTION display_vaccine()
infile = open file Vaccine.txt in read mode
If infile is NULL
Print Vaccine.txt file not found
End if
Print "Vaccine Name","Vaccine Code","Country","Dosage","Population"
While not EOF of infile
read vaccName,vaccCode,country,qty,populaion from infile
Print vaccName,vaccCode,country,qty,populaion
End while
Close infile
END OF FUNCTION display_vaccine()
START OF FUNCTION update_vacc_qty()
infile = open file dist.txt in write mode
If infile is NULL
Print dist.txt file not found
End if
While(option != 0)
Print Enter Vaccine Name :
Input vaccName
Print Enter Vaccine Code :
Input vaccCode
Print Enter Counry :
Input country
Print Enter Dosage Required :
Input qty
Print Enter Population Covered :
Input populaion
Write to file vaccName,vaccCode,country,qty,populaion
Print Enter 1 to continue and 0 to exit :
Input option
if option = 0
Close infile
Endif
End while
Set t=0
While not EOF of infile
read vaccName,vaccCode,country,qty,populaion from infile
Copy vaccName to v[t].vaccName
Copy vaccCode to v[t].vaccCode
Copy country to v[t].country
v[t].qty=qty
v[t].population=population
t=t+1
End while
For i from 0 to t-2
For j from 0 to t-i-2
if (v[j].qty < v[j + 1].qty)
temp = v[j]
v[j] = v[j + 1]
v[j + 1] = temp
End if
End for
End for
Print "Vaccine Name","Vaccine Code","Country","Dosage","Population"
For i from 0 to t-1
Print v[i].vaccName,v[i].vaccCode,v[i].country,v[i].qty,v[i].population
End for
Close infile
END OF FUNCTION update_vacc_qty()
START OF FUNCTION search_vaccine()
infile = open file Vaccine.txt in read mode
Print Enter Vaccine Code to Search :
Input vcode
If infile is NULL
Print Vaccine.txt file not found
End if
Copy vcode to temp
While not EOF of infile
read vaccName,vaccCode,country,qty,populaion from infile
if(vaccCode[0] == temp[0] and vaccCode[1] == temp[1])
Print "Vaccine Name","Vaccine Code","Country","Dosage","Population"
Print vaccName,vaccCode,country,qty,populaion
End while
Close infile
END OF FUNCTION search_vaccine()
Step by step
Solved in 2 steps with 4 images