Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Web Development - Assignment out of 5 Question 1 : You're developing a subscription management system. Write a function named calculateSubscriptionCost that calculates the total

Web Development- Assignment out of 5
Question 1: You're developing a subscription management system. Write a function named calculateSubscriptionCost that calculates the total cost of a subscription plan based on the provided parameters.
The function should take in three arguments
1.basePrice (number): The base price of the subscription plan.
2. user Type (string): Represents the type of user - either "regular" or "premium".
3. months (number): The number of months for which the subscription is being purchased.
For "regular" users, there's no discount.
For "premium" users, apply a 20% discount on the base price. Means multiply by 0.80
Calculate the total cost of the subscription for the given number of months after applying the discount.
In HTML Page create a division with class named form container having title as heeding 2 Subscription cost system containing the three arguments discussed in the question
Some Designs are applied to this page as follow:
The form-container should have a maximum width of 420px, centered using margin 0 auto, using and bordered with a 1px solid color of #ccc. It should also have a border radius of 5px, along with 20px of padding.
All heading 2 must be aligned center with margin bottom 20px and blue color
All labels in the form must be displayed block with margin bottom 5px
All text input and select Should be set to a width of 94%. They should have 5 px padding, an 8 px bottom margin, a border radius of 3px, and a border of 1px solid color # ccc.
The input type button needs to have a background color of #4CAF50, white font color, and padding set to 8px by 12px. It should have no border, a border-radius of 3px, a pointer cursor, and a width of 94%
Subscription Cost System
Base Price
User Type
Number of Months
The Cost after Discount is: 1440
Calculate Cost
|
image text in transcribed

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

More Books

Students also viewed these Databases questions

Question

Discuss briefly the advantages and disadvantages of a CFD contract.

Answered: 1 week ago