please i need quick help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • baroon
    New Member
    • Jan 2007
    • 12

    please i need quick help

    Please if you can help me by solving the following question by
    >>using C++:
    >>
    >>One important function in word-processing system is typ
    >>justificati on the alignment of words to both the left and right
    >>margins of a page. This generates a professional looking document
    >>that gives the appearance of being set in type rather than prepared
    >>on a typewrter. Type justification can be a complished on computer
    >>systems by inserting blank charachters between each of the words in
    >>a line so that the rightmost word alogns with right margin.
    >>write aprogram that reads a file from notepad (notepad file of
    >>several lines of text) and print this text in type justified
    >>format. Assume that the file with a text with 10 spaces margines
    >>are to be allowed on both the left and right sides and 60-65 latter
    >>or character per line.
    >>Summery: out put should be a justified pragraph printed in screen
    >>with the same margines size. (Example: if the paper is 8.5 inches
    >>wide the tesxt must be 6.5 inches with10 inches for left margine
    >>and 10 inches for right margin).
    >>
    >>your help will be appreciated,
  • baroon
    New Member
    • Jan 2007
    • 12

    #2
    Please if you can help me by solving the following question by c++

    Please if you can help me by solving the following question by
    using C++:

    One important function in word-processing system is typ
    justification the alignment of words to both the left and right
    margins of a page. This generates a professional looking document
    that gives the appearance of being set in type rather than prepared
    on a typewrter. Type justification can be a complished on computer
    systems by inserting blank charachters between each of the words in
    a line so that the rightmost word alogns with right margin.
    write aprogram that reads a file from notepad (notepad file of
    several lines of text) and print this text in type justified
    format. Assume that the file with a text with 10 spaces margines
    are to be allowed on both the left and right sides and 60-65 latter
    or character per line.
    Summery: out put should be a justified pragraph printed in screen
    with the same margines size. (Example: if the paper is 8.5 inches
    wide the tesxt must be 6.5 inches with10 inches for left margine
    and 10 inches for right margin).

    your help will be appreciated,

    Comment

    • Banfa
      Recognized Expert Expert
      • Feb 2006
      • 9067

      #3
      Please do not double post your questions, see




      As to the justification problem you know how wide your line is, you need to traverse the line of text counting spaces and then get then length of the line of text. The length of line - the length of the line of text is the number of spaces you have to add, you know how many spaces there are so you will need an algorithm to evenly distribute these amoung the available positions to add spaces to.

      Comment

      Working...