473,398 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

please i need quick help

12
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,
Jan 6 '07 #1
2 1433
baroon
12
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,
Jan 7 '07 #2
Banfa
9,065 Expert Mod 8TB
Please do not double post your questions, see

http://www.thescripts.com/forum/thread540746.html


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.
Jan 8 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: TrvlOrm | last post by:
HI There, I have been struggling with JavaScript code for days now, and this is my last resort! Please help... I am trying to create a JavaScript slide show with links for Next Slide,...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
13
by: sd00 | last post by:
Hi all, can someone give me some coding help with a problem that *should* be really simple, yet I'm struggling with. I need the difference between 2 times (Target / Actual) However, these times...
10
by: Miro | last post by:
I wanted certain text boxes ( only certain ones ) to always be Trim'd so that spaces are not in the begining, nor the end of the text entered. I created my own "Handle ?" - i hope thats the...
7
by: pooh1119 | last post by:
hi. my code below makes use of NTL(a library for doin number theory available at www.shoup.net); im trying to print the double base number representation of any large number(32 bits and/or more) but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.