Click here to Skip to main content
15,888,246 members
Home / Discussions / C#
   

C#

 
GeneralRe: Create own language translator in C# Pin
Pete O'Hanlon25-Sep-16 20:35
mvePete O'Hanlon25-Sep-16 20:35 
GeneralRe: Create own language translator in C# Pin
Dave Kreskowiak23-Sep-16 2:15
mveDave Kreskowiak23-Sep-16 2:15 
GeneralRe: Create own language translator in C# Pin
OriginalGriff23-Sep-16 1:57
mveOriginalGriff23-Sep-16 1:57 
GeneralRe: Create own language translator in C# Pin
Jammer24-Sep-16 1:46
Jammer24-Sep-16 1:46 
GeneralRe: Create own language translator in C# Pin
Pete O'Hanlon24-Sep-16 3:23
mvePete O'Hanlon24-Sep-16 3:23 
AnswerRe: Create own language translator in C# Pin
OriginalGriff22-Sep-16 22:58
mveOriginalGriff22-Sep-16 22:58 
AnswerRe: Create own language translator in C# Pin
Gerry Schmitz24-Sep-16 6:34
mveGerry Schmitz24-Sep-16 6:34 
QuestionHaving Trouble With this code Pin
RizingPhoenix21-Sep-16 8:42
RizingPhoenix21-Sep-16 8:42 
So im practicing some C# basic concepts and was writing some code to simply calculate the income of a person after asking them to input their name, PayRate and Income and then displaying the income of that same person before and after taxes. However, after the user inputs their hours-per-week the program seems to jump past asking for their PayRate and displays their weekly income before and after taxes, so if someone could point out what i did wrong itd help me out, Thanks! Also the Console.ReadLine() and the console.Read() at the end of the program is to simply keep the command window open so i can check my work since it seems to want to close immediately after the code has been run instead of allowing me a chance to analyze the output so if someone could help me with that too it would be greatly appreciated thanks again.



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LearningCs
{
class Program
{
static double CalcWeeklyIncome(double hours, double PayRate)
{

double income;
income = hours * PayRate;

return income;
}

static double CalcIncomeAfterTaxes(double income)
{
const double TaxRate = .2333;

income = income - (TaxRate * income);
return income;
}

static void Main(string[] args)
{
double hours, PayRate, Income;
string name;


Console.WriteLine("Please Input your Name: ");
name = Console.ReadLine();

Console.WriteLine("Please input your hours-per-week: ");
hours = Console.Read();

Console.WriteLine("Please input your Hourly Pay Rate: ");
PayRate = Console.Read();

Income = CalcWeeklyIncome(hours, PayRate);

Console.WriteLine(name + "'s income before taxes is " + Income);

CalcIncomeAfterTaxes(Income);

Console.WriteLine("The Income After taxes for " + name + " Is " + Income);


Console.ReadLine();
Console.Read();
}


}
}
AnswerRe: Having Trouble With this code Pin
Richard Deeming21-Sep-16 8:54
mveRichard Deeming21-Sep-16 8:54 
AnswerRe: Having Trouble With this code Pin
Ahmad Bukhari21-Sep-16 20:01
Ahmad Bukhari21-Sep-16 20:01 
AnswerRe: Having Trouble With this code Pin
RizingPhoenix21-Sep-16 20:57
RizingPhoenix21-Sep-16 20:57 
SuggestionRe: Having Trouble With this code Pin
Richard Deeming22-Sep-16 1:54
mveRichard Deeming22-Sep-16 1:54 
GeneralRe: Having Trouble With this code Pin
Kelly Herald2-Nov-16 9:22
Kelly Herald2-Nov-16 9:22 
QuestionFileSystemWatcher in c # Pin
Luis_Saenz21-Sep-16 4:46
Luis_Saenz21-Sep-16 4:46 
SuggestionRe: FileSystemWatcher in c # Pin
ZurdoDev21-Sep-16 5:05
professionalZurdoDev21-Sep-16 5:05 
AnswerRe: FileSystemWatcher in c # Pin
Maciej Los21-Sep-16 5:08
mveMaciej Los21-Sep-16 5:08 
QuestionJSON.Net - Error when I get value from a JToken that could be either a JValue or JArray Pin
inquisitive_121-Sep-16 3:48
inquisitive_121-Sep-16 3:48 
AnswerRe: JSON.Net - Error when I get value from a JToken that could be either a JValue or JArray Pin
onelopez21-Sep-16 4:59
onelopez21-Sep-16 4:59 
GeneralRe: JSON.Net - Error when I get value from a JToken that could be either a JValue or JArray Pin
inquisitive_121-Sep-16 6:11
inquisitive_121-Sep-16 6:11 
AnswerRe: JSON.Net - Error when I get value from a JToken that could be either a JValue or JArray Pin
Nathan Minier21-Sep-16 5:09
professionalNathan Minier21-Sep-16 5:09 
GeneralRe: JSON.Net - Error when I get value from a JToken that could be either a JValue or JArray Pin
inquisitive_121-Sep-16 5:57
inquisitive_121-Sep-16 5:57 
QuestionControl is very similar ComboBox to what's it the name ? Pin
Member 245846720-Sep-16 16:18
Member 245846720-Sep-16 16:18 
AnswerRe: Control is very similar ComboBox to what's it the name ? Pin
BillWoodruff21-Sep-16 3:05
professionalBillWoodruff21-Sep-16 3:05 
QuestionRe: Control is very similar ComboBox to what's it the name ? Pin
ZurdoDev21-Sep-16 3:27
professionalZurdoDev21-Sep-16 3:27 
QuestionFTP Multiple Files With Progress Pin
Kevin Marois20-Sep-16 9:40
professionalKevin Marois20-Sep-16 9:40 

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.