Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 03-30-2006, 04:05 PM   #1 (permalink)
sadinger
Registered User
 
sadinger's Avatar
 
Join Date: Mar 2006
Location: Louisiana
Posts: 3
sadinger is on a distinguished road
Unhappy Help! Reverse name assignment

Hello,
I am new to this site and new to programming. I am stuck. My assignment states the following: We need to write a program that will read in a string of any length and then display the reverse of the original string, the original string in all Caps and in all Lowercase letters. When reversing the string, the letters should be reversed with the appropriate capitalization applied to all letters.

Sample output in bold.

What string would you like to convert? John Smith
Reversed String: htimS nhoJ
All Uppercase: JOHN SMITH
All Lowercase: john smith

I figured out Uppercase and Lowercase but not reverse or even how to tie it in to the rest. We are using the console applications in Microsoft Visual Studio .NET 2003. Any Help would be greatly appreciated. Thank You!
sadinger is offline   Reply With Quote
Old 03-31-2006, 05:08 PM   #2 (permalink)
ChefFrank
Code Monkey
 
ChefFrank's Avatar
 
Join Date: Mar 2006
Location: Woodbury, CT
Posts: 38
ChefFrank is on a distinguished road
Send a message via Yahoo to ChefFrank
OK - here's how you'd go about doing what you want - I'm not going to do your assignment for you

First, you need to put your text into an array. Find the length of the array.
Second, create a second array of the same size

Your loop is like:

.array1 = "John Smith";
.array2;

For index = 0 to length-1 do {
array2[index] = array1[length - index - 1];
}

So, first time through:

length = 10
index = 0
array1 = "John Smith"
array2 = "h"

Second time through:

length = 10
index = 1
array1 = "John Smith"
array2 = "ht"

The rest is left to the reader as an interesting exercise.

Of course, consider the trivial case:

array1 = "Go hang a salami, I'm a lasagna hog"

Frank
ChefFrank is offline   Reply With Quote
Old 04-01-2006, 03:41 PM   #3 (permalink)
sadinger
Registered User
 
sadinger's Avatar
 
Join Date: Mar 2006
Location: Louisiana
Posts: 3
sadinger is on a distinguished road
Thank You, Very Much !!
sadinger is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reverse String in C (w/o STL or New Buffer) bwhiteman Standard C, C++ 8 11-08-2005 03:01 PM
Please help with an assignment ZimbuTM Java 9 09-23-2005 02:33 AM
NEED HELP on card assignment marina Standard C, C++ 9 05-03-2005 07:42 AM
Can anyone help me in this assignment plZ? VaMpIrE Standard C, C++ 7 12-22-2004 07:30 AM
Help in my assignment plZ VaMpIrE Standard C, C++ 1 12-08-2004 01:15 AM


All times are GMT -8. The time now is 08:41 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting