1. On Saturday September 3RD, 2016 this community will be shutdown permanently.

    The time has come to close this community. I no longer have any interest in Visual Studio programming and my efforts to find someone to take over the community has failed.

    If anyone is interested in acquiring the database contact me and I will make it available for you.

C# programming trouble (not visual C#)

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

  1. DN Admin

    DN Admin Administrator
    Staff Member

    Country:
    United States
    Joined:
    Aug 7, 2010
    Messages:
    12,048
    Likes Received:
    258
    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:
    <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
    <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
    <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
    <li style="color:black; line-height:normal <span style="font-family:'Verdana','sans-serif'; font-size:8.5pt Number of hours worked

    <p style="line-height:normal <span style="color:black; font-family:'Verdana','sans-serif'; font-size:8.5pt And displays the following:
    <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
    <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
    <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
    <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
    <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


    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 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 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 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 style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small {

    <span style="color:#0000ff; font-size:small <span style="color:#0000ff; font-size:small <span style="color:#2b91af; font-size:small <span style="color:#2b91af; font-size:small <span style="color:#2b91af; font-size:small Console<span style="font-size:small <span style="font-size:small .Write(<span style="color:#a31515; font-size:small <span style="color:#a31515; font-size:small <span style="color:#a31515; font-size:small "Name:
    "<span style="font-size:small <span style="font-size:small );
    <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: ");
    ssn = Console.Readline(); Console.Write("Hourly Rate: ");

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

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


    View the full article
     

Share This Page