Print customer data of AB Bank Limited and perform basic String operations on them. PHP

Vu Old Solved Programming Based Assignments Codes are Available in this Section.
Post Reply
User avatar
Posts: 177
Joined: Fri Dec 22, 2017 8:10 am
Location: Lahore
Has thanked: 6 times
Been thanked: 7 times
Status: Offline

Print customer data of AB Bank Limited and perform basic String operations on them. PHP

Post by ALI RAZA » Thu Dec 13, 2018 7:24 am

AB Bank Limited wants to computerize their customer database so that it can be retrieved and manipulated efficiently. They hire you to perform this task and you decide to make a web interface for this task using PHP.
1) As the first step, you have to declare variables that will hold customer’s attributes as given below:
Attribute Data type
Complete Name String
Father’s Name String
CNIC String
Customer ID (assigned by the bank) String
Home Address String
Bank Account Type String
Current Balance Float

[Note: For the time being, you can hard-code values of these attributes. In subsequent assignments, you have to take input from user. But for this assignment, there’s no need to take input]
2) After declaring and initializing variables, show them on the screen using print or echo statement
3) Calculate and print length of CNIC using strlen() function. Its length should be 13. If it is not, then print an error message
4) Calculate total word count in Complete Name of customer using str_word_cout() function and print it on screen
5) After successfully running your program, take the screenshot of the output and paste it in your solution file
6) Your solution file will be a single Word file (.doc or .docx) containing two things:
• Complete code written in Word
• Output screenshot
7) You can use Consolas font in Word file to enhance readability of the code

Code: Select all

	$customerName = "Umair Mujahid";
	$fatherName = "Mujahid Hussain";
	$cnic = "3310081955444";
      $customerID = "4891";
	$address = "Lawrance Road Lahore";
      $accountType = "Profit and Loss";
	$balance = 5400.5;

	print "Customer Name is " . $customerName;
	print "<br>";

	print "Customer father name is " . $fatherName;
	print "<br>";

	print "CNIC is " . $cnic;
	print "<br>";

      print "Customer Bank ID is " . $customerID;
	print "<br>";

	print "Customer address is " . $address;
	print "<br>";

	print "Customer account type is " . $accountType;
	print "<br>";

	print "Current balance is " . $balance;
	print "<br>";

	print "<br>";

	$CNIClength = strlen($cnic);
	print "Length of CNIC is " . $CNIClength . "<br>";

      if($CNIClength != 13)
         print "CNIC is incorrect!" . "<br>";

	print "Total words in customer name are: " . str_word_count($customerName);
	print "<br>";	


Post Reply

Last 10 Members Who Visited This Topic

User avatar ALI RAZA (2)

  • Similar Topics
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest