Click here to Skip to main content
15,889,595 members
Home / Discussions / C#
   

C#

 
QuestionWindows Form Background Pin
Khaniya24-Apr-10 21:32
professionalKhaniya24-Apr-10 21:32 
AnswerRe: Windows Form Background Pin
Michel Godfroid24-Apr-10 22:25
Michel Godfroid24-Apr-10 22:25 
QuestionBrightness and Contrast Jpeg Pin
Iain Wiseman24-Apr-10 21:31
Iain Wiseman24-Apr-10 21:31 
Questioncopy the image of picturebox to anywhere of my computer Pin
guomouren24-Apr-10 21:08
guomouren24-Apr-10 21:08 
QuestionAbstract Class Pin
future383924-Apr-10 14:00
future383924-Apr-10 14:00 
AnswerRe: Abstract Class Pin
future383924-Apr-10 15:07
future383924-Apr-10 15:07 
GeneralRe: Abstract Class Pin
PIEBALDconsult24-Apr-10 16:37
mvePIEBALDconsult24-Apr-10 16:37 
GeneralRe: Abstract Class Pin
future383924-Apr-10 16:48
future383924-Apr-10 16:48 
its the one I have done, so far; I mean part one and two
=========================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace assignmnet1
{
public abstract class Fish
{
protected int weight; //fields definition

/* definition of class property in general
get { return fish_name};
set {fish_name = value}; */

// Abstract read-only properties
public abstract string Name
{
get;
}
public abstract string ScientificName
{
get;
}
public abstract string Acceptable
{
get;
}

//method - public override string ToString().
public override string ToString()
{
return base.ToString();
}


public class AustralianBass : Fish
{
public AustralianBass()
{
Random random = new Random();
weight = random.Next(0, Max_Weight);

}

public const int Max_Weight = 4000;


public override string Name
{
get { throw new NotImplementedException(); }
}

public override string ScientificName
{
get { throw new NotImplementedException(); }
}

public override string Acceptable
{
get { throw new NotImplementedException(); }
}
}

public class ShortFinnedEel : Fish
{
public const int Max_Weight = 3000;


public override string Name
{
get { throw new NotImplementedException(); }
}

public override string ScientificName
{
get { throw new NotImplementedException(); }
}

public override string Acceptable
{
get { throw new NotImplementedException(); }
}
}

public class EelTailedCatfish : Fish
{
public const int Max_Weight = 6800;


public override string Name
{
get { throw new NotImplementedException(); }
}

public override string ScientificName
{
get { throw new NotImplementedException(); }
}

public override string Acceptable
{
get { throw new NotImplementedException(); }
}
}

public class GippslandPerch : Fish
{
public const int Max_Weight = 10000;


public override string Name
{
get { throw new NotImplementedException(); }
}

public override string ScientificName
{
get { throw new NotImplementedException(); }
}

public override string Acceptable
{
get { throw new NotImplementedException(); }
}
}


==================================================================================================
the next part is
Class Fishing. The class should have three methods:
· public static void Fishing() – The method imitates a fishing process. It randomly creates
fishes of different species with random weights, and if a fish is acceptable (i.e. is heavier
than 500 g and still edible) adds the fish in the basket, i.e. writes the fish object to the
basket.dat file . The process continues while the total weight of the fishes in the basket is
less than 15000 g. (15 Kg). To write fish objects to the file you should use Serialize()
method of the BinaryFormatter class (notice, that the Fish class should have [Serializable]
attribute).

public static void ReadBasket() – the method opens the basket.dat file, reads the objects
from the file and prints them in the terminal window.


its the problem, I don't know who to impelement it.
GeneralRe: Abstract Class Pin
future383924-Apr-10 21:22
future383924-Apr-10 21:22 
GeneralRe: Abstract Class Pin
OriginalGriff24-Apr-10 21:29
mveOriginalGriff24-Apr-10 21:29 
GeneralRe: Abstract Class Pin
DaveyM6924-Apr-10 22:53
professionalDaveyM6924-Apr-10 22:53 
GeneralRe: Abstract Class Pin
Eddy Vluggen24-Apr-10 22:56
professionalEddy Vluggen24-Apr-10 22:56 
GeneralRe: Abstract Class Pin
future383925-Apr-10 13:45
future383925-Apr-10 13:45 
GeneralRe: Abstract Class Pin
future383925-Apr-10 17:06
future383925-Apr-10 17:06 
GeneralRe: Abstract Class Pin
Eddy Vluggen25-Apr-10 23:14
professionalEddy Vluggen25-Apr-10 23:14 
GeneralRe: Abstract Class Pin
Calla26-Apr-10 1:07
Calla26-Apr-10 1:07 
GeneralRe: Abstract Class Pin
Eddy Vluggen26-Apr-10 1:20
professionalEddy Vluggen26-Apr-10 1:20 
GeneralRe: Abstract Class Pin
future383926-Apr-10 1:44
future383926-Apr-10 1:44 
QuestionHow to send & receive sms via gsm modem ? Pin
hdv21224-Apr-10 9:39
hdv21224-Apr-10 9:39 
AnswerRe: How to send & receive sms via gsm modem ? Pin
Md. Marufuzzaman24-Apr-10 20:35
professionalMd. Marufuzzaman24-Apr-10 20:35 
GeneralRe: How to send & receive sms via gsm modem ? Pin
hdv21225-Apr-10 10:34
hdv21225-Apr-10 10:34 
QuestionBest way for windows application with good performance , SQL & Oracle support? Pin
anand kumar m24-Apr-10 5:51
anand kumar m24-Apr-10 5:51 
AnswerRe: Best way for windows application with good performance , SQL & Oracle support? [modified] Pin
PIEBALDconsult24-Apr-10 6:42
mvePIEBALDconsult24-Apr-10 6:42 
Questionproblem with MSCHART spline graph! [modified] Pin
alibaba88s24-Apr-10 2:29
alibaba88s24-Apr-10 2:29 
AnswerRe: problem with MSCHART spline graph! Pin
Luc Pattyn24-Apr-10 2:57
sitebuilderLuc Pattyn24-Apr-10 2:57 

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.