Solved

pseudocodes and looping

Posted on 2004-10-23
617 Views
Last Modified: 2008-01-09
I was wandering how to go about writing a pseudocoe if I had a file containing the grades of students from a beginners class, along with the students’ information. I want this  program  to loop through the records, and make sure that any student who has received 'D’, ‘W’, ‘I’, or ‘F’ in the course will not be able to move on to the Advanced .  How will I go about doing this?



0
Question by:jahsexy18
    6 Comments
     
    LVL 3

    Accepted Solution

    by:
    Hope this is not homework:

    "and make sure that any student who has received 'D’, ‘W’, ‘I’, or ‘F’ in the course will not be able to move on to the Advanced .  "
    ...so I guess you can just delete the poor suckers from the file :)
    ... or if you want to create a file with students who should be allowed then here's your pseudocode:

    open input file for reading
    open output file for writing

    for each record from input file do
        if mark is not in ('D', 'W', 'I', 'F') then write record to output file
    move to next record in input file

    close output file
    close input file
    0
     

    Author Comment

    by:jahsexy18
    Not exactly what

    I was thinnking:Big Picture FlowStart
    Start
    Perform Housekeeping While not EOF Perform scheduleNextClass Endwhile Perform
    StartCleanupStopHouseKeeping() begProgClass_Rec
     Char stuLastName
    Char stuFirstName
    Char Grade

     Open begProgClass_Rec Read begProgClass_RecReturnscheduleNextClass() If Grade = ‘A’ OR Grade = ‘B’ OR Grade = ‘C’ Then print ‘Advanced Programming’ Else print ‘Beginning Programming’ Endif Read begProgClass_RecReturnCleanup() Close begProgClass_recReturn
    0
     
    LVL 3

    Expert Comment

    by:HendrikTYR
    Our definitions of "pseudocode" might be a bit different:

    http://www.webopedia.com/TERM/P/pseudocode.html

    Good luck
    Hendrik
    0
     

    Author Comment

    by:jahsexy18
    actually this is what I meant, if anyone can assist with writting htis program in a more convienient way
    start
        Perform Housekeeping
       While not EOF
            Perform scheduleNextClass
        Endwhile Perform Cleanup
    Stop
    HouseKeeping()
        begProgClass_Rec
       "declare variables
       Char stuLastName
       Char stuFirstName
       Char Grade
       Open begClass_Rec
       Read begClass_Rec
    Return
    scheduleNextClass()
        If Grade = A,B,C Then
        print Advanced Programming
        Else print Beginning Programming
        Endif
        Read begProgClass_Rec
    Return
    Cleanup()
         Close begProgClass_rec
    Return
    0
     
    LVL 5

    Expert Comment

    by:basiclife
    Seems fairly complete at a glance. I'm guessing you're going with C++ ?
    0
     
    LVL 5

    Expert Comment

    by:basiclife
    Sounds good to me
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    A short article about problems I had with the new location API and permissions in Marshmallow
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    857 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now