Click here to Skip to main content
15,887,683 members
Home / Discussions / C#
   

C#

 
AnswerRe: coloring a cell via datagridview cellformatting event Pin
Luc Pattyn19-May-18 12:04
sitebuilderLuc Pattyn19-May-18 12:04 
AnswerRe: coloring a cell via datagridview cellformatting event Pin
OriginalGriff19-May-18 19:55
mveOriginalGriff19-May-18 19:55 
AnswerRe: coloring a cell via datagridview cellformatting event Pin
leone24-May-18 11:13
leone24-May-18 11:13 
QuestionI want to read a value from a gridview cell using button event, something i'm not getting right here. Pin
Ngqulunga19-May-18 2:02
Ngqulunga19-May-18 2:02 
Questioni need to save me textbox data to separate line in notepad Pin
Mohamed Fahad M18-May-18 23:41
Mohamed Fahad M18-May-18 23:41 
AnswerRe: i need to save me textbox data to separate line in notepad Pin
OriginalGriff18-May-18 23:59
mveOriginalGriff18-May-18 23:59 
AnswerRe: i need to save me textbox data to separate line in notepad Pin
Dave Kreskowiak20-May-18 5:33
mveDave Kreskowiak20-May-18 5:33 
QuestionMy code is not calculating correctly... I just need an extra pair of eyes to help me see what I am missing. Please help Pin
Member 1383451318-May-18 21:59
Member 1383451318-May-18 21:59 
It builds with no errors but it is not calculating the Net pay in the first if block or the gross pay and net pay in the second if block. Please help...

  static void Main(string[] args)
        {
            const double SINGLE_RATE = .22;
            const double MARRIED_RATE = .15;
            const double WIDOWED_RATE = .13;
            const double DIVORCED_RATE = .23;
            string maritalStatus;
            double hourlyRate = 0, hoursWorked = 0, regularPay = 0, overtimePay = 0, grossPay = 0, taxRate = 0, taxAmount = 0, netPay = 0;


            Console.WriteLine("Please enter in your hourly rate: ");
            hourlyRate = Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("Please enter in your hours worked: ");
            hoursWorked = Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("Please enter in your marital status (M)arried, (S)ingle, (W)idowed, (D)ivorced: ");
            maritalStatus = Console.ReadLine().ToUpper();

            switch (maritalStatus)

            {
                case "M":
                    taxRate = MARRIED_RATE;
                    break;
                case "S":
                    taxRate = SINGLE_RATE;
                    break;
                case "W":
                    taxRate = WIDOWED_RATE;
                    break;
                case "D":
                    taxRate = DIVORCED_RATE;
                    break;
               
            }
            if (hoursWorked <= 40)
            {
                grossPay = (hoursWorked * hourlyRate);
                Console.WriteLine("Your gross pay is: " + grossPay.ToString("C"));
                netPay = (grossPay - taxAmount);
                Console.WriteLine("Your net pay is: " + netPay.ToString("C"));
            
            }
            {
                taxAmount = (grossPay * taxRate);
            }

            if (hoursWorked > 40)
            {
                regularPay = (hoursWorked * hourlyRate);
                Console.WriteLine(value: "Your regular pay is: " + regularPay.ToString("C"));
                overtimePay = (hoursWorked - 40) * hourlyRate * 1.5;
                Console.WriteLine("Your overtime pay is: " + overtimePay.ToString("C"));
                grossPay = (regularPay + overtimePay);
                Console.WriteLine("Your gross pay is: " + grossPay.ToString("C"));
                netPay = (grossPay - taxAmount);
                Console.WriteLine("Your net pay is: " + netPay.ToString("C"));
               

            }

            

            Console.WriteLine("Thank you for using our program");
            Console.ReadLine();
        }
    }
}

AnswerRe: My code is not calculating correctly... I just need an extra pair of eyes to help me see what I am missing. Please help Pin
OriginalGriff18-May-18 22:00
mveOriginalGriff18-May-18 22:00 
AnswerRe: My code is not calculating correctly... I just need an extra pair of eyes to help me see what I am missing. Please help Pin
Richard MacCutchan18-May-18 23:45
mveRichard MacCutchan18-May-18 23:45 
AnswerRe: My code is not calculating correctly... I just need an extra pair of eyes to help me see what I am missing. Please help Pin
Implements Master Yoda21-May-18 4:34
Implements Master Yoda21-May-18 4:34 
QuestionQuestion in principal regarding writing an Outlook Plugin Pin
Jim60718-May-18 0:35
Jim60718-May-18 0:35 
AnswerRe: Question in principal regarding writing an Outlook Plugin Pin
Eddy Vluggen18-May-18 1:23
professionalEddy Vluggen18-May-18 1:23 
GeneralRe: Question in principal regarding writing an Outlook Plugin Pin
Jim60718-May-18 1:39
Jim60718-May-18 1:39 
GeneralRe: Question in principal regarding writing an Outlook Plugin Pin
Eddy Vluggen18-May-18 13:13
professionalEddy Vluggen18-May-18 13:13 
AnswerRe: Question in principal regarding writing an Outlook Plugin Pin
Gerry Schmitz18-May-18 8:14
mveGerry Schmitz18-May-18 8:14 
QuestionApp pool is crashing due to memory leakage Pin
Anoop Mehra17-May-18 18:22
Anoop Mehra17-May-18 18:22 
GeneralRe: App pool is crashing due to memory leakage Pin
Randor 17-May-18 18:45
professional Randor 17-May-18 18:45 
AnswerRe: App pool is crashing due to memory leakage Pin
OriginalGriff17-May-18 20:04
mveOriginalGriff17-May-18 20:04 
GeneralRe: App pool is crashing due to memory leakage Pin
Anoop Mehra17-May-18 22:59
Anoop Mehra17-May-18 22:59 
GeneralRe: App pool is crashing due to memory leakage Pin
OriginalGriff17-May-18 23:26
mveOriginalGriff17-May-18 23:26 
Questionc# array Pin
swathiii15-May-18 21:00
swathiii15-May-18 21:00 
SuggestionRe: c# array Pin
Richard MacCutchan15-May-18 21:30
mveRichard MacCutchan15-May-18 21:30 
AnswerRe: c# array Pin
OriginalGriff15-May-18 21:34
mveOriginalGriff15-May-18 21:34 
GeneralRe: c# array Pin
swathiii15-May-18 21:50
swathiii15-May-18 21:50 

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.