|
Forums » .NET » .NET »
|
Vb.Net program stucked. i need a help to solve errors |
Posted Date: 08 Sep 2012 Posted By:: Angel Member Level: Bronze Member Rank: 3215 Points: 5
Responses:
2
|
This is the programming code where i'm stucked.
Imports System.Console Module m14 Public MustInherit Class One Public MustOverride Function area() As Double End Class Public Class Two Inherits One Dim l, b, h, r as Integer Dim pi as Double = 3.14 Dim area as Writeline(" * Enter the value of l :") l=Readline() Writeline(" * Enter the value of b :") b=Readline() Writeline(" * Enter the value of h :") h=Readline() Writeline(" * Enter the value of r :") r=Readline() Public Overrides function area() as Double return (l * b) End Function End Class Public Class Three Inherits One Dim l, b, h, r as Integer Dim pi as Double = 3.14 Dim area as Writeline(" * Enter the value of l :") l=Readline() Writeline(" * Enter the value of b :") b=Readline() Writeline(" * Enter the value of h :") h=Readline() Writeline(" * Enter the value of r :") r=Readline() Public Overrides function area() as Double return (b * h/2) End Function End Class Public Class Four Inherits One Dim l, b, h, r as Integer Dim pi as Double = 3.14 Dim area as Writeline(" * Enter the value of l :") l=Readline() Writeline(" * Enter the value of b :") b=Readline() Writeline(" * Enter the value of h :") h=Readline() Writeline(" * Enter the value of r :") r=Readline() Public Overrides function area() as Double return (pi * r * r) End Function End class Public Class Five Inherits One Dim l, b, h, r as Integer Dim pi as Double = 3.14 Dim area as Writeline(" * Enter the value of l :") l=Readline() Writeline(" * Enter the value of b :") b=Readline() Writeline(" * Enter the value of h :") h=Readline() Writeline(" * Enter the value of r :") r=Readline() Public Overrides function area() as Double return (2*(pi * r * r) + (2 * pi * r * h)) End Function End Class Public Class Six Inherits One Dim l, b, h, r as Integer Dim pi as Double = 3.14 Dim area as Writeline(" * Enter the value of l :") l=Readline() Writeline(" * Enter the value of b :") b=Readline() Writeline(" * Enter the value of h :") h=Readline() Writeline(" * Enter the value of r :") r=Readline() Public Shadows function area() as Double return (4 * pi * r * r) End Function End class Sub main() Dim tw as New Two() Dim thr as New Three() Dim fr as New Four() Dim fv as New Five() Dim sx as New Six() Writeline(" * Area of Rectrangle is : {0}",tw.area()) Writeline(" * Area of Triangle is : {0}",thr.area()) Writeline(" * Area of Circle is : {0}",fr.area()) Writeline(" * Area of Cylinder is : {0}",fv.area()) Writeline(" * Area of Sphere is : {0}",sx.area()) ReadKey() End Sub End Module
Someone please help me if you know.
|
Responses
|
#688011 Author: Gopi A Member Level: Silver Member Rank: 349 Date: 08/Sep/2012 Rating:  Points: 1 | Hi,
Could you share the error what you were received.
----------------------------------------------------------------------------- Regards, Gopi A. +91 9894315571 Skype:gopi.net
| #688025 Author: Angel Member Level: Bronze Member Rank: 3215 Date: 08/Sep/2012 Rating:  Points: 1 | For all variables l, b, h, r : Declaration expected : error BC30188 Ans for all methods : function area cannot be declared as 'overrides' because it does not override a function in base class : error BC30205
Please help me out.
|
|
| Post Reply |
|
|
|
You must Sign In to post a response.
|
|
|
|
 Follow us on Twitter: https://twitter.com/dotnetspider
|
|