Click here to Skip to main content
15,914,392 members
Home / Discussions / C#
   

C#

 
AnswerRe: Email issue Pin
CodyGen14-Jan-06 1:03
CodyGen14-Jan-06 1:03 
QuestionPortability Pin
tecywiz12113-Jan-06 19:15
tecywiz12113-Jan-06 19:15 
AnswerRe: Portability Pin
Joshua Quick13-Jan-06 21:53
Joshua Quick13-Jan-06 21:53 
AnswerRe: Portability Pin
Daniel Grunwald14-Jan-06 1:35
Daniel Grunwald14-Jan-06 1:35 
GeneralRe: Portability Pin
tecywiz12114-Jan-06 6:10
tecywiz12114-Jan-06 6:10 
GeneralRe: Portability Pin
Daniel Grunwald14-Jan-06 6:14
Daniel Grunwald14-Jan-06 6:14 
GeneralRe: Portability Pin
tecywiz12115-Jan-06 15:14
tecywiz12115-Jan-06 15:14 
QuestionHow to error Pin
Eddy Ho13-Jan-06 16:43
Eddy Ho13-Jan-06 16:43 
hohsin01@yahoo.com.sg or hohsin10@hotmail.com
What's bad??? Pls help me, I do not have techar. Yor are ONE. Thanks!!!
Error 1 The type or namespace name 'IBankAccount' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Test012\Test012\Program.cs 24 33 Test012
Error 2 The type or namespace name 'IBankAccount' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Test012\Test012\Program.cs 57 32 Test012

using System;
using System.Collections.Generic;
using System.Text;
using Wrox.ProCSharp.OOCSharp.BankProtocols;
using Wrox.ProCSharp.OOCSharp.VenusBank;
using Wrox.ProCSharp.OOCSharp.JupiterBank;

namespace Wrox.ProCSharp.OOCSharp.BankProtocols
{
public interface IBanAccount
{
void PayIn(decimal amount);
bool Withdraw(decimal amount);
decimal Balace
{
get;
}
}
}

namespace Wrox.ProCSharp.OOCSharp.VenusBank
{
public class SaverAccount : IBankAccount
{
private decimal balace;
public void PayIn(decimal amoount)
{
balance += amount;
}
public void Withcraw(decimal amoount)
{
if (balance >= amount)
{
balance -= amount;
return true;
}
Console.WriteLine("Writdraw attemp failed");
return false;
}
public decimal Balanc
{
get
{
return balace;
}
}
public override string ToString()
{
return String.Format("Veuns Bank Saver : Balace = (0,6:C)", balance);
}
}
}

namespace Wrox.ProCSharp.OOCSharp.JupiterBank
{
public class GoldAccount : IBankAccount
{
//Console.WriteLine("Writdraw attemp failed");
}
}

namespace Test012
{
class Program
{
static void Main(string[] args)
{
IBankAccount venusAccout = new SaverAccout();
IBankAccount jupiterAccount = new GoldAccount();
venusAccount.PayIn(200);
venusAccount.Withdraw(100);
Console.WriteLine(venusAccount.ToString());
jupiterAccount.PayIn(500);
jupiterAccount.Withdraw(600);
jupiterAccount.Withdraw(100);
Console.WriteLine(jupiterAccount.ToString());
}
}
}

----------------------------------------------------------------------------
Help me, you are one!!!

Error 1 Invalid token 'interface' in class, struct, or interface member declaration C:\Documents and Settings\Administrator\Local Settings\Application Data\Temporary Projects\Test014\Program.cs 11 15 Test014


//Professional C# 2nd Edition -> Pg.128
using System;
using System.Collections.Generic;
using System.Text;


namespace Test014
{
class Program
{
pulic interface IBankAccount
{
void PayIn(decimal amount);
bool Withdraw(decimal amount);
decimal Balance
{
get;
}
}
public class CurrentAcconunt : ITransferAccount
{
private decimal balance;
public void PayIn(decimal amount)
{
balace += amount;
}
public bool Withdraw(decimal amount)
{
if (balance >= amount)
{
balance -= amount;
return true;
}
Console.WriteLine("Withdrawal attempt failed.");
return false;
}

public decimal Balance
{
get
{
return balance;
}
}
public bool TransferTo(IBankAccount destination, decimal anount)
{
bool result;
if((result = Withdraw(amount))== true)
destination.PayIn(amount);
return result;
}
public override string ToString()
{
return String.Format("Jupiter Bank Account: Balance = {0.6:C}", balance);
}
}




static void Main(string[] args)
{
IBankAccount venusAccount = new SaverAccount();
ITransferBankAccount jupiterAccount = new CurrentAccount();
venusAccount.PayIn(200);
jupiterAccount.PayIn(500);
jupiterAccount.TransferT(venusAccount,100);
Console.WriteLine(vernusAccount.ToString());
Console.WriteLine(jupiterAccount.ToString());
return;
}
}
}
AnswerRe: How to error Pin
Dave Kreskowiak13-Jan-06 16:56
mveDave Kreskowiak13-Jan-06 16:56 
AnswerRe: How to error Pin
Dave Kreskowiak14-Jan-06 7:13
mveDave Kreskowiak14-Jan-06 7:13 
QuestionCompress some files by coding C# Pin
tadung13-Jan-06 15:46
tadung13-Jan-06 15:46 
AnswerRe: Compress some files by coding C# Pin
Ravi Bhavnani13-Jan-06 16:05
professionalRavi Bhavnani13-Jan-06 16:05 
GeneralRe: Compress some files by coding C# Pin
MikeDeming13-Jan-06 17:49
MikeDeming13-Jan-06 17:49 
GeneralRe: Compress some files by coding C# Pin
Robert Rohde13-Jan-06 22:23
Robert Rohde13-Jan-06 22:23 
QuestionAvoiding to see controls black Pin
Sasuko13-Jan-06 13:21
Sasuko13-Jan-06 13:21 
AnswerRe: Avoiding to see controls black Pin
Dave Kreskowiak13-Jan-06 14:41
mveDave Kreskowiak13-Jan-06 14:41 
GeneralRe: Avoiding to see controls black Pin
Sasuko14-Jan-06 3:53
Sasuko14-Jan-06 3:53 
GeneralRe: Avoiding to see controls black Pin
Dave Kreskowiak14-Jan-06 7:09
mveDave Kreskowiak14-Jan-06 7:09 
Questionconverting to xp controls Pin
MikeDeming13-Jan-06 13:18
MikeDeming13-Jan-06 13:18 
AnswerRe: converting to xp controls Pin
Sasuko13-Jan-06 13:23
Sasuko13-Jan-06 13:23 
GeneralRe: converting to xp controls Pin
Leyu14-Jan-06 5:04
Leyu14-Jan-06 5:04 
Questionthe blinking cursor Pin
melanieab13-Jan-06 11:07
melanieab13-Jan-06 11:07 
AnswerRe: the blinking cursor Pin
Koushik Biswas13-Jan-06 12:38
Koushik Biswas13-Jan-06 12:38 
GeneralRe: the blinking cursor Pin
Dave Kreskowiak13-Jan-06 14:35
mveDave Kreskowiak13-Jan-06 14:35 
AnswerRe: the blinking cursor Pin
Dave Kreskowiak13-Jan-06 14:36
mveDave Kreskowiak13-Jan-06 14:36 

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.