Question about Operating Systems

1 Answer

Can any one figure out code for this pseudocode?????

Program
Open file
Read 5 bytes into begin
If begin == ‘BEGIN’
Call sentences
Read 3 bytes into end
If end == ‘END’
Success


Function sentences
Call VP
Call NP
Call period
Return


Function VP
Call get_phrase
If tag == ‘[VP]’
Lookup word in verb table
If found
Check flag
If flag = ‘P’
Write (index, ‘VP’)
Else if flag = ‘NP’
Find index
Write(index, ‘VP’)
Else
Add to table

Function NP
Call get_phrase
If tag == ‘[NP]’
Lookup word in noun table
If found
Record position
Write index, ‘NP’
Else
Add to table


Function period
Read 1 byte into period
If period == ’.’
Return success
Else ERROR


Function get_word
Set position
Peek next
If next <> ‘[’
Read one byte into word
Loop
Call tag
Return word


Function get_tag
Read 4 bytes into tag
Return tag




Function get_phrase
Call get_word
Call get_tag
Return tagged_phrase


Posted by on

  • saikrrrish Feb 23, 2008

    ur correct...but wat abt the code???????

×

1 Answer

  • Level 3:

    An expert who has achieved level 3 by getting 1000 points

    Superstar:

    An expert that got 20 achievements.

    All-Star:

    An expert that got 10 achievements.

    MVP:

    An expert that got 5 achievements.

  • Master
  • 2,427 Answers

Its the psuedo code for a function in some sort of word processing application. basically it looks for a word, noun , phrase or period. and record the position then adds it to a table.. Proberally home work for a programmer i guess.

Posted on Feb 21, 2008

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

2 Answers

PDF: File is damaged and couldn't be repaired


Guide for PDFTK (Freeware)
1) Download Gui for PDFTK from the Paehl website.
2) Double-click the downloaded installer to begin the program's setup.
3) Click "Start," select "All Programs" and click "Gui for PDFTK" to open the program.
4) Click the "..." button next to "PDF file" and locate your corrupt PDF. Click the "..." next to "Target" if you are not happy with the output file name.
5) Click "Repair a PDF." Wait for Gui for PDFTK to confirm repairing is complete.
6) Close Gui for PDFTK. Your repaired PDF will be in the same location as the original PDF unless specified otherwise.
As a variant might be...
Here is a tool PDF On-line repair service that may help the users to repair their corrupt PDF files easily - PDF Repair Toolbox. The tool reads corrupted PDF files and saves all recovered information to a new file for Adobe Reader/Adobe Acrobat.
PDF Repair Toolbox

May 28, 2015 | Operating Systems

1 Answer

I have made a disk image, with file extension .wmf, but don't know how to open it and get all the disk data back ??


wrong file extension. if you made a image of the OS it should have been a .iso this is burnable and easy to open with winrar or a dvd burner program for image burning.
The ISO file type is primarily associated with 'ISO-9660 CD Disc Image'. A literal dump of the data on the CD, byte-for-byte. The data is stored in the ISO-9660 format. IsoBuster can interpret these files directly.



The .wmf file type is primarily associated with 'Windows Metafile' by Microsoft Corporation. Microsoft graphic format. Xara X is a good program to edit this file type if you don't have Microsoft tools. There are several versions of a Metafile; each having a different header structure.

Jan 25, 2012 | Microsoft Windows XP Professional...

1 Answer

SOUND DRIVER DOES NOT SUPPORT MY PC i install the sound driver,but he does not support my pc


Try this : DRIVERS FOR MY PC

Here's the Instruction :

1. install the software and run the program after installation.

2. if ask for Key registration, just enter this code : JCCQ-MAKC-KACK-6TSE-BN35

