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

C#

 
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 
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 
As far as I can ascertain, Name and ScientificName need to return a hardcoded string in implementing classes.
In your abstract Fish class, Acceptable should be a bool. To implement it you need to test the values you've been given for this species against the weight.
C#
namespace Assignment1
{
    public abstract class Fish
    {
        protected int weight;

        public abstract bool Acceptable { get; }
        public abstract string Name { get; }
        public abstract string ScientificName { get; }
        public int Weight
        {
            get { return weight; }
        }

        public override string ToString()
        {
            return Name;
        }
    }
}

C#
using System;

namespace Assignment1
{
    public class AustralianBass : Fish
    {
        public const int MAX_WEGHT = 4000;

        public AustralianBass()
        {
            Random random = new Random();
            weight = random.Next(0, MAX_WEGHT);
        }

        public override bool Acceptable
        {
            get { return weight >= 500 && weight < 2500; }
        }
        public override string Name
        {
            get { return "Australian Bass"; }
        }
        public override string ScientificName
        {
            get { return "Macquaria novemaculeata"; }
        }
    }
}

Do similar for the other classes and you will be good to go for the next parts.
Dave

If this helped, please vote & accept answer!


Binging is like googling, it just feels dirtier. (Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

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 
GeneralRe: problem with MSCHART spline graph! [modified] Pin
alibaba88s24-Apr-10 3:00
alibaba88s24-Apr-10 3:00 
GeneralRe: problem with MSCHART spline graph! Pin
Luc Pattyn24-Apr-10 3:08
sitebuilderLuc Pattyn24-Apr-10 3:08 
GeneralRe: problem with MSCHART spline graph! Pin
alibaba88s24-Apr-10 3:37
alibaba88s24-Apr-10 3:37 

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.