Click here to Skip to main content
15,899,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Registry Pin
Bram van Kampen17-Feb-08 3:17
Bram van Kampen17-Feb-08 3:17 
GeneralRe: Registry Pin
Rajkumar R17-Feb-08 3:52
Rajkumar R17-Feb-08 3:52 
GeneralRe: Registry Pin
Bram van Kampen17-Feb-08 6:19
Bram van Kampen17-Feb-08 6:19 
AnswerRe: Registry Pin
Rajkumar R17-Feb-08 17:14
Rajkumar R17-Feb-08 17:14 
GeneralRe: Registry Pin
Hamid_RT18-Feb-08 7:18
Hamid_RT18-Feb-08 7:18 
QuestionCapture the ID Button clicked by mouse in a game Pin
Rafael Pacheco16-Feb-08 13:37
Rafael Pacheco16-Feb-08 13:37 
QuestionRe: Capture the ID Button clicked by mouse in a game Pin
Rajkumar R17-Feb-08 2:26
Rajkumar R17-Feb-08 2:26 
Questionnoob needs some help with C++ programming class Pin
boomer7916-Feb-08 13:09
boomer7916-Feb-08 13:09 
I'm trying to complete the code for the following program, learning switch statements. But my text shows very little in the way of examples, and I just don't know where to go here. I started to try it, but just don't know. Can somebody PLEASE help? Thanks.


// **************************************************************************
//
// Astrology.cpp
//
// Prompts for the user's birthday and returns the user's
// astrological sign.
// **************************************************************************
#include <iostream>

int getMonth();
// Precondition: User will enter birth month
// Postcondition: Returns 1 <= birth month <= 12

int getDay();
// Precondition: User will enter birth day
// Postcondition: Returns 1 <= birth day <= 31

int getSign(int month, int day);
// Precondition: 1 <= month <= 12, 1 <= day <= 31
// Postcondition: Returns integer corresponding to astrological sign for
// given month and day starting with Capricorn = 1.

int main()
{
using namespace std;
int month;
int day;

//
// Get birth month and day.
//

month = getMonth();
day = getDay();

//
// Determine and print the user's sign
//

cout << "Your sign is ";


// --------------------------------
// ----- ENTER YOUR CODE HERE -----
// --------------------------------

switch (getSign)
{
case 1:
if ((month == 1) && (1 <= day <= 19))
cout << "Capricorn.";
break;
}
// --------------------------------
// --------- END USER CODE --------
// --------------------------------


cout << endl;

}


int getMonth()
{
using namespace std;

int month;
cout << "Enter the month of your birthday (1-12): ";
cin >> month;
while ((month < 1) || (month > 12))
{
cout << "Month must be between 1 and 12; please re-enter: ";
cin >> month;
}
return month;
}


int getDay()
{
using namespace std;

int day;
cout << "Enter the day of your birthday (1-31): ";
cin >> day;
while ((day < 0) || (day > 31))
{
cout << "Day must be between 1 and 31; please re-enter: ";
cin >> day;
}
return day;
}
GeneralNevermind, figured it out... Pin
boomer7916-Feb-08 14:16
boomer7916-Feb-08 14:16 
GeneralRe: Nevermind, figured it out... Pin
Bram van Kampen17-Feb-08 4:52
Bram van Kampen17-Feb-08 4:52 
GeneralRe: noob needs some help with C++ programming class Pin
Hamid_RT18-Feb-08 7:32
Hamid_RT18-Feb-08 7:32 
GeneralMFC - ADO - Windows Vista Pin
Demian Panello16-Feb-08 10:09
Demian Panello16-Feb-08 10:09 
QuestionNeed some solutions! Pin
Johan1316-Feb-08 8:04
Johan1316-Feb-08 8:04 
GeneralRe: Need some solutions! Pin
Hamid_RT18-Feb-08 7:33
Hamid_RT18-Feb-08 7:33 
QuestionReading a file into an array Pin
jonsey2984716-Feb-08 4:51
jonsey2984716-Feb-08 4:51 
GeneralRe: Reading a file into an array Pin
CPallini16-Feb-08 6:54
mveCPallini16-Feb-08 6:54 
GeneralRe: Reading a file into an array Pin
jonsey2984716-Feb-08 8:24
jonsey2984716-Feb-08 8:24 
GeneralRe: Reading a file into an array Pin
CPallini16-Feb-08 10:01
mveCPallini16-Feb-08 10:01 
GeneralRe: Reading a file into an array Pin
jonsey2984716-Feb-08 15:25
jonsey2984716-Feb-08 15:25 
GeneralRe: Reading a file into an array Pin
CPallini16-Feb-08 22:35
mveCPallini16-Feb-08 22:35 
GeneralRe: Reading a file into an array Pin
jonsey2984717-Feb-08 10:18
jonsey2984717-Feb-08 10:18 
GeneralRe: Reading a file into an array Pin
CPallini17-Feb-08 21:53
mveCPallini17-Feb-08 21:53 
GeneralRe: Reading a file into an array Pin
Rajkumar R16-Feb-08 23:47
Rajkumar R16-Feb-08 23:47 
GeneralRe: Reading a file into an array Pin
jonsey2984717-Feb-08 10:31
jonsey2984717-Feb-08 10:31 
GeneralRe: Reading a file into an array Pin
Rajkumar R17-Feb-08 18:22
Rajkumar R17-Feb-08 18:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.