473,386 Members | 1,693 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,386 software developers and data experts.

Need help gettong started

Can anyone please help me figuring out a way to go about beggining this program...Im a first year C++ student and this program is a little to advanced for me...any help would be greatly appreciated!!!

Write a program that reads English text. The program should output the text with correct spacing and with letters corrected for capitalization.

For example:

the Answer to life,the Universe, and everything is 55.

Should Print:

The answer to life, the universe, and everything is 55.

Empty line signifies the end of input...

Any ideas...i know Im going to have to use strings but I just need to know how to get the ball rolling...
Nov 6 '06 #1
1 1191
sicarie
4,677 Expert Mod 4TB
I've found the best way to approach a problem is to start out with a clean sheet of paper. Just write down what you are trying to do in a very basic sense. (If you can't figure out what you are trying to do, then you can't do it.) So:

Format Text

From there, you break the project down to small, individual tasks:

Format Text:

Read in text.
Manipulate.
Output text.

Just keep growing it until you have your pseudocode:

Read in a string (right there, you are doing two functions, and so you're not all the way there yet)
Check capitalization of string
Check spacing of string
check end of string
Output string

Obviously if your project encompasses more, then you should put in the details I am missing, I'm just trying to convey the method. I would not start coding until I was sure how I would check each letter in the string, how I was going to read it in, all the checks I needed to do, etc... But you would probably end up with something like this:

String
read a string in from .... (file?/standard input?)
for each letter in the string
if it's the first character
make sure it's capitalized (exists between capitals A and Z)
else,
make sure it's lowercase
if there is a delimiter ('.' || ',' || however many you want)
make sure there is a space afterwards

and so on. And if I'm wrong on the pseudocode - if it doesn't fit your program - that's also the best way to change it and make sure the logic still fits(I'm mostly thinking that's going to be a huge delimiter chain, there's probably a better way to do it.).

But that should get you started, and if you do that all the way (make sure there is only a basic function per line at the end of your pseudocode) you'll be surprised at how much of the program you will be able to code yourself (and quickly, once you get used to doing that), and of course you can post error messages up here for more help.
Nov 6 '06 #2

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

Similar topics

0
by: Ixnay | last post by:
Hi All, The CFO of our company just asked me to write an app on top of an Access database. I've never written anything in VB and could use some help in getting started. I would, in particular,...
3
by: Tommy Lang | last post by:
I am working on this project and I need some help/pointers/comments to get me started, I am stuck. The program will be used to store information in an array while it is running. I need to store...
106
by: xtra | last post by:
Hi Folk I have about 1000 procedures in my project. Many, many of them are along the lines of function myfuntion () as boolean on error goto er '- Dim Dbs as dao.database Dim Rst as...
4
by: Jeff | last post by:
IDE: VS .NET 2003 OS: XP pro sp2 I'm developing a server application, clients will connect to it over the net and start different tasks.... When people sends a command to the program, the...
5
by: HotRod | last post by:
I am new to this so please go easy. We currently have some students doing some work on some web based tracking documents for us. They are currently using VB .net to develop what we requested....
12
by: nephish | last post by:
Hello there, i am getting to need to make my web stuff more OO. i have a project at work that we are porting to the internet, and i started learning php to do so. the project is now mamoth is...
0
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need ...
15
by: javelin | last post by:
I need to be able to create a javascript based drawing/signature box, and be able to save it. Can someone refer me to a script that will allow this, or even a 3rd party package for sale? It can't...
2
mideastgirl
by: mideastgirl | last post by:
Warning: session_start() : Cannot send session cookie - headers already sent by (output started at /home/content/m/i/d/mideasthonors/html/adminloginprocess.php:1) in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.