Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JavaScript Objects Create an object literal called animal with the properties species (string), name(string), legs (number) and fly (bool). Use dot notation to add the

JavaScript

Objects

Create an object literal called animal with the properties species (string), name(string), legs (number) and fly (bool).

Use dot notation to add the properties called isPrey (bool), andisPredator(bool).

Use bracket notation to add a property called enemies(string).

Use dot notation to change all of the values you have created to a different animal.

Create an object literal called transportation. It should have 3 properties called car, plane, and train. The car property should be an object with properties make (string), model (string), year (number). The plane property should be an object with properties model (string), airline(string). The train property should be an object with propertiesstation (string), wagons(number).

Console log the model of the plane. Console log the number of wagons of the train. Console log the year of the car.

Update the make of the car to be 'BMW'. Update the airline of the plane to 'AA'. Update the station of the train to be 'LA'.

Functions

Create an object called calculateTax. This object should have the following properties:

A property called state which is a function that takes a parameter. The function should multiply the parameter by 0.09 and return the value.

A property called federal which is a function that takes a parameter. If the parameter is greater than 10,000 the function should multiply the parameter by 0.2 and return the value. If the parameter is less than 10,000 the function should multiply the parameter by .1 and return the value.

A property called exempt which is a bool. Set this to true.

Console log the result of invoking the state tax of the value of 15000 and 55000.

Console log the result of invoking the federal tax of the value of 18000 and 65000.

Employee Page

Create a new page and form using Bootstrap to create a profile. Should have the following information with placeholders:

Name

Last Name

Age

Gender (M/F/Other) use a radio button.

Salary

A checkbox for Manager.

Textarea for Comments

Button to submit profile

Button to Calculate Tax

Create a function called readForm that returns the values of the inputs of the form you created as an object with property names that replicate the form.

Invoke readForm function when the submit button is clicked.

Use the readForm you created to store the information of the form. Use this object to create a function that writes the information of the current profile in the DOM. After this you should :

Use the Calculate Tax button and the calculateTax function from the previous exercise so when you click on the button you calculate the state and federal tax for the salary. Write this information in the DOM.

Use the checkbox so that when it is checked the tax will be excempt and write this to the DOM. (Managers get tax breaks!!)

Use Bootstrap to make the UI look nice.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

6. How do histories influence the process of identity formation?

Answered: 1 week ago