Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 02-10-2008, 11:47 PM   #1 (permalink)
Legendary Darknight
 
latino_ansari's Avatar
 
Join Date: Jul 2007
Location: Bangalore
Posts: 196
Default C++ queries????


Guys i have got a program to write... can u guys help me with it???? please i am not good with c++ and i have to submit it... Please write me the program...

Q. Write a C++ program that copies a test file. In the process, reverse the case of all letters.

Please guys... Help
latino_ansari is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 03-10-2008, 12:58 AM   #2 (permalink)
Alpha Geek
 
Krazy_About_Technology's Avatar
 
Join Date: Jun 2004
Location: Noida - India
Posts: 765
Default Re: C++ queries????

I dont think anybody here will write the whole program for you. Thats your job and you must do it urself. If you'll ask for guidance, only then can somebody help you. Try it and ask for any hints that you need. Its just a sincere advice, no offence meant.
__________________
Dell Inspiron 1525 - C2D 2 Ghz, 3GB, 250GB, X3100 :)

Samsung Omnia Pro B7610 with Stock WM 6.1 ROM

Blog: http://www.sumitbhardwaj.co.in/blog
Krazy_About_Technology is offline  
Old 03-10-2008, 11:48 AM   #3 (permalink)
Right Off the Assembly Line
 
Join Date: Oct 2008
Posts: 4
Default Re: C++ queries????

Read the file one char at a time and just reverse the case of the current char. Simple File IO problem.
Mayur Somani is offline  
Old 03-10-2008, 01:59 PM   #4 (permalink)
j_h
Banned
 
Join Date: Jun 2007
Posts: 105
Default Re: C++ queries????

Quote:
Originally Posted by latino_ansari View Post
Guys i have got a program to write... can u guys help me with it???? please i am not good with c++ and i have to submit it... Please write me the program...

Q. Write a C++ program that copies a test file. In the process, reverse the case of all letters.

Please guys... Help
agar tereko c++ nahi aata hai toh buy a book and learn. tera college ka major change kar and dont take c++ classes. dushron se homework karneko kehna paap hai

Heres ur hint for the homework :

just a hit use r own logic
open the file using file.open
and get the string.

then for lowercase
string x = "mera HOMEWORK dushre log KArTE hai"; //MIX of upper and lower
for(int i = 0; i < 1000; i++) //check for /n in ur case
{
if(x[i] + 32 < 122) //122 is the value for "z".
{
x[i] += 32; //32 is the difference between an uppercase and its lower counterpart
}
}
For conversion to uppercase, change the if statement to

if(x - 32 > 65) // 65 is the value for "A".

and x += 32 should be changed to x -= 32
j_h is offline  
Old 03-10-2008, 03:33 PM   #5 (permalink)
Back!
 
red_devil's Avatar
 
Join Date: Jun 2007
Location: Bangalore
Posts: 513
Default Re: C++ queries????

agree with most of what has been said above.

only disagree with one line of this pseudo code :

Code:
string x = "mera HOMEWORK dushre log KArTE hai"; //MIX of upper and lower
for(int i = 0; i < 1000; i++) //check for /n in ur case
{
if(x[i] + 32 < 122) //122 is the value for "z".
{
x[i] += 32; //32 is the difference between an uppercase and its lower counterpart
}
}

my little knowledge of programming tells me to change the line in bold to

"Main Apna homeWork dusron se KarWanA cHahtHa HooN"

hopefully the logic is correct
red_devil is offline  
Old 23-10-2008, 12:09 PM   #6 (permalink)
In The Zone
 
vandit's Avatar
 
Join Date: May 2005
Location: If I had a webcam u could have seen me, before your eyes.
Posts: 459
Default Re: C++ queries????

hey its simple man ;use the toupper() and tolower() funct. from the ctype.h library
__________________
Searching for dell studio 15 ??
dell studio 15 review @ my blog

vandit007.blogspot.com

And remember the stylus that comes along with the touchscreens isnt meant for cleaning your ears !!
vandit is offline  
Old 23-10-2008, 01:17 PM   #7 (permalink)
Legen-wait for it-dary!
 
dheeraj_kumar's Avatar
 
Join Date: Dec 2004
Location: Chennai
Posts: 2,471
Default Re: C++ queries????

Code:
if isupper()
  tolower()
else
  toupper()
__________________
If the Start Windows Restart when Windows starts check box is checked Windows Restart will start automatically every time Windows is started. - Actual excerpt from a windows program help file
dheeraj_kumar is offline  
Closed Thread

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
3 queries bajaj151 QnA (read only) 8 30-11-2007 06:48 PM
N73 ME queries __Virus__ Mobiles and Tablets 13 04-01-2007 03:48 AM
sql queries vipinkumarsolanki Software Q&A 3 24-12-2006 12:14 AM
two queries amitgg QnA (read only) 7 05-03-2006 09:36 AM
SLI queries deepakprabhakaran QnA (read only) 4 07-03-2005 05:02 PM

 
Latest Threads
- by clinton
- by soumya
- by Sujeet
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 11:14 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2