16,020,315 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by RalvarezHose (Top 29 by date)
RalvarezHose
14-Jul-14 18:30pm
View
I understand your point. This is not an homework assignment. I got this code from online and just wanted to see how it works. I found lots of other codes that work and doesn't work. But for that doesn't work that error fixed in the comment by another user. My programming is not good. In Main list.PrintNodes() has been called but LinkedList class has no such method defined. But I don't know where exactly to add it. I have been trying for last two hours. I just wanted to know, that way if I find something like this in next problem I will be able to solve it.
RalvarezHose
4-May-14 21:14pm
View
Deleted
I read it and re did it again. I got the output I was trying to get. But still not sure I did it right way. I will post the codes, do you mind verifying it one more time. Thank you.
RalvarezHose
4-May-14 16:38pm
View
Deleted
Not really. I am having hard time to get those. I thought I understood, when there was only one class and one derived class. But now, I think I am way off. I was just using an example below from a book as reference.
Base class must be first Interface names
↓ ↓
class Derived : MyBaseClass, IIfc1, IEnumerable, IComparable
{
...
}
Can you show me the right way to do it?
RalvarezHose
4-May-14 15:24pm
View
Deleted
I think I haven't been to implement from derived classes. Can you show me a simple example how do I include derived class from base class plz.
RalvarezHose
4-May-14 14:51pm
View
Deleted
Sorry about the confusion. I am just trying to write code for an assembly of classes with the baseclass Duck, interfaces IFlyBehavior, IQuackBehavior, and ISwimBehavior. Also trying to include derived classes class Mallar, class RubberDuck, and class DecoyDuck, that each derive from class Duck.
RalvarezHose
4-May-14 0:13am
View
I am really sorry but I am having hard time understanding this. Can you explain little bit more, how compiler does it by itself.
RalvarezHose
3-May-14 23:31pm
View
I have these codes.
Console.Writeline("i = {0\t obj = {1}", i ,obj);
obj *=2;
RalvarezHose
3-May-14 22:02pm
View
Okay got it thanks.
RalvarezHose
3-May-14 20:38pm
View
Quick question. outputs:
Baby is called: kitten
Baby is called: puppy
Is because of the foreach loop correct?
RalvarezHose
3-May-14 19:10pm
View
Thank you. There was a printing error in the book "! =" and error from my side "b.Babycalled."
RalvarezHose
21-Apr-14 20:30pm
View
namespace Interfaces
{
interface IInfo
{
string GetName();
string GetAge();
}
class CA : IInfo
{
public string Name;
public int Age;
public string GetName() { return Name; }
public string GetAge() { return Age.ToString(); }
}
class CB : IInfo
{
public string First;
public string Last;
public double PersonsAge;
public string GetName() { return First + " " + Last; }
public string GetAge() { return PersonsAge.ToString(); }
}
class Program
{
static void PrintInfo(IInfo item)
{
Console.WriteLine("Name: {0}, Age {1}", item.GetName(), item.GetAge());
}
static void Main()
{
CA a = new CA() { Name = "John Doe", Age = 35 };
CB b = new CB() { First = "Jane", Last = "Doe", PersonsAge = 33 };
PrintInfo(a);
PrintInfo(b);
}
}
}
RalvarezHose
21-Apr-14 20:30pm
View
I was looking at the following codes below and trying to do the same with the above informations
RalvarezHose
7-Apr-14 19:01pm
View
Thank you Sergey for confirming the codes. And your past answers are also very helpful.
RalvarezHose
1-Apr-14 0:01am
View
Thank you Peter. That makes a whole lot of sense than reading the same example over and over again in the book.
RalvarezHose
31-Mar-14 23:25pm
View
That's the one exactly from the book. If you have any good books in mind please let me know.
RalvarezHose
25-Mar-14 0:01am
View
Thank you so much. I think I got it this time. Wouldn't be possible without your help though. You are awesome.
RalvarezHose
24-Mar-14 13:41pm
View
{ class Magic
{
private int spiders;
public int Spiders
{
set
{spiders = value;
}
get
{return spiders;
}
}
private int toads;
public int Toads
{
set
{toads = value;
}
get
{return toads;
}
}
public void do_myMagic()
{
Console.WriteLine("Pooofff");
}
public Magic()
{
}
public Magic(int arg1, int arg2)
{
toads = arg1;
spiders = arg2;
}
class Program
{
static void Main()
{
Magic myMagic = new Magic(3,5);
myMagic.do_myMagic();
}
}
}
}
RalvarezHose
24-Mar-14 13:40pm
View
With your help, so far I have come up with following codes. Still not getting completely what I am missing.
RalvarezHose
24-Mar-14 12:16pm
View
I am taking intermediate programming C#. It is a four year college and this is my second class in programming. Not only I, most of the students in my class having same problem. Not understanding the concept pretty well. Anyway, thank you for the sending those resources. I really appreciate that.
RalvarezHose
24-Mar-14 0:48am
View
Thank you for your help. You are right I have very little knowledge on constructors, in fact very little knowledge. I will definitely read on constructors and try to complete this.
RalvarezHose
24-Mar-14 0:36am
View
Can you refer me to a good C# programming book?
RalvarezHose
24-Mar-14 0:36am
View
My instructor has a C++ background, he recently studied C# and this is his second semester. He himself is confused while teaching. Whatever I have learned, I used youtube and all other online resources. I even don't know what the above program was asking and what would be its output.
RalvarezHose
3-Mar-14 19:27pm
View
Got it thanks. I was thinking, I declared the "sum" as double, therefore the output of sum will also be in decimals.
RalvarezHose
23-Feb-14 14:13pm
View
Got it. Thank you so much for your help. It helped me clear lot of confusion I was having.
RalvarezHose
23-Feb-14 13:59pm
View
I got these two error messages when I move trihypo to function.
Error 1 The name 'trihypotenuse' does not exist in the current context C:\Users\Bibek\Desktop\Winter classes 2013\Introduction to Programing C#\Assignments\ProjectFive\ProjectFiveOne\ProjectFiveOne\Program.cs 16 63 ProjectFiveOne
Error 2 A local variable named 'trihypotenuse' cannot be declared in this scope because it would give a different meaning to 'trihypotenuse', which is already used in a 'parent or current' scope to denote something else C:\Users\Bibek\Desktop\Winter classes 2013\Introduction to Programing C#\Assignments\ProjectFive\ProjectFiveOne\ProjectFiveOne\Program.cs 27 20 ProjectFiveOne
RalvarezHose
23-Feb-14 13:57pm
View
{ class Program
{
static void Main(string[] args)
{
double tribase = 6;
double triwidth = 9;
double triarea = triArea(tribase, triwidth);
double triperimeter = triPerimeter(tribase, triwidth, trihypotenuse);
Console.WriteLine("Area of right triangle = {0}\nPerimeter of rigth triangle = {1}\n", triarea, triperimeter);
double squareside = 8;
double squarearea = GetSquareArea(squareside);
double squareperimeter = GetSquarePerimeter (4 * squareside);
Console.WriteLine("Area of square = {0}\nPerimeter of square = {1}\n", squarearea, squareperimeter);
}
private static double triPerimeter(double tribase, double triwidth, double trihypotenuse)
{
double trihypotenuse = Math.Sqrt((tribase * tribase) + (triwidth * triwidth));
double triperimeter = tribase + triwidth + trihypotenuse;
return triperimeter;
}
private static double triArea(double tribase, double triwidth)
{
double triarea = 0.5 * (tribase * triwidth);
return triarea;
}
static double GetSquareArea(double squareside)
{
double squarearea = squareside * squareside;
return squarearea;
}
static double GetSquarePerimeter(double squareside)
{
double squareperimeter = 4 * squareside;
return squareperimeter;
}
}
RalvarezHose
23-Feb-14 13:34pm
View
Thank you so much.
RalvarezHose
23-Feb-14 13:25pm
View
Yes, I am using visual studio 2013 express for desktop.
RalvarezHose
23-Feb-14 13:10pm
View
Yes, it was one of my homework question, it is now 3 weeks past due, got only half a point. Professor told me to use any resource and get it right and she will give me couple of extra points. So far I have got following:
static double GetSquareArea(double squareside)
{
double squarearea = squareside * squareside;
return squarearea;
}
static double GetSquarePerimeter(double squareside)
{
double squareperimeter = 4 * squareside;
return squareperimeter;
}
No idea how to do perimeter and area of right triangle in different functions.
Show More