+ Link For Assignments, GDBs & Online Quizzes Solution |
+ Link For Past Papers, Solved MCQs, Short Notes & More |
Instructions:
Please read the following instructions carefully before submitting assignment. It should be clear that your assignment will not get any credit if:
Note: You have to upload only .php file. Assignment in any other format (extension) will not be accepted and will be awarded with zero marks.
Objective:
The objective of this assignment is to provide hands on experience of:
For any query about the assignment, contact at cs310@vu.edu.pk
|
|
Assignment |
|
A person is on a Bank’s ATM machine to withdraw an amount. The amount should be within a range of 0 to 49900 and the multiple of 100. In case user enters an amount, which is not the multiple of 100 or out of range then an error message “Entered amount should be within a range and the multiple of 100” is displayed and no further processing is done otherwise a message “Valid Input” is displayed. After the verification of input value. Application counts how many five thousand, one thousand, five hundred and one hundred notes are to be given to the user in response of entered value. Remember notes count should be displayed in words not in digit as shown in the sample output.
Your task is to write a program to implement the above scenario and provide the output as shown in sample output. Assign input value to the variable instead of taking input from the user.
Example: Always assign the input value to the variable, so suppose a value 27900/- is assigned. I should receive 5 notes of five thousand, two notes of one thousand, one note of five hundred and four notes of one hundred.
Hint: Read a description of a PHP function intval. You may need to use this function.
Sample Output:
|
Tags:
+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)
+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)
+ Click Here to Search (Looking For something at vustudents.ning.com?) + Click Here To Join (Our facebook study Group)Please Discuss here about this assignment.Thanks
Our main purpose here discussion not just Solution
We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions. Read More>>
Note:-
For Important Helping Material related to this subject (Solved MCQs, Short Notes, Solved past Papers, E-Books, FAQ,Short Questions Answers & more). You must view all the featured Discussion in this subject group.
For how you can view all the Featured discussions click on the Back to Subject Name Discussions link below the title of this Discussion & then under featured Discussion corner click on the view all link.
Or visit this link
&
.•°How to Download past papers from study groups°•.
Please Click on the below link to see…
any idea how to restrict user to input multiple of 100 and how to check if the input given by user is multiple of 100.????
idea solution
<?php
$amount=37000;
if($amount> 0 && $amount < 49900 && $amount % 100 ==0 )
{
echo "Enter value[0-49900]: $amount<br>";
echo "Valid Input<br>";
if($amount < 499)
{
$n = $amount / 100;
$a = $amount % 100;
echo '<br>Five Thousand : --- <br>';
echo 'One Thousand : ---<br>';
echo 'Five Hundred : ---<br>';
echo 'Hundred : '.intval($n);
}else if($amount < 999)
{
$n = $amount / 500;
$a = $amount % 500;
echo '<br>Five Thousand : ---<br>';
echo 'One Thousand : ---<br>';
echo 'Five hundred :'.intval($n).'<br>';
if($a != 0)
{
$b = $a/100;
echo 'Hundred :'.intval($b).'<br>';
}
}else if($amount < 4999)
{
$n = $amount / 1000;
$a = $amount % 1000;
echo '<br>Five Thousand : ---<br>';
echo 'Thousand :'.intval($n).'<br>';
if($a != 0)
{
$b = $a/500;
$c = $a % 500;
echo 'Five Hundred :'.intval($b).'<br>';
if($c != 0)
{
$d = $c/100;
echo 'Hundred :'.intval($d).'<br>';
}
}
}else if($amount <= 49900)
{
$n = $amount / 5000;
$a = $amount % 5000;
echo '<br>Five Thousand :'.intval($n).'<br>';
if($a != 0)
{
$b = $a/1000;
$c = $a % 1000;
echo 'Thousand :'.intval($b).'<br>';
if($c != 0)
{
$d = $c/500;
$e = $c % 500;
echo 'Five Hundred :'.intval($d).'<br>';
if($e != 0 )
{
$f = $e/100;
echo 'Hundred :'.intval(f).'<br>';
}
}
}
}
}
else
{
echo " Entered amount should be within the range and the multiple of 100";
}
?>
ye code to thek hai but output may total rupees hain wo string value may anay chaiye code to mai b ye kb ka bna chuka but string value ki smjh ni a ri
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We have been working very hard since 2009 to facilitate in learning Read More. We can't keep up without your support. Donate.
We are user-generated contents site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com Page with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post