1.Write a program to find largest number among three number. Also, design flowchart of the program.
Write a regular expression for the following languages, over sigma=(a,b) All strings that do not end with aa.All strings that contain an even number of b’s. All strings which do not contain the substring ba.
Construct NFA for the regular Expression R=(a+b) ∗abb
Draw DFAs for the regular expression R= a ∗ (ba∗ ba∗ ) ∗
The Pythagorean theorem states that the sun of the squares of the sides of a right triangle is equal to the square of the hypotenuse. Given two positive integers, m and n, where m>n, a Pythagorean triple can be generated by the following formulas:
Side 1= m2 - n2
Side 2 = 2mn
Hypotenuse = m2 + n2
Write a program in visual basics that reads in values for m and n and prints the values of the Pythagorean triple generated by these formulas
Product of values in the Sub-array(s)
Given an array
nestedArray of arrays, write a JS program to multiply the values in the sub-array if at least one of its values is even else return zero.
Quick Tip
You can use array methods map(), some() and reduce().
Sample Input 1
[ [ 12, 1, 2, 4, 1 ], [ 18, 20, 30, 45 ], [ 49, 11, 13, 21 ] ]
Sample Output 1
[ 96, 486000, 0 ]
Sample Input 2
[ [ 0, 1 ], [ 1, 3, 4 ] ]
Sample Output 2
[ 0, 12 ]
i want code in between write code here
"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++];
}
/* Please do not modify anything above this line */
function main() {
const nestedArray = JSON.parse(readLine());
/* Write your code here */
}
Split and Replace
Given three strings
inputString, separator and replaceString as inputs. Write a JS program to split the
inputString with the given separator and replace strings in the resultant array with the replaceString whose length is greater than 7.
Quick Tip
Sample Input 1
JavaScript-is-amazing
-
Programming
Sample Output 1
Programming is amazing
Sample Input 2
The&Lion&King
&
Tiger
Sample Output 2
The Lion King
i need code in between write code here
"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++];
}
/* Please do not modify anything above this line */
function main() {
const inputString = readLine();
const separator = readLine();
const replaceString = readLine();
/* Write your code here */
}
Fetch the top 10 videos having more number of views, along with the channel details.
Sort the output in the descending order of no_of_views, and then in the ascending order of channel_name.
video_nameno_of_viewschannel_name
TABLE CHANNEL:-
channel_id name owner_id created_datetime
350 Motivation grid 1011 2014-10-05 17:32
351 Marvel 1011 2014-10-05 17:32
352 Disney 1012 2015-09-10 15:32
353 Tedx 1013 2016-10-05 17:32
354 ETV 1011 2012-08-17 19:32
355 Maa 1012 2007-03-07 11:32
356 PewDiePie 1012 2004-10-05 11:32
357 VanossGaming 1013 2005-09-10 15:32
358 Markiplier 1013 2014-10-05 08:32
359 Ninja 1012 2016-08-17 17:32
360 WWE 1011 2016-09-10 12:32
361 Tech savvy 1011 2016-09-10 12:32
362 Marques Brownlee. 1012 2018-09-10 12:32
363 The Verge 1013 2015-09-10 12:32TABLE VIDEO:-
video_id name duration_in_secs published_datetime no_of_views channel_id
1000 Getting My
Driver's License 3652 2011-12-05 19:00 10619 367
| Lele Pons
1001 Apple iPhone
X Review: The 4556 2021-01-19 20:12 140012 362
Best Yet!
1002 Victoria Beckham
Gives Strangers
Fashion Advice for 836 2021-01-19 20:12 75609 353
$2 in Central Park
| Vanity Fair
1003 4 Reasons I Don't
Like Thanksgiving 1751 2017-05-05 17:32 279351 350
|| Mayim Bialik
1004 Maroon 5 - What
Lovers Do 3186 2018-02-17 19:32 94945 354
(Live On The Ellen
DeGeneres Show/2017)
1005 Alicia Keys - When
You Were Gone 3737 2018-04-10 12:32 35526 361
1006 U.S. Navy Three
Carrier Formation in 3538 2021-01-19 20:12 180973 362
Western Pacific Ocean
1007 DIY - Simon's Cat
| NEW BLACK & WHITE! 1365 2012-09-07 11:32 106271 355
1008 You, but in emojis.
(YIAY #375) 3874 2021-01-19 20:12 16469 352
1009 100 People Hold
Their Breath for as
Long as They Can 2885 2015-05-17 19:32 272102 354
1010 Luke Bryan - Hooked
On It (Audio) 2106 2016-02-10 12:32 184471 366EXPECTED OUTPUT:-
video_name no_of_views channel_name
... ... ...String Starts or Ends with given String
Given an array
stringsArray of strings, and startString, endString as inputs, write a JS program to filter the strings in stringsArray starting with startString or ending with endString.
Quick Tip
You can use the array method filter() and logical operator OR ( || ).
Sample Input 1
['teacher', 'friend', 'cricket', 'farmer', 'rose', 'talent', 'trainer']
t
r
Sample Output 1
[ 'teacher', 'farmer', 'talent', 'trainer' ]
Sample Input 2
['dream', 'player', 'read', 'write', 'trend']
p
d
Sample Output 2
[ 'player', 'read', 'trend' ]
i want code in between write code here
"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++];
}
/* Please do not modify anything above this line */
function main() {
const stringsArray = JSON.parse(readLine().replace(/'/g, '"'));
const startString = readLine();
const endString = readLine();
/* Write your code here */
}
Create a program using a one-dimensional array that accepts five input values from the keyboard. Then it should also accept a number to search. This number is to be searched if it is among the five input values. If it is found, display the message “Searched number is found!”, otherwise display “Search number is lost!”.