C# programming trouble (not visual C#)

Discussion in 'Visual C# .Net' started by DN Admin, Jul 2, 2012.

  1. DN Admin

    Staff Member

    Joined:
    Aug 7, 2010
    Location:
    Joliet, IL U.S.A.
    <p style="line-height:normal <span style="color:black; font-family:'Verdana','sans-serif'; font-size:8.5pt I'm trying to write a program that prompts the user for the following information:</span>
    <ul type="disc
    <li style="color:black; line-height:normal; margin-bottom:11.25pt <span style="font-family:'Verdana','sans-serif'; font-size:8.5pt Name
    </span></li><li style="color:black; line-height:normal; margin-bottom:11.25pt <span style="font-family:'Verdana','sans-serif'; font-size:8.5pt Social security number
    </span></li><li style="color:black; line-height:normal; margin-bottom:11.25pt <span style="font-family:'Verdana','sans-serif'; font-size:8.5pt Hourly pay rate
    </span></li><li style="color:black; line-height:normal <span style="font-family:'Verdana','sans-serif'; font-size:8.5pt Number of hours worked
    </span></li></ul>
    <p style="line-height:normal <span style="color:black; font-family:'Verdana','sans-serif'; font-size:8.5pt And displays the following:</span>
    <ul type="disc
    <li style="color:black; line-height:normal; margin-bottom:11.25pt <span style="font-family:'Verdana','sans-serif'; font-size:8.5pt All the input data
    </span></li><li style="color:black; line-height:normal; margin-bottom:11.25pt <span style="font-family:'Verdana','sans-serif'; font-size:8.5pt Gross pay, defined as hourly pay rate times hours worked
    </span></li><li style="color:black; line-height:normal; margin-bottom:11.25pt <span style="font-family:'Verdana','sans-serif'; font-size:8.5pt Federal withholding tax, defined as fifteen percent of the gross pay
    </span></li><li style="color:black; line-height:normal; margin-bottom:11.25pt <span style="font-family:'Verdana','sans-serif'; font-size:8.5pt State withholding tax, defined as five percent of the gross pay
    </span></li><li style="color:black; line-height:normal <span style="font-family:'Verdana','sans-serif'; font-size:8.5pt Net pay, defined as gross pay minus taxes
    </span></li></ul>

    This is where I'm at and I'm getting errors and unsure how to finish the rest of the code:

    <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small
    using System;
    <a> using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    <a> namespace Payroll
    class Program
    <a> {
    private static string name;
    </span></span></span>


    <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small private static string ssn;
    </span></span></span>

    <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small private static string hourly rate;</span></span></span>
    <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small private static string hours worked; static void Main(string[] args)</span></span></span>

    <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small {
    </span></span></span>
    <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small </span></span><span style="color:#2b91af; font-size:small <span style="color:#2b91af; font-size:small <span style="color:#2b91af; font-size:small Console</span></span></span><span style="font-size:small <span style="font-size:small .Write(</span></span><span style="color:#a31515; font-size:small <span style="color:#a31515; font-size:small <span style="color:#a31515; font-size:small "Name:
    "</span></span></span><span style="font-size:small <span style="font-size:small );</span></span>
    <span style="font-size:small <span style="font-size:small
    name = Console.Readline();
    <a> <span style="font-size:small <span style="font-size:small
    Console.Write("SSN: ");
    </span> ssn = Console.Readline();</span> Console.Write("Hourly Rate: ");

    </span> hourly rate = Console.Readline();</span><span style="font-size:small <span style="font-size:small
    Console.Write("Hours Worked: ");</span></span>

    <span style="color:#2b91af; font-size:small <span style="color:#2b91af; font-size:small <span style="color:#2b91af; font-size:small </span></span></span>
    hours worked = Console.Readline();
    }


    View the full article
     
    #1

Share This Page