Click here to Skip to main content
15,910,411 members
Home / Discussions / C#
   

C#

 
AnswerRe: Loading thumbnails in listview.....faster way? Pin
Libor Tinka21-Oct-05 6:44
Libor Tinka21-Oct-05 6:44 
QuestionCheck valid XML element name. Pin
Libor Tinka21-Oct-05 6:12
Libor Tinka21-Oct-05 6:12 
AnswerRe: Check valid XML element name. Pin
whizzs21-Oct-05 10:57
whizzs21-Oct-05 10:57 
AnswerRe: Check valid XML element name. Pin
leppie21-Oct-05 12:31
leppie21-Oct-05 12:31 
QuestionLittle Red 'X' on MDI Pin
Dwayner7921-Oct-05 5:12
Dwayner7921-Oct-05 5:12 
AnswerRe: Little Red 'X' on MDI Pin
Libor Tinka21-Oct-05 6:16
Libor Tinka21-Oct-05 6:16 
GeneralRe: Little Red 'X' on MDI Pin
Dwayner7921-Oct-05 7:37
Dwayner7921-Oct-05 7:37 
QuestionBeginner Help: Unassigned local variable Pin
ivelander21-Oct-05 4:19
ivelander21-Oct-05 4:19 
Hello all, I am brand new to the C# world and am having issues with my first program. Below is the code, and I am getting an "Unassigned local variable" on the Console.Write for the finalSalary variable. Is my problem with data type, or more likely the conditional? Thanks in advance for the help, and I appologize for the simplicity of my problem!

<code>using System;

namespace EmployeeSalary
{
/// <summary>
/// Calculates employee salary based on experience, birthday, position, and company success
/// </summary>

class EmployeeSalary
{

[STAThread]
static void Main(string[] args)
{
int executive, //employee's executive status
baseSalary = 5000; //employee's base salary
finalSalary, //employee's final salary
experience, //employee's years of experience
birthday; //employee's birthday bonus





// Employee's executive status (1 = exec, 2 = not exec)
Console.Write( "Please enter executive code (1 = yes 2 = no): " );
executive = Int32.Parse( Console.ReadLine() );
if ( executive == 1 )
Console.WriteLine( "\nSorry, you're an executive, no benefits for you!" );

//Employee's years of experience (1 = less than 3 yrs, 2 = 3 to 5 yrs, 3 = over 5 yrs)
Console.WriteLine( "\nPlease enter your experience code (1 = less than 3 yrs, 2 = 3-5 yrs, 2 = over 5 yrs)" );
experience = Int32.Parse( Console.ReadLine() );
if ( experience == 1 ) finalSalary = baseSalary - 2000;
else if ( experience == 2 ) finalSalary = baseSalary + 2500;
else if ( experience == 3 ) finalSalary = baseSalary + baseSalary;
else Console.WriteLine("That is not a valid entry");


//Write final salary
Console.WriteLine(finalSalary.ToString("c"));



}
}
}</code>
AnswerRe: Beginner Help: Unassigned local variable Pin
Member 114619621-Oct-05 4:34
Member 114619621-Oct-05 4:34 
GeneralRe: Beginner Help: Unassigned local variable Pin
ivelander21-Oct-05 4:41
ivelander21-Oct-05 4:41 
GeneralRe: Beginner Help: Unassigned local variable Pin
Matt Gerrans21-Oct-05 16:08
Matt Gerrans21-Oct-05 16:08 
AnswerRe: Beginner Help: Unassigned local variable Pin
Tom Larsen21-Oct-05 4:58
Tom Larsen21-Oct-05 4:58 
AnswerRe: Beginner Help: Unassigned local variable Pin
whizzs21-Oct-05 11:07
whizzs21-Oct-05 11:07 
QuestionWriting a Trailware for an Application Pin
Samar Aarkotti21-Oct-05 4:18
Samar Aarkotti21-Oct-05 4:18 
AnswerRe: Writing a Trailware for an Application Pin
Tom Larsen21-Oct-05 4:54
Tom Larsen21-Oct-05 4:54 
GeneralRe: Writing a Trailware for an Application Pin
Samar Aarkotti21-Oct-05 5:22
Samar Aarkotti21-Oct-05 5:22 
GeneralRe: Writing a Trailware for an Application Pin
Tom Larsen21-Oct-05 8:09
Tom Larsen21-Oct-05 8:09 
GeneralRe: Writing a Trailware for an Application Pin
Samar Aarkotti21-Oct-05 8:26
Samar Aarkotti21-Oct-05 8:26 
GeneralRe: Writing a Trailware for an Application Pin
Tom Larsen21-Oct-05 10:55
Tom Larsen21-Oct-05 10:55 
GeneralRe: Writing a Trailware for an Application Pin
Samar Aarkotti22-Oct-05 6:06
Samar Aarkotti22-Oct-05 6:06 
GeneralRe: Writing a Trailware for an Application Pin
Samar Aarkotti22-Oct-05 7:35
Samar Aarkotti22-Oct-05 7:35 
QuestionHow to save a hotkey assignment Pin
mav.northwind21-Oct-05 3:54
mav.northwind21-Oct-05 3:54 
AnswerRe: How to save a hotkey assignment Pin
sebastud21-Oct-05 7:20
sebastud21-Oct-05 7:20 
GeneralRe: How to save a hotkey assignment Pin
mav.northwind21-Oct-05 23:39
mav.northwind21-Oct-05 23:39 
QuestionRemoting server crashes when client quits Pin
polisen21-Oct-05 3:53
polisen21-Oct-05 3:53 

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.