Click here to Skip to main content
15,929,504 members
Home / Discussions / C#
   

C#

 
QuestionC# code to relate two nodes Pin
AshwiniSH26-Nov-13 19:33
professionalAshwiniSH26-Nov-13 19:33 
AnswerRe: C# code to relate two nodes Pin
Bernhard Hiller26-Nov-13 21:11
Bernhard Hiller26-Nov-13 21:11 
GeneralRe: C# code to relate two nodes Pin
AshwiniSH26-Nov-13 21:59
professionalAshwiniSH26-Nov-13 21:59 
AnswerRe: C# code to relate two nodes Pin
OriginalGriff26-Nov-13 23:13
mveOriginalGriff26-Nov-13 23:13 
AnswerRe: C# code to relate two nodes Pin
Richard MacCutchan27-Nov-13 0:28
mveRichard MacCutchan27-Nov-13 0:28 
QuestionMatrices and moving objects in Unity3D c# Pin
begginerc226-Nov-13 3:57
begginerc226-Nov-13 3:57 
SuggestionRe: Matrices and moving objects in Unity3D c# Pin
Richard MacCutchan26-Nov-13 5:54
mveRichard MacCutchan26-Nov-13 5:54 
QuestionGetting a value from one method to another method Pin
Member 982953626-Nov-13 2:16
Member 982953626-Nov-13 2:16 
Hi everyone, I'm currently having a problem in fixing my program. I put a comment in the code below where I think the problem is. I can't pass the values in the methods getWood and getDrawer to the method calcPrice. In the Main(), it should display there all of the information. I'm stuck in this thing please help me thank you so much.

C#
using System;

public class DesksP
	{
		static int Main()
		{
			int drawerA = getDrawer();
			string getWoodA = getWood();
			int getPrice = calcPrice(); //error in here says no overload for method 'calcPrice' takes 0 arguments
			Console.WriteLine("The number of drawers is/are: {0}", drawerA);
            Console.WriteLine("The type of wood is: {0}", getWoodA);
			Console.WriteLine("The total cost of drawer/s is/are: {0}", getPrice);
			return 0;
		}
		
		private static int getDrawer()
		{
			int numDrawers;
			Console.Write("Enter number of drawer/s: ");
			return numDrawers = Convert.ToInt32((Console.ReadLine()));
		}
		
		private static string getWood()
		{
			string woodType;
			Console.WriteLine("Enter the type of wood. m for Mahogany, p for Pine and o for Oak: ");
			return woodType = Console.ReadLine();
		}
		
		private static int calcPrice(int drawerA, char getWoodA) //error in here says location of symbol related to previous error
		{
			int total = 0;
			if(getWoodA == 'p')
				total = drawerA * 100;
			else if(getWoodA == 'o')
				total = drawerA * 140;
			else
				total = drawerA * 180;
			return total;
		}
	}


modified 26-Nov-13 8:27am.

AnswerRe: Getting a value from one method to another method Pin
OriginalGriff26-Nov-13 2:36
mveOriginalGriff26-Nov-13 2:36 
GeneralRe: Getting a value from one method to another method Pin
Member 982953626-Nov-13 3:17
Member 982953626-Nov-13 3:17 
GeneralRe: Getting a value from one method to another method Pin
GuyThiebaut26-Nov-13 3:48
professionalGuyThiebaut26-Nov-13 3:48 
GeneralRe: Getting a value from one method to another method Pin
OriginalGriff26-Nov-13 3:52
mveOriginalGriff26-Nov-13 3:52 
AnswerRe: Getting a value from one method to another method Pin
Richard MacCutchan26-Nov-13 2:46
mveRichard MacCutchan26-Nov-13 2:46 
QuestionNeed Decrypt Code Pin
Pradeep Dwivedi26-Nov-13 1:09
Pradeep Dwivedi26-Nov-13 1:09 
AnswerRe: Need Decrypt Code Pin
Dave Kreskowiak26-Nov-13 1:31
mveDave Kreskowiak26-Nov-13 1:31 
AnswerRe: Need Decrypt Code Pin
Manfred Rudolf Bihy26-Nov-13 2:05
professionalManfred Rudolf Bihy26-Nov-13 2:05 
AnswerRe: Need Decrypt Code Pin
OriginalGriff26-Nov-13 2:38
mveOriginalGriff26-Nov-13 2:38 
AnswerRe: Need Decrypt Code Pin
Bernhard Hiller26-Nov-13 21:35
Bernhard Hiller26-Nov-13 21:35 
GeneralNeed Guidens Pin
Member 1042601125-Nov-13 18:43
Member 1042601125-Nov-13 18:43 
GeneralRe: Need Guidens Pin
BillWoodruff25-Nov-13 20:25
professionalBillWoodruff25-Nov-13 20:25 
GeneralRe: Need Guidens Pin
Snehasish_Nandy25-Nov-13 20:55
professionalSnehasish_Nandy25-Nov-13 20:55 
GeneralRe: Need Guidens Pin
Abhinav S25-Nov-13 21:37
Abhinav S25-Nov-13 21:37 
QuestionHelp solve the question in a language C #? Pin
Sdam Basha25-Nov-13 5:43
Sdam Basha25-Nov-13 5:43 
SuggestionRe: Help solve the question in a language C #? Pin
Richard MacCutchan25-Nov-13 5:49
mveRichard MacCutchan25-Nov-13 5:49 
AnswerRe: Help solve the question in a language C #? Pin
OriginalGriff25-Nov-13 6:01
mveOriginalGriff25-Nov-13 6:01 

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.