首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代写CS170编程、代做Java程序设计
项目预算:
开发周期:
发布时间:
要求地区:
CS170 – Computer Applications for Business
Fall 2023 • Assignment 8
Functions, Loops & Arrays
Due Date: Before 11:59 p.m. on Friday, November 10th
, 2023
Accept Until: Before 11:59 p.m. on Friday, November 17th, 2023
Evaluation: 25 points
Submit to Canvas: Assignment8.html file
Related Materials: JavaScript Reference Guide
Need help? TA office hours and Lab Support Schedule posted in Canvas
YOU ARE ON YOUR HONOR TO COMPLETE THIS ASSIGNMENT WITHOUT ASSISTANCE. You may
use your text and resources available to you through Canvas. You MAY NOT ask any human for
assistance, give assistance to anyone, or use any online tutoring service.
Use only the coding syntax taught to you during classes and recitations. The use of other
coding syntax may result in your work being marked for further review due to possible
unauthorized assistance.
Learning Objectives:
In general, this assignment is designed to practice JavaScript concepts from Chapters 17 top 20 of the
textbook. In particular, the following items will be useful for this assignment:
1. Creating functions
2. Calling functions
3. Creating and initializing arrays
4. Creating and using loops
5. Using Number() function to ensure values are treated as numbers and not strings
6. Using concatenation to add currency or percent symbols
7. Using toFixed(2) method to round to 2 decimal places
8. Reading and understanding the use of comments
To earn credit for this assignment:
1 You will create JavaScript code – embedded on an HTML file - according to the requirements listed
on the next pages.
2 Upload and submit a single html file (.html extension) containing the code required.
For your assignment to be graded, please include the following statement as a comment in the
section of the program:
“ On my honor, I have neither received nor given any unauthorized assistance on this assignment.”
Page 1 of 6
PROBLEM DESCRIPTION
The Pet House provides pet boarding services. Pet owners can contract their services for a given number of
days while they are away on vacation or a business trip. As an option, the Pet House provides veterinarian
checkup. Their prices are as follows:
Pet Price per Day ($)
Dog 25
Cat 15
Hamster 10
Veterinarian Checkup (optional): $120 (fixed rate) regardless of the number of days contracted.
Sales Tax Rate: the Sales Tax for the program will be 7%.
You are required to implement the interface shown below which will use JavaScript to calculate the price for
each transaction. In addition, the program shall generate a report showing some statistical information.
A video of a sample run of this completed assignment is available on the assignment’s webpage on Canvas.
Note: See the illustration above and the sample video for examples of the inputs and
outputs required.
Page 2 of 6
Inputs needed:
Pet Type: one of the following three: dog, cat, hamster.
Number of Days: the number of boarding days contracted.
Veterinarian Checkup: optional service.
Output required (produced by the Process button):
Price: Number of Days x Price per Day (according to the table on this page) + Veterinarian Fee (if contracted).
Final Price: Price + applicable Sales Tax.
Note: Watch the Sample Video posted on Canvas (on the assignment 8 page)
After all the inputs are processed, the “Process Statistics” button will be clicked on to generate a
report.
The Report will be displayed on a separate webpage
Note: See the Sample Report on the following page
The Report will contain the following parts:
A Heading section with the following on separate lines:
The Pet House (as heading)
Statistics Report (as subheading)
The Date/Time of the Invoice
Below the Heading, the transactions listed with the following on each line:
Transaction: a sequential number starting with 1
Pet
Days
Vet Checkup
Transaction Price $
Final Price $
Below the transactions:
Total Transactions (before tax)
Average Transaction (before tax)
Total Days: total number of days contracted for all pets
Average Number of Days: average number of days contracted for all pets
Additional Note:
The document.write function should be used heavily to generate the report.
Requirements:
Arrays:
Use four additional parallel array to hold the information that will be displayed on the report: pet type, days
contracted, veterinarian checkup choice, price per transaction.
Page 3 of 6
Functions
Functions are required to:
Initialize the four parallel arrays that will hold the transaction data: one array to hold pet types, another
one to hold days contracted, the next one to hold the veterinarian checkup choice and the last one to
hold the price of the transaction.
◦ Since some arrays will contain strings and some other arrays will contain numbers, two functions will be
required to initialize arrays: one to set element of array to empty strings and another to set elements of
an array to 0. In addition, a third function that adds up the elements of an array will be needed.
Use loops to process the elements of the arrays.
SAMPLE TEST DATA and RESULTS
Inputs Pet Type Number of
Days
Veterinarian
Checkup
Dog 3 Yes
Cat 2 No
Hamster 5 Yes
Sample Report (based on inputs above):
Page 4 of 6
Additional Information:
• Be sure to include a comment with your name and section in the part of your HTML code
program.
• To enter the date on the report use the syntax: var d = new Date(); which captures current Date/Time
on the d variable.
• Since the content of a text box which requires a number may be used in mathematical operations, use
the function Number() to ensure that the numeric input is treated as numeric data. Syntax example:
x = prompt(“Enter some number”);
x = Number(x);
Syntax example to round up a number to 2 decimals. Just add .toFixed(2) to the variable name
containing the number. Syntax example:
someNumber.toFixed(2)
To simplify the comparison of text data entered by the user, it is often easier to convert this
text to upper case using the notation below. Syntax example:
textVariable = textVariable.toUpperCase();
• Examples related to radio buttons (these are examples only, the name, id and onclick
content should be related to your code):
• Using radio buttons:
•
•
• In the example above, the two associated radio buttons, load the appropriate value to the variable
sizeData based on the user’s selection.
• Clearing radio buttons:
• The radio buttons in the previous example may be cleared by using the following syntax in a
program:
• large.checked = false;
• small.checked = false;
• Notice that the IDs of the radio buttons are used when clearing a radio button.
Point Values
Student name inserted as comment in the head section 1
Variable declarations and initializations 2
Inputs 3
Outputs 2
Arrays 4
Loops 3
Functions 3
IF statements 2
Program execution 5
Page 5 of 6
References:
Recitation sessions
Lectures
Fluency textbook Chapters 17 to 20
JavaScript Reference Guide
Page 6 of 6
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
data程序代写、代做c/c++编程语...
2024-05-17
data程序代写、代做python编程...
2024-05-17
program代做、c/c++,python程...
2024-05-17
代写math 3333 3.0 - winter 2...
2024-05-17
代做seng6110 programming ass...
2024-05-17
代写seng6110 object oriented...
2024-05-17
代写comp828: statistical pro...
2024-05-17
代做culture and society调试数...
2024-05-17
代做comp 4911 winter 2024 as...
2024-05-17
代做lh physical iiib / 03 33...
2024-05-17
代做3032ict big data analyti...
2024-05-17
代写comp4702 report代写留学生...
2024-05-17
代写fin2020 hw6代写c/c++编程
2024-05-17
热点标签
fit2004
fit3152
mec208
econ20120
cpt304
econ2101
econ0051
engi4547
econ1048
eengm2510
fit1008
7033mkt
ec2066
cct380h5f
man00019m
mech265001
fin2020
fit9137
n1542
csc4140
math6119
comp1710
fina864
csys5020
busi4412
math5007
2702ict
dts204tc
comp2003j
cosc2673
ecmt2150
bff3121–
comu7000
stat6118
comp814
acc202
ematm0067
bit233
ecs776p
600543
bpln0025
comp3400
econ7030
159.342 ‐ operating
mang6134
math1005/math6005
geog5404m
comp1710/6780
infs 2042
inf6028
bman30702
math0002
msci242l
mgt11001
com00177m
bman71282
fit2001
cpt210
159.341
econ7310
comp3221
comp10002
cpt206
ecmt1010
finm081
econ2005
cpt202
fit3094
socs0030
data7201
data2x01
mn-3507
mat246h1
ib2d90
ib3j80
acc207
comp90007
compx518-24a
fit1050
info1111
acct2201
buad801
compsci369
cse 332s
info1110
math1033
scie1000
eeee2057
math4063
cmt219
econ5074
eng5009
csse2310/csse7231
ec333
econ0001
cpt204
elec4630
ma117
dts104tc
comp2017
640481
csit128
eco000109m
finc5090
ggr202h5f
nbs8295
4ssmn902
chc6171
dsa1002
ebu6304
comp1021
csci-ua.202
com6511
ma416
mec206
iom209
bism7202
idepg001
cpt106
comp1212
ecom209
math1062
mn-3526
fnce3000
fmhu5002
psyc10003
fina2222
be631-6-sp/1
finc2011
37989
5aaob204
citx1401
econ0028
bsan3204
comp9123
cmt218
itp122
qbus6820
ecmt1020
bus0117
soft3202/comp9202
basc0057
mecm30013
aem4060
acb1120
comp2123
econ2151
ecmt6006
inmr77
com 5140
ocmp5328
comp1039
had7002h
cmt309
asb-3715
elec373
cpt204-2324
be631-6-sp
econ3016
mast10007
buss6002
comp4403
comp30023
finm1416
csc-30002
6qqmn971
fin668
mnfg309
inft2031
cits1402
comp2011
eecs 3221
ebu4201
ct60a9600
com336
8pro102
econ7300
comp3425
comp8410
comp222
finm8007
comp2006
comp26020
comp1721
eeen3007j
cis432
csci251
comp5125m
com398sust
finm7405
econ7021
fin600
infs4205/7205
mktg2510-
32022
mth6158
comp328
finn41615
2024
mec302
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!