3. Tick "Scan" to begin (it will detect all drivers that needs to be update

4. click start to begin downloading (you can choose which driver you want to download)

5. click "Install" and it will automatically install on your pc.



Good luck...

Jun 21, 2011 | Operating Systems

2 Answers

How to unlock the security code of my mobile phone?


dont worry, just follow the steps below:
note: u need to have a pc running xp
click to download NSS

http://www.b-phreaks.co.uk/NSSDownloadLanding.htm


TO RECOVER THE CODE

1. CONNECT UR FONE VIA USBCABLE IN PC MODE & INSTALL THE DRIVERS FOR UR CELL FONE PROVIDED WITH NOKIA PC SUITE.THEN EXIT PC SUITE

2. THEN INSTALL Nemesis Service Suite

3. SELECT USB VIRTUAL DRIVE during installation (in case of nokia6120c for nokia 5700 use diamond protection)

4. AFTER INSTALLATION OPEN IT, THEN CLicK ON SCAN BUTTON

5. AFTER THAT CLicK ON PHONE INFO, NOW CLicK ON SCAN

6. NOW CLicK ON PERMANENT MEMORY TAB given on right bottom of application

7. NOW CLicK ON READ, IT WILL READ THE PERMANENT MEMORY FILE & WRITE IT TO THE DISK

UR PM FILE WILL BE LOCATED IN THE PATH:


D:Program FilesNSSBackuppm?252*********.pm


open that PM file in NOTEPAD


8. now scroll uptil FIELD [308] and on the 5th RECORD ur security code is saved

like that

5=31303038350000000000 remove all the "3" digits and it will be like that

5= 10085 0000000000 now its 10085 thats it.UR LOCK CODE IS 10085

Mar 07, 2011 | Operating Systems

3 Answers

Can any one tell me how to open B01 type file


Try to extract them to your hard drive using Blindwrite. Or mount with Daemon Tools.

Mar 02, 2011 | Operating Systems

1 Answer

I want to down load multi yahoo messanger in my pc


  • Download and install the regular version of Yahoo! Messenger onto your computer if you haven't done so already. The Yahoo! Messenger download can be found at messenger.yahoo.com or by clicking the link in the Resources section.Open a web browser and go to the shareware site Softpedia or Toggle using the link in the Rsesource section. The link will take you to the site's Yahoo! Multi Messenger download page.Click "Download." Choose a mirror site to download the zip file from and click on it.Click "Save." Click "Computer" and double-click on the "C:" drive. Choose "Program Files" and double-click on the "Yahoo!" file. Double-click "Messenger" and click "Save." This step is important; the Multi Messenger program must be saved in the same file as the regular version of Yahoo! Messenger or it will not work Click "Open" when the download is completed. Click "OK" to allow Winzip to unzip the program file.Double-click on the "Set-Up" file. Click "OK" to open the set-up wizard and begin the program installation.Click "Finish" when the set-up wizard is complete. Yahoo! Multi Messenger is now installed on your computer and will open whenever you use Yahoo! Messenge

  • Oct 14, 2010 | Operating Systems

    2 Answers

    Task filter


    Following are a handful things u have to know about VB file handling

    for more details...go to http://www.5starsupport.com/info/vb.htm

    File Handling (Generic)

    While VB is working on a better approach (FileSystemObject), the built-in file handling statements are still the only way to access data other than through the VB database capabilities. Your skills in this area can make or break your ability to work with various formats. The OPEN/CLOSE statements are critical to success, but the LOF, EOF, and LEN functions are used even more often! It's also a given that you'll use the DIR function regularly.
    Dir - Returns a filename that matches a pattern
    temp$ = Dir ("*.*")
    CurDir - Returns the current directory
    temp$ = CurDir
    MkDir - Creates a directory
    mkdir ( "newdirectoryname" )
    ChDir - Changes the current directory to a new location
    chdir ( "newdirectoryname" )
    ChDrive - Changes the current drive
    ChDirve "A"
    RmDir - Removes the indicated directory
    rmdir ( "directoryname" )
    Freefile - Returns an unused file handle
    i = freefile
    Open - Opens a file for access, locking it from other applications
    open "filename" for input as #1
    Close - Closes a file so that other applications may access it
    close #1
    LOF - Returns the length of a file in bytes
    i = lof ( #1 )
    EOF - Returns a boolean value to indicate if the end of a file has been reached
    statusvariable = eof ( #1 )
    Name As - Renames a file
    name "filename1" as "filename2"
    Kill - Deletes a file
    kill "filename"
    Fileattr - Returns attribute information about a file
    i = int ( tempvariable )
    GetAttr - Returns attributes of a file or directory
    i = GetAttr("c:\windows\temp")
    SetAttr - Sets the attributes of a file
    SetAttr pathname, vbHidden
    Reset - Closes all disk files opened by the OPEN statement
    Reset
    FileDateTime - Returns data file was created or last edited
    FileDateTime ( filename )
    FileLen - Returns length of file in bytes
    FileLen ( filename )
    FileCopy - Copies a file to a new name
    FileCopy sourcefile, destinationfile
    Lock - Controls access to a part or all of a file opened by OPEN
    Lock #1
    UnLock - Restores access to a part or all of a file opended by OPEN
    UnLock #1
    Width # - Set the output line width used by the OPEN statement
    Width #2, 80
    File Handling - ASCII-specific

    While VB is working on a better approach (FileSystemObject), the built-in file handling statements are still the only way to access data outside of a data base. Your skills in this area can make or break your ability to work with various formats. The OPEN/CLOSE statements are critical to success, but the LOF, EOF, and LEN functions are necessary to build useful code.
    Line Input - Reads an entire line of ASCII text
    line input #1, tempvariable$
    Write - Puts data in a file, with separators for the data
    write #1, tempvariable$
    Print - Puts data in a file with no separators
    print #1, tempvariable$
    Spc - Used in a print statement to move a number of spaces
    Print #2, var1; spc(15); var2
    Tab - Used in a print statement to move to TAB locations
    Print #2, var1; Tab(20); var2
    File Handling - Binary-specific

    VB also support features which allow you to access a file on a byte-by-byte basis. The good thing about it is that you have more control, the bad thing is that you may have to write more code. Generally, a programmer will use the option (ASCII or Binary access) according to the least code he has to write. For binary access the Get/Put are equivalent to the Line Input and Print functions used in ASCII text file access. The big difference between the two is that binary access will read (Get) an exact number of bytes of data, and the reading can start at any byte within the file.
    Get - Reads data from a file
    get #1, anyvariable
    Put - Puts data into a file
    put #1, anyvariable
    Seek - Moves the current pointer to a defined location in a file
    seek #1, 26
    Input
    input #1, anyvariable
    Loc - Returns current position with an open file
    i = Loc(#2)

    Sep 14, 2009 | Microsoft Windows XP Professional With...

    1 Answer

    I want a c program for reading a image


    FILE *fp = fopen( "file.bmp", "rb" ); This opens the file
    unsigned char buff[10];
    size_t n = fread( buff, sizeof(buff[0]), sizeof(buff), fp ); This reads 10 bytes from the file.

    10 is obviously just an example, but you can read the documentation to find out how big a BMPHEADER structure is, and read that number of bytes instead. Having got that, you get vital information such as
    - the width and height of the image
    - the number of bits in each pixel
    - whether there is a colour table in the file.

    You then skip the optional colour table (say by using fseek), then you can start looping reading image data, based on your knowledge of the width, height and bpp of the image format.

    Mar 17, 2009 | Operating Systems

    1 Answer

    File handling


    Use copy,  (or cp in linux),  it's a C program,  if you want you can find the source code if you are resourceful.  see below.  If you want a c++ program source code, take the source you found and do "rename copy.c copy.cpp" ;~).  It is silly to use an OO language to do a trivial utility.
    see usage below:

    C:\Users\ajm>ver > file1
    C:\Users\ajm>ver > file2

    C:\Users\ajm>copy file1+file2 file3 file1 file2         1 file(s) copied.
    C:\Users\ajm> C:\Users\ajm>dir file*  Volume in drive C is SQ004740V04  Volume Serial Number is 72CF-0846
     Directory of C:\Users\ajm
    11/06/2008  09:51 AM                40 file1 11/06/2008  09:51 AM                40 file2 11/06/2008  09:51 AM                81 file3                3 File(s)            161 bytes                0 Dir(s)  79,747,624,960 bytes free

    Oct 30, 2008 | Operating Systems

    2 Answers

    File handling in visual basic 6.0


    Following are a handful things u have to know about VB file handling

    for more details...go to http://www.5starsupport.com/info/vb.htm

    File Handling (Generic)

    While VB is working on a better approach (FileSystemObject), the built-in file handling statements are still the only way to access data other than through the VB database capabilities. Your skills in this area can make or break your ability to work with various formats. The OPEN/CLOSE statements are critical to success, but the LOF, EOF, and LEN functions are used even more often! It's also a given that you'll use the DIR function regularly.
    Dir - Returns a filename that matches a pattern
    temp$ = Dir ("*.*")
    CurDir - Returns the current directory
    temp$ = CurDir
    MkDir - Creates a directory
    mkdir ( "newdirectoryname" )
    ChDir - Changes the current directory to a new location
    chdir ( "newdirectoryname" )
    ChDrive - Changes the current drive
    ChDirve "A"
    RmDir - Removes the indicated directory
    rmdir ( "directoryname" )
    Freefile - Returns an unused file handle
    i = freefile
    Open - Opens a file for access, locking it from other applications
    open "filename" for input as #1
    Close - Closes a file so that other applications may access it
    close #1
    LOF - Returns the length of a file in bytes
    i = lof ( #1 )
    EOF - Returns a boolean value to indicate if the end of a file has been reached
    statusvariable = eof ( #1 )
    Name As - Renames a file
    name "filename1" as "filename2"
    Kill - Deletes a file
    kill "filename"
    Fileattr - Returns attribute information about a file
    i = int ( tempvariable )
    GetAttr - Returns attributes of a file or directory
    i = GetAttr("c:\windows\temp")
    SetAttr - Sets the attributes of a file
    SetAttr pathname, vbHidden
    Reset - Closes all disk files opened by the OPEN statement
    Reset
    FileDateTime - Returns data file was created or last edited
    FileDateTime ( filename )
    FileLen - Returns length of file in bytes
    FileLen ( filename )
    FileCopy - Copies a file to a new name
    FileCopy sourcefile, destinationfile
    Lock - Controls access to a part or all of a file opened by OPEN
    Lock #1
    UnLock - Restores access to a part or all of a file opended by OPEN
    UnLock #1
    Width # - Set the output line width used by the OPEN statement
    Width #2, 80
    File Handling - ASCII-specific

    While VB is working on a better approach (FileSystemObject), the built-in file handling statements are still the only way to access data outside of a data base. Your skills in this area can make or break your ability to work with various formats. The OPEN/CLOSE statements are critical to success, but the LOF, EOF, and LEN functions are necessary to build useful code.
    Line Input - Reads an entire line of ASCII text
    line input #1, tempvariable$
    Write - Puts data in a file, with separators for the data
    write #1, tempvariable$
    Print - Puts data in a file with no separators
    print #1, tempvariable$
    Spc - Used in a print statement to move a number of spaces
    Print #2, var1; spc(15); var2
    Tab - Used in a print statement to move to TAB locations
    Print #2, var1; Tab(20); var2
    File Handling - Binary-specific

    VB also support features which allow you to access a file on a byte-by-byte basis. The good thing about it is that you have more control, the bad thing is that you may have to write more code. Generally, a programmer will use the option (ASCII or Binary access) according to the least code he has to write. For binary access the Get/Put are equivalent to the Line Input and Print functions used in ASCII text file access. The big difference between the two is that binary access will read (Get) an exact number of bytes of data, and the reading can start at any byte within the file.
    Get - Reads data from a file
    get #1, anyvariable
    Put - Puts data into a file
    put #1, anyvariable
    Seek - Moves the current pointer to a defined location in a file
    seek #1, 26
    Input
    input #1, anyvariable
    Loc - Returns current position with an open file
    i = Loc(#2)

    Jan 23, 2008 | Operating Systems

    Not finding what you are looking for?
    Operating Systems Logo

    Related Topics:

    193 people viewed this question

    Ask a Question

    Usually answered in minutes!

    Top Operating Systems Experts

    Les Dickinson
    Les Dickinson

    Level 3 Expert

    18298 Answers

    Brian Sullivan
    Brian Sullivan

    Level 3 Expert

    27725 Answers

    Prashant  Sharma
    Prashant Sharma

    Level 3 Expert

    1127 Answers

    Are you an Operating System Expert? Answer questions, earn points and help others

    Answer questions

    Manuals & User Guides

    Loading...