C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 8th, 2006, 08:45 PM
MBeckford MBeckford is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Location: London
Posts: 1 MBeckford User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 52 sec
Reputation Power: 0
C++ Programming

Code:
// Ex11.cpp, Multiple alternatives
// This is getting a bit labourious! We will see an easier way to do this later
// c:\Borlandc\work\Ex11.cpp

#include <iostream.h>
void main(void)
{
 char day; // gives us a bit more practice with 'char' variables
 cout << "enter the first letter of the day\n";
 cin >> day;
 if	(day == 'm' || day == 'M' )cout << "Monday";
 else if (day == 't') cout << "Tuesday";
 else if (day == 'w' || day == 'W') cout << "Wednesday";
 else if (day == 'T') cout << "Thursday";
 else if (day == 'f' || day == 'F') cout << "Friday";
 else if (day == 's') cout << "Saturday";
 else if (day == 'S') cout << "Sunday";
 } // end of main


// trying to get days tues, thurs, saturday, sunday to output in Lower and upper case. Don't know how to do this.
Comments on this post
Andrew80 disagrees: do your own homework

Last edited by SimonGreenhill : October 8th, 2006 at 09:53 PM. Reason: adding code tags

Reply With Quote
  #2  
Old October 8th, 2006, 09:47 PM
Oler1s Oler1s is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 2006
Posts: 2,270 Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 4 Days 15 h 34 m 57 sec
Reputation Power: 1735
Since someone is going to point this out eventually, might as well be me:

1. Why is this not posted in the C++ programming forum?
2. Your thread title is horrible. You could post this in the C++ programming forum, and then put the essence of your question in the title.
3. Your code should be posted in CODE tags. This preserves indentation in the code. And makes it look nice.

Now then, onto the real point of your question. Actually, your question is a bit vague. What is the end result you want? You want "Tuesday" and so on to output in lowercase. Why don't you just manually output them as wanted?

Two more things to note. First, as per C++ standard, main returns an int. So it is int main, not void main. Second, it's #include <iostream>. Not iostream.h. As per the 99 revision, the standard library has been moved in the std namespace. Hence, you most likely will want to add using namespace std to your code.
Comments on this post
Zoso agrees: Right ! I'd like to see people refer to the Holy C++ Standard more often !

Reply With Quote
  #3  
Old October 8th, 2006, 09:54 PM
SimonGreenhill's Avatar
SimonGreenhill SimonGreenhill is offline
(retired)
Dev Shed God 11th Plane (10000 - 10499 posts)
 
Join Date: Dec 2003
Location: The Laboratory
Posts: 10,101 SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)SimonGreenhill User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 4925 Folding Title: Novice Folder
Time spent in forums: 3 Months 3 Weeks 6 h 8 m 34 sec
Reputation Power: 0
Facebook
Thread moved to the C programming forum.

Also note that we won't do your homework for you.

--Simon

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > C++ Programming

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap