question:- string encoding
arya has two strings S and T consisting of lower case english letters.
since he loves encoding the strings, he dose the operation below just once on the string S
first, arya thinks of a non- negative integer K then he shifts each character of S to the right
by K
explanation:- 1) in the first example the given strings are S= abc and T= ijk.
when arya chooses K=8
"a" is shifted to the right by 8 and become "i"
"b" is shifted to the right by 8 and become "j"
"c" is shifted to the right by 8 and become "k"
2) in the second example, the given string are S=ppq and T=qqp
there is non-negative integer K that arya can choose to transform S into T so, No should be printed.
input: abc
ijk
output: Yes
input: ppq
qqp
output: No
Write a program in C++ that will simulate a basic calculator. The program should present a menu to the user and ask the user to type an option. You should use the switch statement to execute the operation selected. The menu should have the following options:
1. Add
2. Multiply
3.Subtract
4.Divide
The program should then ask for 2 numbers and perform the operation. For the 'Subtract' option, the program should check to see which number is greater then subtract the smaller number from the larger.
You are to write a program that will allow the user to select from a menu of 3 movies available to watch. The menu should look like the following:
If the user asks to watch Movie 1, ask for the number of tickets to buy and print the total to pay. The price per ticket for Movie 1 is $8.
If the user asks to watch Movie 2, then the program must ask for his/her age before it proceeds. If the user is younger than 18 years old, the program must print a message saying "Sorry you must be 18 or older to watch this movie." If the user is 18 or older, then proceed to ask how many tickets the user wants and print the total to pay. Price per ticket for Movie 2 is $10.
If the user asks to watch Movie 3, ask for the number of tickets to buy and print the total to pay. The price per ticket for Movie 3 is $6.50.
Suppose that score is an int variable. Consider the following if statements: if (score >= 90);
System.out.println("Discount = 10%");
a. What is the output if the value of score is 95? Justify your answer.
b. What is the output if the value of score is 85? Justify your answer.
Consider the relations Authors(auID,name) and Authoring(articleID,authorID), containing information on names of authors, and who is authoring which papers, respectively. i) Write an SQL query that returns for each article, its ID, title and the number of authors. ii) Write an SQL query that returns the titles of articles authored by 'Robert Tarjan'. iii) Write an SQL query that returns the number of co-authors of 'Robert Tarjan'. (I.e., the number of authors who have written at least one article together with him.)
Discuss the IPv6 Datagram with the help of suitable examples
Write a program to ask the user to input a value representing a score on a test. The value entered should be between 0 and 100. Use a IF control structure to output a message containing the letter grade corresponding to the score using the following table.
Score Letter grade
0-40 F
41-55 D
56-70 C
71-85 B
86-100 A
The above code is not executive and its somewhere mistaken
Write a function that takes an array A and reduces it to row echelon form, returning the modified array A. To do this, iterate over each row. Find the first non-zero column. Perform row operations so that (a) this first non-zero entry is set to one, and (b) all entries in this column but in rows with larger index are set to zero.
Write a program with data structure ,use atomic methods like get(),incrementAndGet),decrementAndGet().compareAndSet(), etc ,also use all other functionalities to make the progrm more responsive.