代写CS170 – Computer Applications for Business Spring 2024 • Assignment 7代做Java编程

CS170 – Computer Applications for Business

Spring 2024 • Assignment 7

Event Driven Programming

Due Date:

Before 11:59 p.m. on Friday, March 22nd, 2024

Accept Until:

Before 11:59 p.m. on Friday, March 29th, 2024

Evaluation:

25 points

Submit to Canvas:

Assignment7.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 person for assistance, give assistance to anyone, or use any online tutoring service.

Use only the coding syntax included in the JavaScript. Reference Guide, the section

“Additional Information” of this document and the syntax for input elements (text boxes,

radio buttons, buttons) in chapter 18 of the textbook.. The use of other coding syntax will

result in your work being marked for further review due to possible unauthorized assistance.

Learning Objectives:

This assignment is designed to practice:

1. Creating an Event Driven JavaScript. program.

2. Using Input Elements such as text boxes, buttons, and radio buttons in an event driven program

3. Implement JavaScript. code which will respond to user events.

4. Use of variables: declaration, initialization, modification

5. Use of comments.

To earn credit for this assignment:

1.  You will create a JavaScript. program – 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: “ On my honor, I have neither received nor given any unauthorized assistance on this assignment.”

PROBLEM DESCRIPTION

A GUI (Graphical User Interface) is required to process pets spa services and produce accurate results. Radio buttons and text boxes will be used for input and output purposes. A button will be used for processing data. Another button will be employed to clear the text boxes and radio buttons.

Create a webpage to implement the interface required using the JavaScript. programming language. The illustration below displays the format of the GUI screen required. An HTML template is provided on Canvas to be used as a starting point to create the screen required.

Note: Choose a background color and a text color of your preference. 


The rules about the logic required are the same as those for the initial version and are listed below:

The Shady Brook Tennis club recently experienced a boom in interest following one of their players qualifying for Wimbledon. To take advantage of the increase foot traffic, the tennis club is

expanding their offerings, both in their tennis shop and their lessons, for new players.

.    The equipment starter package:

◦  Custom racket fitting $150

◦  Custom shoe fitting $100

.    The lessons starter package:

◦  Lessons can be purchased in bundles of 5 sessions for $200

◦  Purchases of 5 (or more) bundles will receive a 10% discount

.    At the end of the purchase, two levels of club memberships will be offered, Green or Plat- inum. Customers can choose either one (or none) of the two.

◦  Green level membership cost $50 and provides an additional 10% discount on equip- ment

◦  Platinum level membership costs $200 and provides a 20% discount on all purchases(in- cluding the membership cost)

.        Inputs:

.    EquipmentRacket: Yes or No

.    EquipmentShoes: Yes or No

.    NumLessonBundles: Integer

.    ClubMembership: Yes or No

.    MembershipType: Green or Platinum

.

.         Outputs:

.    Total price (pre-tax).

.    Member Discount.

.    Sales Tax amount to be added to the bill (7% rounded to two decimals)

.    Final Cost of the bill (including the tax).


Processing:

.   Process button:

◦  Notice that the Process button does not need to “read” the radio buttons since the radio buttons take care of loading the appropriate value to the variables

included in their onclick properties.

◦  It will process the inputs gathered by the radio buttons to perform the appropriate calculations and generate the required results.

▪  The code for the Process button should not include the prompt or alert

functions

◦  It will place the required results on the appropriate output boxes.

▪  Example of the syntax for writing to a text box: .    myTextBoxID.value = myVariable;

◦  It writes the content of the variable myVariable to the text box whose ID is  myTextBoxID.

.   Clear button:

◦  It will reset all variables

▪  The numeric variables should be set 0

▪  The string (text) variables should be set to the empty string.

◦  All the text boxes should be loaded (written to) with the empty string to clear them of any content.

◦  It will also clear all the radio buttons (see examples of clearing radio buttons in the Additional Information section).


SAMPLE TRACES THROUGH THE CORRECT ALGORITHM

 

Sample 1

Sample 2

Sample 3

Inputs:

 

 

 

Custom Racket:

No

Yes

Yes

Custom Shoes:

Yes

No

Yes

Starter Lesson Bundles:

0

3

5

Membership Club:

No

Yes

Yes

Membership Type:

 

Green

Platinum

Outputs:

 

 

 

Total Price

$100.00

$800.00

$1350.0 0

Member Discount

$0.00

$15.00

$270.00

Sales Tax

$7.00

$54.95

$75.60

Final Cost

$107.00

$839.95

$1155.6 0

 

 

 

 

Additional Information:

.    Be sure to include a comment with your name and section in the <head> part of your HTML code program.

.   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();

(See https://www.w3schools.com/jsref/jsref_toUpperCase.asp for additional example.)

.    Syntax example to round a number to 2 decimals. Just add .toFixed(2) to the variable name containing the number.

someNumber.toFixed(2)

.    Syntax example to use process a number that was originally captured via a text box: 

.        numberWins = Number(numberWins);

.    Syntax example to read input from a text box:

.        x = someBoxId.value;

Where x is a variable and someBoxId the Id of a text box used for input 

.   Syntax example to write output to a text box:

.        someOtherBoxId.value = y;

Where y is a variable and someOtherBoxId the Id of a text box used to display output


.    Examples related to radio buttons (these are examples only, the name, id and onclick content should be related to your code):

.    Using radio buttons:

<input type="radio" name="size” id="large" nclick='sizeData="L"'>

<input type="radio" name="size” id="small" nclick='sizeData="S"'>

.    In the example above, the two associated radio buttons, load the appropriate value

to the variable sizeData based on the user’sselection.

.    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

Screen format with radio buttons

4

Screen format with text boxes

2

Screen format with buttons

1

Variable declarations

2

Variable initializations

2

Process Button with appropriate code for reading input

2

Process Button with appropriate code for writing output

2

Clear Button clears text boxes and radio buttons

1

Clear Button resets variables

1

Program execution (produces results)

2

Program execution (correct results)

5

References:

.    Recitation sessions

.    Lectures

.    Fluency textbook Chapters 17, 18

.    JavaScript. Reference Guide

.   HTML color names: https://www.w3schools.com/colors/colors_names.asp





热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图