Click here to Skip to main content
15,925,895 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Getting an Interface from a generic object Pin
ian mariano6-Mar-04 6:52
ian mariano6-Mar-04 6:52 
GeneralRe: Getting an Interface from a generic object Pin
Daniel Soderberg6-Mar-04 7:41
Daniel Soderberg6-Mar-04 7:41 
GeneralRe: Getting an Interface from a generic object Pin
Jonathan de Halleux7-Mar-04 21:56
Jonathan de Halleux7-Mar-04 21:56 
GeneralProblems with Crystal Pin
Jamie Nordmeyer4-Mar-04 12:32
Jamie Nordmeyer4-Mar-04 12:32 
GeneralPropertyGrid - browsable attribute Pin
jbmeeh3-Mar-04 6:56
jbmeeh3-Mar-04 6:56 
GeneralRe: PropertyGrid - browsable attribute Pin
ian mariano3-Mar-04 10:54
ian mariano3-Mar-04 10:54 
Generalchart needed for .NET framework Pin
Patric_J2-Mar-04 5:59
Patric_J2-Mar-04 5:59 
GeneralRe: chart needed for .NET framework Pin
Marcie Jones3-Mar-04 3:44
Marcie Jones3-Mar-04 3:44 
GeneralClearing JIT buffer Pin
Yaron K.2-Mar-04 2:07
Yaron K.2-Mar-04 2:07 
GeneralRe: Clearing JIT buffer Pin
ian mariano4-Mar-04 11:22
ian mariano4-Mar-04 11:22 
General.Net listbox Pin
HCassidy1-Mar-04 10:14
HCassidy1-Mar-04 10:14 
GeneralMakeTransparent Pin
Member 1318591-Mar-04 8:33
Member 1318591-Mar-04 8:33 
GeneralSQLState error 9999B, SQLCODE 999999800 Pin
Lola Copinga1-Mar-04 7:23
Lola Copinga1-Mar-04 7:23 
GeneralFullscreen / Windowed mode toggle Pin
Steve Messer28-Feb-04 20:37
Steve Messer28-Feb-04 20:37 
GeneralSingle Instance issue Pin
Steve Messer28-Feb-04 20:32
Steve Messer28-Feb-04 20:32 
GeneralImageFormat Pin
Jon Sagara27-Feb-04 22:14
Jon Sagara27-Feb-04 22:14 
GeneralRe: ImageFormat Pin
David Stone27-Feb-04 23:04
sitebuilderDavid Stone27-Feb-04 23:04 
GeneralRe: ImageFormat Pin
Jon Sagara28-Feb-04 7:47
Jon Sagara28-Feb-04 7:47 
GeneralRe: ImageFormat Pin
Stephane Rodriguez.2-Mar-04 6:35
Stephane Rodriguez.2-Mar-04 6:35 
GeneralDataSet Clear() performance problem Pin
Dan Bunea27-Feb-04 1:00
Dan Bunea27-Feb-04 1:00 
GeneralRe: DataSet Clear() performance problem Pin
apferreira27-Feb-04 7:15
apferreira27-Feb-04 7:15 
GeneralRe: DataSet Clear() performance problem Pin
Dan Bunea27-Feb-04 7:20
Dan Bunea27-Feb-04 7:20 
GeneralRe: DataSet Clear() performance problem Pin
apferreira27-Feb-04 7:33
apferreira27-Feb-04 7:33 
GeneralRe: DataSet Clear() performance problem Pin
Dan Bunea28-Feb-04 23:11
Dan Bunea28-Feb-04 23:11 
GeneralCalling a function in C++.NET Pin
benibo26-Feb-04 20:09
benibo26-Feb-04 20:09 
I need help folks,me and a couple of my friends spent the better part of 14 hours trying to figure out this code.The object of the code is to find a person's socioeconomic class based on their income.We are using functions for this but the problem is that when i run the program,the console prompts me for income after it has displayed the other information.Below is the code attached please if a good samaritan can look at this code and tell me what i can do to fix it.Thank you.



include "stdafx.h"

#using <mscorlib.dll>
#include <tchar.h>

using namespace System;

// Prototype for Functions
String *GetFirstName(void);
String *GetLastName(void);
String *GetSocSecNum(void);
String *GetGender(void);
int GetAge(void);
double GetIncome(void);


void DisplayOutput(String*, String*, String*, String*, int);

//This is the entry point for this application
int _tmain(void)
{
//Declaration of Variables
String *FName;
String *LName;
String *SSN;
String *Gender;



double Income;

int Age;
wchar_t Next;

do
{
FName = GetFirstName();
LName = GetLastName();
SSN = GetSocSecNum();
Gender = GetGender();
Age =GetAge();


DisplayOutput(FName, LName, SSN, Gender, Age);
Income = GetIncome();





//Request to do another individual
Console::Write(S"\n\nWould you like to process another
Individual(y/n): ");
Next=Char::Parse(Console::ReadLine());
}while (Next=='y' || Next=='Y');

if (Next=='n' || Next=='N')
//Printout of Information
Console::WriteLine(S"\nGood Bye");

return 0;
}

//Functions:

//Prompt User for First Name
String *GetFirstName(void)
{ Console::Write(S"\nEnter the Individual's First Name: ");
String *FName=Console::ReadLine();
return FName;
}

//Prompt User for Last Name
String *GetLastName(void)
{ Console::Write(S"\nEnter the Individual's Last Name: ");
String *LName=Console::ReadLine();
return LName;
}

//Prompt user for SSN
String *GetSocSecNum(void)
{ Console::Write(S"\nEnter Social Security Number: ");
String *SSN=(Console::ReadLine());
return SSN;
}

//Prompt User for Gender
String *GetGender(void)
{ Console::Write(S"\nEnter the Gender: ");
String *Gender=Console::ReadLine();
return Gender;
}

//Prompt user for Age
int GetAge(void)
{
Console::Write(S"\nEnter Individual's Age: ");
const int Age=Int32::Parse(Console::ReadLine());

return Age;
}
//Display Information
void DisplayOutput(String *FName, String *LName, String *SSN, String
*Gender, int Age)
{
Console::WriteLine(S"\n\t US Census Bureau");
Console::WriteLine(S"\tPersonal Information");
Console::Write(S"\n\tName:\t {0}", FName);
Console::Write(S"\n\tSSN:\t {0}", SSN);
Console::Write(S"\n\tGender:\t {0}", Gender);
Console::Write(S"\n\tAge:\t {0}", Age.ToString());

}

//Prompt User for Income
double GetIncome(void)
{
Console::Write(S"\nEnter Individual's Income: ");
double Income=Double::Parse(Console::ReadLine());
if
(Income>=250000){
Console::Write(S"\n\tSocioeconomic Class: Upper Income");
}
else if
(Income<250000 && Income>=100000){
Console::Write(S"\n\tSocioeconomic Class: Upper Middle Income");
}
else if
(Income<100000&&Income>=50000){
Console::Write(S"\n\tSocioeconomic Class: Middle Income");
}
else if
(Income<50000&&Income>=250000){
Console::Write(S"\n\tSocioeconomic Class: Upper Lower Income");
}

else {
(Income<25000);
Console::Write(S"\n\tSocioeconomic Class: Lower Income");}


return Income;
}




//End Function

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.