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
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:
*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:
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.
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:
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.
CSS Colors used:
#7a0ecc
#f2ebfe