VB.net udauwak

Protector78

Well-known member
  • Mar 10, 2012
    1,612
    299
    83
    loku case akak nam newe. ath man me side ake newe. ape malli kenekta.

    mekai parshne


    An electricity board charges the following rates to domestic users to discourage large consumption of energy:


    criteria l charge
    first 100 units l 30 per unit
    next 200 units l 35 per unit
    beyond 300 units l 50 per unit

    all users are charged a maximum or equal of Rs.600. if an additional charge Rs.250.00 for your bill. write Vb.Net coding to, units consumed, calculate and display the customer monthly bill amount.

    meke source code aka puluwan kenek denna puluwanda. loku udawwak machanla.
     

    Jecob Boman

    Well-known member
  • Dec 10, 2013
    1,333
    93
    48
    homagama
    sorry bro , vb nam danna. meka php ekak mama dan liwwa. oya meke structure eka vb walata daaganna :P

    PHP:
    <?php
    $used_units = 3;
    if($used_units <= 100){
     $unit = 30;
    } elseif ($used_units > 100 && $used_units <= 300){
     $unit = 35;	
    } elseif ($used_units > 300){
     $unit = 50;	
    }
    
    $monthly_bill = $used_units * $unit;
    if($monthly_bill >= 600){
     $full_monthly_bill = $monthly_bill + 250;
    } else {
      $full_monthly_bill = $monthly_bill;
    }
    echo 'Your monthly bill is: '.$full_monthly_bill;
    ?>
     

    sachith19920726

    Well-known member
  • Jan 20, 2011
    35,670
    11,504
    113
    33
    Crynet Solutions
    bit.ly
    Code:
             [COLOR=Navy]Dim criterian As Integer[/COLOR]
    [COLOR=Navy]         Dim charge As Integer[/COLOR]
    
    [COLOR=DarkGreen]        criterian = 56[/COLOR]
    
    [COLOR=DarkGreen]         Select Case criterian[/COLOR]
    [COLOR=DarkGreen]             Case Is > 300[/COLOR]
    [COLOR=DarkGreen]                 charge = 50 * criterian[/COLOR]
    [COLOR=DarkGreen]             Case Is > 100 And criterian <= 300[/COLOR]
    [COLOR=DarkGreen]                 charge = 35 * criterian[/COLOR]
    [COLOR=DarkGreen]             Case Is < 100[/COLOR]
    [COLOR=DarkGreen]                 charge = 30 * criterian[/COLOR]
    [COLOR=DarkGreen]         End Select[/COLOR]
    
    [COLOR=DarkGreen]         If charge >= 600 Then[/COLOR]
    [COLOR=DarkGreen]             charge = charge + 250[/COLOR]
    [COLOR=DarkGreen]         End [/COLOR]If
    
            [COLOR=Navy]MsgBox("Full Charge of the month : " & charge & " Rs", MsgBoxStyle.OkOnly + MsgBoxStyle.Information)[/COLOR]
    9Y7qmQ3.png

     
    Last edited: