38
1
using System;
2
namespace Application {
3
// Base class Cost
4
public class Shape {
5
6
public void setSide(int s) {
7
side = s;
8
}
9
protected int side;
10
}
11
//interface
12
public interface Cost {
13
int getCost(int area);
14
}
15
// Derived class, using Interface and Base class
16
class square: Shape, Cost {
17
//methods in derived class
18
public int getArea() {
19
return (side * side);
20
}
21
public int getCost(int area) {
22
return area * 10;
23
}
24
}
25
public class SquareInheritance {
26
public static void Main(string[] args) {
27
square sq = new square();
28
int area;
29
sq.setSide(5);
30
area = sq.getArea();
31
32
// Print the area of the object.
33
Console.WriteLine("The area is: {0}", sq.getArea());
34
Console.WriteLine("The cost is: {0}", sq.getCost(area));
35
36
}
37
}
38
}
Cached Result
Compilation error (line 6, col 7): The type or namespace name 'FluentValidation' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 7, col 7): The type or namespace name 'FluentValidation' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 8, col 7): The type or namespace name 'FluentValidation' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 66, col 37): The type or namespace name 'AbstractValidator<>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 79, col 29): The type or namespace name 'AbstractValidator<>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 94, col 13): The type or namespace name 'PropertyValidatorContext' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 113, col 93): The type or namespace name 'PropertyValidatorContext' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 143, col 89): The type or namespace name 'IRuleBuilderInitial<,>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 144, col 13): The type or namespace name 'AbstractValidator<>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 143, col 23): The type or namespace name 'IRuleBuilderOptions<,>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 150, col 18): The type or namespace name 'IRuleBuilderOptions<,>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 151, col 13): The type or namespace name 'AbstractValidator<>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 149, col 23): The type or namespace name 'IRuleBuilderOptions<,>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 157, col 13): The type or namespace name 'AbstractValidator<>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 159, col 13): The type or namespace name 'IRuleBuilder<,>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 156, col 24): The type or namespace name 'IRuleBuilderOptions<,>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 246, col 60): The type or namespace name 'Severity' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 196, col 26): The type or namespace name 'IPropertyValidator' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 200, col 33): The type or namespace name 'IPropertyValidator' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 70, col 6): The name 'RuleSet' does not exist in the current context
Compilation error (line 83, col 13): The name 'RuleFor' does not exist in the current context
Compilation error (line 84, col 26): The name 'CascadeMode' does not exist in the current context
Compilation error (line 100, col 76): The type or namespace name 'StaticStringSource' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 118, col 76): The type or namespace name 'StaticStringSource' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 162, col 38): The type or namespace name 'ChildValidatorAdaptor' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 208, col 57): The type or namespace name 'StaticStringSource' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 215, col 57): The type or namespace name 'LazyStringSource' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 222, col 57): The type or namespace name 'LazyStringSource' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 229, col 54): The type or namespace name 'StaticStringSource' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 7, col 7): The type or namespace name 'FluentValidation' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 8, col 7): The type or namespace name 'FluentValidation' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 66, col 37): The type or namespace name 'AbstractValidator<>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 79, col 29): The type or namespace name 'AbstractValidator<>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 94, col 13): The type or namespace name 'PropertyValidatorContext' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 113, col 93): The type or namespace name 'PropertyValidatorContext' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 143, col 89): The type or namespace name 'IRuleBuilderInitial<,>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 144, col 13): The type or namespace name 'AbstractValidator<>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 143, col 23): The type or namespace name 'IRuleBuilderOptions<,>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 150, col 18): The type or namespace name 'IRuleBuilderOptions<,>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 151, col 13): The type or namespace name 'AbstractValidator<>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 149, col 23): The type or namespace name 'IRuleBuilderOptions<,>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 157, col 13): The type or namespace name 'AbstractValidator<>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 159, col 13): The type or namespace name 'IRuleBuilder<,>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 156, col 24): The type or namespace name 'IRuleBuilderOptions<,>' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 246, col 60): The type or namespace name 'Severity' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 196, col 26): The type or namespace name 'IPropertyValidator' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 200, col 33): The type or namespace name 'IPropertyValidator' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 70, col 6): The name 'RuleSet' does not exist in the current context
Compilation error (line 83, col 13): The name 'RuleFor' does not exist in the current context
Compilation error (line 84, col 26): The name 'CascadeMode' does not exist in the current context
Compilation error (line 100, col 76): The type or namespace name 'StaticStringSource' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 118, col 76): The type or namespace name 'StaticStringSource' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 162, col 38): The type or namespace name 'ChildValidatorAdaptor' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 208, col 57): The type or namespace name 'StaticStringSource' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 215, col 57): The type or namespace name 'LazyStringSource' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 222, col 57): The type or namespace name 'LazyStringSource' could not be found (are you missing a using directive or an assembly reference?)
Compilation error (line 229, col 54): The type or namespace name 'StaticStringSource' could not be found (are you missing a using directive or an assembly reference?)