We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

# www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

# CS508- Modern Programming Languages Assignment No. 04 SEMESTER Fall 2015 Total Marks: 20 Due Date: 15/02/2016

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 2943

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Attachments:

### Replies to This Discussion

Assignment me Question 2 ka b zikar kia gya hai.... agr kisi ko yad na ho to....

Q2 nhi solve ho raha....

For Q2: idea only

calculating Sales tax

`<? \$price = 4.9; \$tax = .04;  function calculate_cost(\$tax, \$price) {      \$sales_tax = \$tax;      `

return

` \$price + (\$price * \$sales_tax); }  \$total_cost = calculate_cost (\$tax, \$price); \$total_cost = round(\$total_cost, 2);  print `

"Total cost: "

`.\$total_cost; ?>`

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.

CS508 ASS4 solution 2016

<?php
function fahrenheit_to_celsius(\$given_value)
{
\$celsius=5/9*(\$given_value-32);
return \$celsius ;
}

function celsius_to_fahrenheit(\$given_value)
{
\$fahrenheit=\$given_value*9/5+32;
return \$fahrenheit ;
}

?>

<html>
<title>Temp. Conv.</title>
<body>
<form action="" method="post">
<table>

<tr>
<td>
<select name="first_temp_type_name">
<option value="fahrenheit">Fahrenheit</option>
<option value="celsius">Celsius</option>
</select>
</td>
</tr>
<tr>
<td>
<input type="text" name="given_value">
</td>
</tr>
<tr>
<td>
<select name="second_temp_type_name">
<option value="fahrenheit">Fahrenheit</option>
<option value="celsius">Celsius</option>
</select>
</td>
</tr>
<tr>
<td>
<input type="submit" name="btn" value="Convert">
</td>
</tr>
<tr>
<td>
<?php
if(isset(\$_POST['btn']))
{
\$first_temp_type_name=\$_POST['first_temp_type_name'];
\$second_temp_type_name=\$_POST['second_temp_type_name'];
\$given_value=\$_POST['given_value'];
if(\$first_temp_type_name=='fahrenheit')
{
\$celsious=fahrenheit_to_celsius(\$given_value);
echo "Fahrenheit \$given_value = \$celsiousCelsious";
}
if(\$first_temp_type_name=='celsius')
{
\$fahrenheit=celsius_to_fahrenheit(\$given_value);
echo "Celsious \$given_value = \$fahrenheit Fahrenheit";
}

}

?>
</td>
</tr>
</table>
</form>
</body>
</html>

<?php

function getRetail(\$cp, \$profit, \$tax) {

//Getting amount of tax from percentage
// \$cp means cost price
\$taxRupees = (\$cp / 100) * \$tax;

\$retailPrice = \$cp + \$taxRupees + \$profit;

return \$retailPrice;
}

echo getRetail(500, 50, 10);

?>

q1 ka solution thk ha?

q2 ka solution upload krdo koi....

I cant understand the Q2     Kon sa formula lage ga?
hm na function k zarye Retail price and sale tax calculate and display krna ha, tw sale tax argument ma kase bhajn ge???
Profit ka kya krna ha..
help plzzzzzzzzzzzzzzzzzzz
Just tell me k argument ktne pass krne hn.. kon kon se, and formula konsa use krn ge..
plzzzzzzzzzzzzzzzzzz

CS508 Current Assignment #4 Complete Solution

Attachments:

thanks..

.