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

Tip

The formula to calculate the fare per kilometer is,

fare per kilometer = fare / distance

Input input contains a numberOutput

should be a single line containing the fare per kilometer

"use strict";

process.stdin.resume();

process.stdin.setEncoding("utf-8");

let inputString = "";

let currentLine = 0;

process.stdin.on("data", (inputStdin) => {

 inputString += inputStdin;

});

process.stdin.on("end", (_) => {

 inputString = inputString.trim().split("\n").map((str) => str.trim());

 main();

});

function readLine() {

 return inputString[currentLine++];

}

/* not modify anything above this line */

function Ride(fare, distance) {  

 /* Write your code here */

}

/* not modify anything below this line */

function main() {

 const fare = JSON.parse(readLine());

 const distance = JSON.parse(readLine());

 const ride1 = new Ride(fare, distance);

  

 console.log(ride1.getFarePerKilometer());

}


Input1

{'surname' : 'Jones', 'city': 'Los Angeles'}

{'dish': 'puddings'}

{'pet': 'Peter'}

Output1

Mr and Mrs Jones went to a picnic in Los Angeles with a boy and a pet Peter. Mrs Jones made a special dish "puddings"


function readLine() {

 return inputString[currentLine++];

}

/* Please do not modify anything above this line */

function main() {

 const father = JSON.parse(readLine().replace(/'/g, '"'));

 const mother = JSON.parse(readLine().replace(/'/g, '"'));

 const child = JSON.parse(readLine().replace(/'/g, '"'));

 /* Write your code here */ 

/* Please do not modify anything below this line */

 console.log(`Mr and Mrs ${family.surname} went to a picnic in ${family.city} with a boy and a pet ${family.pet}. Mrs ${family.surname} made a special dish "${family.dish}"`);

}


A sender sends data of length 'l'in the form of digitset to the receiver where a digitset a collection of digits. The sender sends two data d1 and d2 to the receiver. The receive finds the sum of the data. While transmission, the digit in the highest value place of d1


is corrupted as 'm' more than the actual digit.


Note: 'm' is less than the digit in the highest value place


Given the length of the data 'l', data d1, d2 and the value 'm', develop pseudocode and


C++ code to the display the sum of d1 and d2 and the corrected d1 and corrected sum. Overload '+' operator to find the sum of data.


For example, if 'l' is 3 and d1 is 321 and d2 is 996 and 'm' is 1, then the sum is 1317, corrected d1 is 221 and the corrected sum is 1217.


Input format:


Enter the length of the data, I


Next 'l' lines contains digits of d1


Next 'l' lines contains digits of d2


Last line contains 'm'


Output format:


Sum of d1and d2


Next 'l' lines contains corrected data d1


Last line contains corrected sum




myArray of strings as an input, write a JS program to convert all the strings in myArray to uppercase.Input


Sample Input 1

[ 'book', 'table', 'strawberries', 'lemons' ]

Sample Output 1

[ 'BOOK', 'TABLE', 'STRAWBERRIES', 'LEMONS' ]

input2

[ 'my best friend', 'florida', 'winter' ]

output 2

[ 'MY BEST FRIEND', 'FLORIDA', 'WINTER' ]



"use strict";


process.stdin.resume();

process.stdin.setEncoding("utf-8");

let inputString = "";

let currentLine = 0;

process.stdin.on("data", (inputStdin) => {

 inputString += inputStdin;

});

process.stdin.on("end", (_) => {

 inputString = inputString.trim().split("\n").map((str) => str.trim());

 main();

});

function readLine() {

 return inputString[currentLine++];

}

/* not modify anything above this line */

function main() {

 const myArray = JSON.parse(readLine().replace(/'/g, '"'));

  

 /* Write your code here */

}




let's build a Book Search page Refer to the below image.

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

achieve 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
  • When a value is entered in the HTML input element with id searchInput and an option is selected in drop down
  • Make HTTP GET request to fetch books based on the title entered, maximum number of results
  • If search results not equal to zero, append the search results to the HTML container element with id searchResults
  • If search results equal to zero, then "No results found"


PLEASE WRITE HTML AND JAVASCRIPT CODE FOR THIS...


Bookmark Maker

let's build a Bookmark Maker

Instructions:

  • The page should have HTML form element with id bookmarkForm
  • The HTML form element with id bookmarkForm should have HTML input elements with ids siteNameInput and siteUrlInput
  • The HTML form element with id bookmarkForm should have HTML button element with id submitBtn
  • Add HTML label elements for HTML input elements with ids siteNameInput and siteUrlInput
  • The HTML form element with id bookmarkForm should have HTML p elements with ids siteNameErrMsg and siteUrlErrMsg
  • The page should have HTML unordered list element with id bookmarksList
  • Each bookmark item should contain a HTML anchor element to navigate to the bookmarked site

Warning

  • Please provide valid URL's to the siteUrlInput element

By following the above instructions, achieve the given functionality.

  • When the HTML button element with the id submitBtn is clicked,
  • If the values are entered in the HTML input elements with ids siteNameInput and siteUrlInput
  • A new bookmark should be added to the bookmarksList as list item.
  • If the siteNameInput value is empty,
  • The HTML p element with id siteNameErrMsg should have error message
  • If the siteUrlInput value is empty,
  • The HTML p element with id siteUrlErrMsg should have error message
  • When the visit button of a bookmark is clicked the site URL should open in a new tab.
  • When the HTML input element with id siteNameInput is empty after changing the value inside the input
  • The HTML p element with id siteNameErrMsg should have error message
  • When the HTML input element with id siteUrlInput is empty after changing the value inside the input
  • The HTML p element with id siteUrlErrMsg should have error message




The rectangular rule (also called the midpoint rule) is perhaps the simplest of the three methods for estimating an integral. i. Integrate over an interval a ≤ x ≤ b. ii. Divide this interval up into n equal subintervals of length h = (b − a)/n. iii.Approximate f in each subinterval by f(x*j ), where x*j is the midpoint of the subinterval. iv. Area of each rectangle: f(x*j)h, f(x*j)h,. . . , f(x*n)h


m, n = input('Enter the values of M and N separated by a space: ').split()
m = int(m)
n = int(n)
matrix_str = input('Enter all matrix values separated by a space: ').split()

matrix = [matrix_str[n*i:n*(i+1)] for i in range(m)]

for i in range(n):
    for j in range(i+1):
        try:
            print(matrix[j][i-j],end=' ')
        except:
            break
    print('')

for i in range(1,m):
    for j in range(i+1):
        try:
            print(matrix[i+j][-1-j],end=' ')
        except:
            break
    print('')  



In this answer why did we use for i in range(m) while getting matrix

can you please explain to me why we used it like that and can we use it like that


m, n = input('Enter the values of M and N separated by a space: ').split()

m = int(m)

n = int(n)

matrix_str = input('Enter all matrix values separated by a space: ').split()


matrix = [matrix_str[n*i:n*(i+1)] for i in range(m)]


for i in range(n):

for j in range(i+1):

try:

print(matrix[j][i-j],end=' ')

except:

break

print('')


for i in range(1,m):

for j in range(i+1):

try:

print(matrix[i+j][-1-j],end=' ')

except:

break

print('')



In this answer why did we use for i in range(m) while getting the matrix


A shift cipher (a.k.a. Caesar’s cipher) is a simple substitution cipher in which each letter in the plaintext is replaced with another letter that is located a certain number, n, positions away in the alphabet. The value of n can be positive or negative. For positive values, replace letters with letters located n places on its right (i.e. ‘shifted’ by n positions to the right). For negative values, replace letters with letters located n places on its left. If it reaches the end/start of the alphabets, wrap around to the start/end. For example: If n = -3, each letter in the plaintext is replaced with a letter 3 positions before that letter in the alphabet list.


LATEST TUTORIALS
APPROVED BY CLIENTS