0% found this document useful (0 votes)
46 views

PROGRAMACION

This document defines two classes - cliente and ClienteMoroso. The cliente class declares a string attribute "nombre" and contains a method to display the name. The ClienteMoroso class inherits from cliente, adds a decimal attribute "deuda" to store debt amount, and contains a method to display both the name and debt amount. On a button click, it instantiates both classes, sets their attribute values, and calls their display methods.

Uploaded by

kmantilla
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

PROGRAMACION

This document defines two classes - cliente and ClienteMoroso. The cliente class declares a string attribute "nombre" and contains a method to display the name. The ClienteMoroso class inherits from cliente, adds a decimal attribute "deuda" to store debt amount, and contains a method to display both the name and debt amount. On a button click, it instantiates both classes, sets their attribute values, and calls their display methods.

Uploaded by

kmantilla
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Public Class cliente REM declarar atributos Public nombre As String REM metodo Sub mostrar() MessageBox.

Show(nombre, "clase cliente", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) End Sub End Class Class ClienteMoroso Inherits cliente Public deuda As Decimal Sub mostrardeuda() MessageBox.Show(deuda, "clase cliente", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) MessageBox.Show(nombre, "clase cliente", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) End Sub End Class Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim cli As New cliente() Dim clim As New ClienteMoroso() cli.nombre = "yamil" clim.nombre = InputBox("digite nombre cliente moroso") clim.deuda = 20000 cli.mostrar() clim.mostrar() clim.mostrardeuda() End Sub End Class

You might also like