HTML/JavaScript Web Application Answers

Questions: 588

Answers by our Experts: 588

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering


totalTorpedos, torpedosFired as inputs, write a super class Submarine with property and methods as below,PropertyDescriptionisSubmergedIt should contain a boolean value to indicate whether the submarine is submerged or not.

MethodDescriptiondiveWhen this method is called, it should set the value of isSubmerged to true and log "Submarine Submerged" text in the console.surfaceWhen this method is called, it should set the value of isSubmerged to false and log "Submarine Surfaced" text in the console.

Add a sub class weaponUnit which extends to Submarine with the below properties and methods,

The sequence of operations is,

  1. Submerge the Submarine
  2. Fire torpedos
  3. Surface the Submarine

Sample Input 1

5

2

Sample Output 1

Submarine Submerged

2 Torpedos Fired, 3 Left

Submarine Surfaced

Sample Input 2

10

2

Sample Output 2

Submarine Submerged

2 Torpedos Fired, 8 Left

Submarine Surfaced




Book Search

In this assignment, let's build a Book Search page by applying the concepts we learned till now. .When a value is entered in the HTML input element with id searchInput and press on Enter key, Get title, imageLink, author (HTTP response with key search_results) by making HTTP request using fetch with URL https://apis.ccbp.in/book-store?title=kalam&maxResults=30, Set imageLink in the HTML img element and set author in the HTML paragraph element, When a value is entered in the HTML input element with id searchInput and an option is selected in the drop down, Make a HTTP GET request to fetch the books based on the title entered and maximum number of results, If search results not equal to zero, then append the search results to the HTML container element with id searchResults, If search results equal to zero, thendisplay"Noresultsfound".

Develop User Interface as mentioned below as per the requirements:

Button One: Activate Button Two: Deactivate

Button One is pressed two fields and a button appear

Field 1: From Number Field 2: To Number

Button: Activate

Field 1 should auto-populate with the number queried from DB. And should not be changeable. The reason to still have a field is just to make it explicit what is happening.

When the Activate Button is pressed execute some action with parameter as below.

CALLACTION = "Call Forwarding On"

PHONENUMBER = From Number (From Field 1)

TOLLNUMBER = To Number (From Field 2)

Button Two is pressed a prompt and two buttons appear.

Prompt: "Are you sure you would like to deactivate the <Telephone Number>?" Where <Telephone Number> is the number initially queried.

Button 1: Yes Button 2: No



Time Converter:

In this assignment, let's build a Time Converter by applying the concepts we learned till now.

Following the above instructions, achieve the given functionality.

When values are entered in HTML input elements with ids hoursInput and minutesInput, the HTML button with id convertBtn is clicked.The converted time in seconds should be displayed in the HTML p element with id timeInSeconds.The HTML p element with id errorMsg should be empty.The HTML p element with id errorMsg should display an error message in the following cases.

When the HTML input element with id hoursInput is empty and convertBtn is clicked

When the HTML input element with id minutesInput is empty and convertBtn is clicked

When both the HTML input elements hoursInput and minutesInput are empty and convertBtn is clicked


Book Search

In this assignment, let's build a Book Search page by applying the concepts we learned till now.

Refer to the below image.


https://assets.ccbp.in/frontend/content/dynamic-webapps/book_search_output.gif


Instructions:

  • Add HTML input element with id searchInput inside an HTML container element
  • Add HTML select element with id selectDisplayCount inside an HTML container element
  • Add HTML container element with id searchResults


By following the above instructions, achieve the given functionality.

  • When a value is entered in the HTML input element with id searchInput and press on Enter key
  • Get title, imageLink, author (HTTP response with key search_results) by making HTTP request using fetch with URL https://apis.ccbp.in/book-store?title=kalam&maxResults=30
  • Set imageLink in the HTML img element and set author in the HTML paragraph element
Time Converter:


By following the above instructions, achieve the given functionality.

  • When values are entered in HTML input elements with ids hoursInput and minutesInput, the HTML button with id convertBtn is clicked
  • The converted time in seconds should be displayed in the HTML p element with id timeInSeconds
  • The HTML p element with id errorMsg should be empty
  • The HTML p element with id errorMsg should display an error message in the following cases
  • When the HTML input element with id hoursInput is empty and convertBtn is clicked
  • When the HTML input element with id minutesInput is empty and convertBtn is clicked
  • When both the HTML input elements hoursInput and minutesInput are empty and convertBtn is clicked

we want HTML , CSS & JAVASCRIPT code are written in different different ,


Articles Page

In this assignment, let's build a Articles Page by applying the concepts we learned till now. You can use the Bootstrap concepts and CCBP UI Kit as well.

Resources

Use the image URLs given below.

Categories Icons Images

  • https://assets.ccbp.in/frontend/static-website/articles-technology-icon-img.png
  • https://assets.ccbp.in/frontend/static-website/articles-science-icon-img.png
  • https://assets.ccbp.in/frontend/static-website/articles-healthcare-icon-img.png
  • https://assets.ccbp.in/frontend/static-website/articles-business-icon-img.png


Carousel Images (Technology)

  • https://assets.ccbp.in/frontend/static-website/articles-technology-c1-img.png
  • https://assets.ccbp.in/frontend/static-website/articles-technology-c2-img.png
  • https://assets.ccbp.in/frontend/static-website/articles-technology-c3-img.png


Carousel Images (Science)

  • https://assets.ccbp.in/frontend/static-website/articles-science-c1-img.png
  • https://assets.ccbp.in/frontend/static-website/articles-science-c2-img.png




Given two boolean values

  1. isGrassTrimmerFound and isWaterHosePipeFound as inputs, create three JS promises using async/await and try/catch blocks. For cutting the grass,
  • resolve with "Grass Trimmed" text, if the isGrassTrimmerFound is true
  • reject with "Grass Trimmer Not Found" text, if the isGrassTrimmerFound is false
  1. For cleaning the garden,
  • resolve with "Garden Cleaned" text
  1. For watering the plants,
  • resolve with "Watered Plants" text, if the isWaterHosePipeFound is true
  • reject with "Water Hose Pipe Not Found" text, if the isWaterHosePipeFound is false

Input

  • The first line of input contains a boolean isGrassTrimmerFound
  • The second line of input contains a boolean isWaterHosePipeFound

Sample Input 1

true

true

Sample Output 1

Grass Trimmed

Garden Cleaned

Watered Plants

Sample Input 2

true

false

Sample Output 2

Grass Trimmed

Garden Cleaned

Water Hose Pipe Not Found




Search Item in a Mart

Given an array 

mart of objects in the prefilled code and categoryOfItem, item as inputs, create a JS promise,

resolve with "Item Found" text, if the 

categoryOfItem matches with the category and the corresponding items list includes the item

reject with "Category Not Found" text, if the 

categoryOfItem does not match with any catergory in the mart

reject with "Item Not Found" text, if the 

items list does not include item

Use async/await and try/catch blocks.

Quick Tip
You can use array methods find() and includes().
Input
The first line of input contains a string categoryOfItem
The second line of input contains a number item
Output
The output should be a single line string with the appropriate message
Sample Input 1
pulses
green gram
Sample Output 1
Item Found

Sample Input 2
detergents
tide
Sample Output 2
Category Not Found


LATEST TUTORIALS
APPROVED BY CLIENTS