Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

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

Number Game


A group of people are playing a game.They are standing and each carring a card with a number on it.These numbers in the list A. A random number S is selected.


Find out the new list of numbers after

  • S people were removed from the left.
  • S people were removed from the right.


Sample Input1

1,2,3

1

Sample Output1

2 3

1 2


Develop a Java program to compute and display all prime numbers between two numbers that the user enters(eg if the user enters 2 and 12 it displays 3,7,11 each in a new line. If the user enters the same numbera, program must keep giving an error message and prompting user to enter different numbers only. Use array to store numbers, use appropriate functions and control structures

Math Quiz


Write a program to print the following,


Sample Input 1

1 3 4 5 6

5

3 5

Sample Output1

12


String Concatenation


Disha has three strings A, B, and C consisting of lowercase letters.She also has a string T consisting only of characters 1, 2 and 3.

She wants to concatenate the three strings according to the characters in T.

Your task is to print the final output string.


Note: Formally, follow the below instructions:

* For each integer i such that 1<=i<=|T|, let the string si be defined as follows:

  • A if Ti = 1.
  • B if Ti = 2.
  • C if Ti = 3.

*Concatenate the strings s1,s2,...,s|T| in this order and print the resulting string.


Sample Input1

mari

to

zzo

1321


Sample Output1

marizzotomari


Find the Password

Joey is playing escape room and to exit the room he has to find the password for the final door.To know the password he is given a sentence G and told to rearrange the sentence by rotating its W words in the right.Can you help joey find the password?


Input

The first line of input is a string G.

The second line of input is an integer W.


Output

The output is a string contains a sentence got by the rearrangement as per above mentioned criteria.


Explanation

In the above example, the sentence is Raju is going to school and W is 3.

Shift the three words in the right,which means the last three words will be moved to the front.

So, the output should be going to school Raju is


Sample Input1

Raju is going to school

3

Sample Output1

going to school Raju is


Product of the String

You are given an alphanumeric string S.Write a program to multiply all the charcters(except trailing zeroes) in S and print the output.


Rules for multiplication:

  • If the character is digit, multiply its value.
  • If the character is an alphabetic character, multiply the product of digits of its ASCII value.


Input

The first line contains a string S.


Output

The output should be a integer denoting the product of characters.


Explanation

For N = 123a4


ASCII value of a is 97.

Product of digits of ASCII value of a is 9 *7 = 63.

Therefore the product of characters is 1*2*3*4*63*4 = 1512.


Sample Input1

123a4

Sample Output1

1512



Localstorage using textarea

The goal of this coding exam is to quickly get you off the ground with Localstorage using textarea.

Use the below reference image

https://res.cloudinary.com/dfxicv9iv/image/upload/v1618940947/localstorage-textarea_yvgdzf.gif


Achieve the design with HTML, CSS, and functionality with JS.

  • When the Save button is clicked
  • If the value in the HTML textarea element is non-empty, store textarea value in local storage with the key yourStory.
  • When we open or reload the page,
  • The value which exists in local storage with id yourStory should be displayed.

Quick Tip

Use bootstrap button primary.



DOM Manipulations - 3

Use the below reference image.

https://res.cloudinary.com/dfxicv9iv/image/upload/v1619260598/dynamic-dom-manipulations-3_bov0vg.gif

JAVASCRIPT

let blogList = [

 {

  blogName: "TechCrunch",

  uniqueNo: 1,

 },

 {

  blogName: "Wired",

  uniqueNo: 2,

 },

 {

  blogName: "Mashable",

  uniqueNo: 3,

 }

];

let blogsListContainerEl = document.getElementById("blogsListContainer");

function createAndAppendItem(blog) {

 let blogId = "blog" + blog.uniqueNo;

 let buttonId = "button" + blog.uniqueNo;

 let blogEl = document.createElement("li");

 blogEl.id = blogId;

 blogEl.textContent = blog.blogName;

 blogsListContainerEl.appendChild(blogEl);

 let buttonEl = document.createElement("button");

 buttonEl.classList.add("btn", "btn-danger", "ml-3");

 buttonEl.textContent = "Delete";

 buttonEl.id = buttonId;

 // Write your code here

 



The Fibonacci sequence is constructed by adding the last two numbers of the sequence so far to get the next number in the sequence. The first and the second numbers of the sequence are defined as 0 and 1. We get:

0, 1, 1, 2, 3, 5, 8, 13, 21…

 

Write a function which takes input as a number:

  • If the given number is a Fibonacci number, print the number
  • If the given number is NOT a Fibonacci number, print the sum of all odd Fibonacci numbers less than the given number.




DOM Manipulations - 2

The goal of this coding exam is to quickly get you off the ground with the DOM Manipulations.

Use the below reference image.

https://res.cloudinary.com/dfxicv9iv/image/upload/v1619259911/dom-manipulations-2_ax38mg.gif

HTML

<!DOCTYPE html>

<html>


<head></head>


<body>

  <div id="myContainer"></div>

</body>


</html>


Dynamically add the elements in HTML container element with id

myContainer to achieve the design.

Note

Use the checked property and classList.toggle method to achieve the functionality.

Resources

CSS Colors used:

#7a0ecc

#f2ebfe





LATEST TUTORIALS
APPROVED BY CLIENTS