Java/ Java Script Programming

In Progress

A company awards its customers a discount based on their value of purchases and number of children in the family according to the following specifications:

• If the value of purchases is $5000 or more, and number of children in the family is more than 7, the discount is 30% of the value of purchases.

• If the value of purchases is $5000 or more and number of children in the family is more than 4, the discount is 22% of the value of purchases.

• If the value of purchases is less than or equal to $2500, the discount is 10%

For example, a customer pays $5000, and gets 30% of 5000, i.e.

(30/100) * 5000 = $1500.

1. Using nested if statements, write a JavaScript code which will work according to the following specifications:

• Read the amount of purchases for a customer and number of children in the family

• Calculate the discount for that customer according to the above description

• Calculate and then print the final price of the value of purchases after the discount

2. Run your program with each of the following values of purchases and children:

o $ 7000 and 10 children

o $ 5000 and 3 children

o $ 2200 and 2 children

For each test, insert a screenshot showing the output into your Solution document.

Important note: In your answers to this question, you should follow good programming style that helps readability. This includes:

o Using short comment at the beginning stating the purpose of your program.

o Selecting meaningful variables names.

o Using spacing and indentations to help make the structure of your program clear.

Skills: Article Submission

See more: variables in programming, solution programming, script programming, programming variables, programming style, programming structure, programming solution, programming question in c, programming programming, programming for children, java programming test, java programming price, java programming help, help with java programming, gets in c programming, gets c programming, children programming, beginning programming, beginning java programming, beginning c programming, programming java solution, java calculate, write java program read, java screenshot, write test script

About the Employer:
( 0 reviews ) Kuwait

Project ID: #4770322

Awarded to:

cssarma2

Hi, lets start

$25 USD in 3 days
(0 Reviews)
0.0

2 freelancers are bidding on average $25 for this job

zxparesh

Hello sir, I can do this for you.

$25 USD in 3 days
(0 Reviews)
0.0