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()

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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()

Expert Solution
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY