我需要一个完整的程序..任何专家都可以做到这一点,这是一个挑战..需要一个小时 [英] i need a full program of this....any experts out ther can do this its a challenge guys..need this in an hour

查看:69
本文介绍了我需要一个完整的程序..任何专家都可以做到这一点,这是一个挑战..需要一个小时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据以下描述,编写完整的JavaScript代码.
单击发送订单"按钮后,它将调用函数get_input().

在函数get_input()
•从表单中获取客户名称和地址.
•确定客户选择的蛋糕.调用函数get_cakeprice(…)并传递cake以获取蛋糕的价格.
•确定客户是否希望将蛋糕送回家.调用函数get_deliveryprice(…)以获取交货价格.
•确定蜡烛的价格.
•确定消息和消息价格.
•计算总账单.
•调用函数print_bill(...)并发送要打印的必要变量.

在函数get_cakeprice(...)
•从函数get_input()获取蛋糕名称.
•使用开关案例语句来确定蛋糕价格并返回蛋糕价格.

在函数get_deliveryprice(…)
•使用if..else语句确定交货成本.
•退回交货成本.

在函数print_bill(...)
•从函数get_input()获取所有必要的变量,并显示如下所示

使用此表单代码:

< body>

< FIELDSET>< LEGEND>客户订单明细</LEGEND>

< form name ="orderfrm">

< p>名称:<输入type ="text" name ="custname" size ="100"></p>
< p>地址:< textarea name ="custaddress" rows ="2" cols ="50"></textarea></p>

< p>蛋糕:
< br><输入type ="radio" name ="cake" value =胡萝卜奶酪蛋糕"/>胡萝卜奶酪蛋糕($ 67.00)
< br><输入type ="radio" name ="cake" value =黑森林奶酪"/>黑森林奶酪($ 80.00)
< br><输入type ="radio" name ="cake" value =榛子奶酪"/>榛子奶酪($ 60.00)
</p>

< p>送货($ 10.00):
<选择name ="delivery">
< option value =是">是</option>
< option value =否">否</option>
</select>
</p>

< p>蜡烛($ 3.00):<输入type ="checkbox" name ="candles" value ="3"/>蜡烛</p>

< p>消息($ 5.00):<输入type ="text" name ="cakemsg" size ="100"></p>

< p><输入类型=按钮" name ="sendbtn" value =发送订单" onclick ="get_input()"></p>

< br>

</form>

</FIELDSET>

</body>

Based on the following description, write the complete JavaScript codes.
Once the button "Send Order" is clicked, it will call function get_input().

In function get_input()
• Get the customer name and address from the form.
• Identify which cake the customer selected. Call function get_cakeprice(…) and pass cake to get the price of the cake.
• Identify whether the customer wants the cake to be delivered to the home or not. Call function get_deliveryprice(…) to get the delivery price.
• Identify price of candles.
• Identify message and message price.
• Calculate total bill.
• Call function print_bill(…) and send necessary variables to be printed.

In function get_cakeprice(…)
• Get the cake name from function get_input().
• Use switch case statement to identify the cake price and return the cake price.

In function get_deliveryprice(…)
• Using if..else statement, identify the delivery cost.
• Return the delivery cost.

In function print_bill(…)
• Get all the necessary variables from function get_input() and display as shown

use this form codes:

<body>

<FIELDSET><LEGEND>Customer Order Details</LEGEND>

<form name="orderfrm">

<p>Name : <input type="text" name="custname" size="100"></p>
<p>Address : <textarea name="custaddress" rows="2" cols="50"></textarea></p>

<p>Cake :
<br><input type="radio" name="cake" value="Carrot Cheese Cake" />Carrot Cheese Cake ($ 67.00)
<br><input type="radio" name="cake" value="Black Forest Cheese" />Black Forest Cheese ($ 80.00)
<br><input type="radio" name="cake" value="Hazel Cheese" />Hazel Cheese ($ 60.00)
</p>

<p>Delivery ($ 10.00) :
<select name="delivery">
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
</p>

<p>Candles ($ 3.00) : <input type="checkbox" name="candles" value="3" />Candles</p>

<p>Message ($ 5.00) : <input type="text" name="cakemsg" size="100"></p>

<p><input type="button" name="sendbtn" value="Send Order" onclick="get_input()"></p>

<br>

</form>

</FIELDSET>

</body>

推荐答案

67.00)
< br><输入类型="radio" name ="cake" value =黑森林奶酪"/>黑森林奶酪(
67.00)
<br><input type="radio" name="cake" value="Black Forest Cheese" />Black Forest Cheese (


80.00)
< br><输入类型="radio" name ="cake" value =榛子奶酪"/>榛子奶酪(
80.00)
<br><input type="radio" name="cake" value="Hazel Cheese" />Hazel Cheese (


60.00)
</p>

< p>交付(
60.00)
</p>

<p>Delivery (


这篇关于我需要一个完整的程序..任何专家都可以做到这一点,这是一个挑战..需要一个小时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