Advertisement
rasyid03

soalno2

Jul 2nd, 2023
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.11 KB | Source Code | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7.  
  8. namespace WebApplication1
  9. {
  10.     public partial class WebForm2 : System.Web.UI.Page
  11.     {
  12.         protected void Page_Load(object sender, EventArgs e)
  13.         {
  14.             String nama, alamat;
  15.             int umur;
  16.  
  17.             nama = "Faris Rasyid";
  18.             umur = 20;
  19.             alamat = "Cinty, Cikarang";
  20.  
  21.             SetData(nama, umur, alamat);
  22.         }
  23.  
  24.         public String GetNama(String Nama)
  25.         {
  26.             return "Nama saya adalah " + Nama + ".<br/>";
  27.         }
  28.  
  29.         public String GetUmur(int Umur)
  30.         {
  31.             return "Umur saya " + Umur + ".<br/>";
  32.         }
  33.  
  34.         public String GetAlamat(String Alamat)
  35.         {
  36.             return "Alamat saya di " + Alamat + ".<br/>";
  37.         }
  38.  
  39.         public void SetData(String Nama, int Umur, String Alamat)
  40.         {
  41.             Response.Write(GetNama(Nama));
  42.             Response.Write(GetUmur(Umur));
  43.             Response.Write(GetAlamat(Alamat));
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement