Skip to content

Latest commit

 

History

History

PHP_Basics_Lab_10

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

PHP – Basics and Arrays (Lab 10)

  1. Nadir bought some items in LuLu Supermarket in Dubai and he would like to do some analysis in each and every product price in his bill. His bill consists of integer and floating point amount. Write a JavaScript code to input the price of each product. Write a PHP Code to calculate the number of integer amount input and its total, the number of floating point amount input and its total.

  2. BSNL company charges its customers for 3G data usage as follows: Data Usage in MBs Rate of

Charges :

  • 0 - 240 Rs. 35
  • 241 - 1000 Rs. 140 plus Rs. 0.30 per MB Excess of 300
  • 1001 – 2000 Rs. 240 plus Rs. 0.50 per MB Excess of 1600
  • 2001 and above Rs. 790 plus Rs. 0.30 per MB Excess of 2900

Develop a PHP program to read the customer number and 3G data usage. Print the amount to be paid by the customer.

  1. In 1999, India proposed a positional method for determining the outcome of an election with Kvoters and N candidates. Each voter ranks the candidates in increasing order of preference from 1 to N. All the voters should enter the choice of preferences for all the candidates. This method assigns a score to each candidate which equals the sum of their individual rankings recorded by every voter. The candidate with the highest sum wins.

Write PHP code for this scenario.