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

Write a program to take a String as input then display the first and last letter of each word with a condition that if it is having one character then it will remain as it is using only indexOf() function.

For example:

Enter a String

ASia is A conTinEnT

Modified: Aa is A cT


Write a program to take a String as input then display the position of a particular character given as input using indexOf() function of String class. Don't use charAt() function.

Enter a String

JapanIsSupremE

Enter character to find: e

Index Position: 11


Write a program to take a String as input then display the palindrome word in one column and its position in another column.

Example:

Enter a String

My Mom brought a racecar

Mom \t 2

racecar \t 5


for(i=0;i<l;i++) {

c = s.charAt(i);

if(c != ' ') {

w=w+c;

r=r+c;

} else {

if(w.compareToIgnoreCase(r)==0)

w=""; r=""; //Use this code to search palindrome words


Write a program that has two functions: the main function and a function, called sumOfSquared(n), that takes an integer number (read in the main function uisng input) and calculates the total sum of squares of all numbers from 1 to a given number. Then, it returns the result to the main function. Finally, the result should be printed.  


Final Project - TicTacToe Human vs. Computer 2 # 3 # Purpose: using a nested list structure to store a 3x3 grid of values 4 # simulate a childhood game of tic-tac-toe. The human player interacts 5 # with a full command line interface to select board positions.


the goal of this coding exam is to quickly get off you the ground with the array method every().

input

  • the input will be single line containing an array of objects candidatesList

output

  • the output should be single line containing an array with names of the selected candidates.


input1

[{'name': 'Blake Hodges', 'points':[76, 98, 88, 84]},[{'name': 'James Anderson', 'points':[0, 98, 12, 33]},[{'name': 'Matthew Norton', 'points':[89, 67, 83, 93]}

output1

['Blake Hodges]


function readLine() {

 return inputString[currentLine++];

}


function main() {

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


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

  

 // Write your code here

}


Area of a Sub-matrix


You are given an M*N matrix and K, write a program to compute the area of the sub-matrix and print the result.

A sub-matrix is a matrix formed after deleting K rows each from the top and bottom and K columns each from left and right.

Area of a matrix is defined as the product of all elements of the matrix.


Explanation

For M = 5 and N = 4, the matrix is:

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16

17 18 19 20

For K = 1, the sub-matrix is as follows:

6 7

10 11

14 15

Therefore, the area of the matrix is 6*7*10*11*14*15 = 970200.



Sample Input1

5 4

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16

17 18 19 20

1


Sample Output1

970200


New Dictionary


Peter is making a new dictionary.He wants to arrange the words in the ascending order of their length and later arrange the ones with the same length in lexicographic order.Each word is given a serial number according to its position.Find the word according to the serial number.


Input

The first line of input is a positive integer which is the serial number.


Output

The output should be a single line containing the word that represents the serial number.


Explanation

Given serial number is 42.

As the serial number is between 26 and 52, the first character of the word is A.The remaining counter of the serial number is 16 (42-26).

The second character of the word is the 16th alphabet, which is P.

So, the output should be AP.


Sample Input1

42

Sample Output1

AP


Sample input2

751

Sample output2

ABW


The volume of a sphere is 4/3πr3, where π has the value of "pi" given in Section 2.1 of your textbook. Write a function called print_volume (r) that takes an argument for the radius of the sphere, and prints the volume of the sphere.

Call your print_volume function three times with different values for radius.

Include all of the following in your Learning Journal:

  • The code for your print_volume function.
  • The inputs and outputs to three calls of your print_volume

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




LATEST TUTORIALS
APPROVED BY CLIENTS