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

Create a console program that will perform the following:





Ask the user to enter five (5) grades





Compute the average of the grades





Round of the average using method of Math class




Example output:



Enter 5 grades separated by new Line.



90



83



87



98



93




The average is 90.2 and round off to 90.




You've learned in the past lessons on how to use square root functions, right? Then let's take your knowledge to the test. Print out the square root of a given integer with only two decimal places.






Ready, solve, and go!






Input






A line containing an integer.






4






Output






A line containing a decimal with two decimal places.






2.00

Vowels Survival

by CodeChum Admin

Make me a program that accepts two random strings. Then, count the number of vowels that are in each of the strings and put it on separate variables.


Finally, for the survival of the vowels, subtract the total count of vowels of the first string to the vowels of the second string then print out its difference.


Easy, right? Then go and code as if your life depends on it!


Input

Two lines containing a string on each.

C++·is·fuN
CodeChum·is·AWEsome

Output

A line containing an integer.

6

Listing 102


We've already made listing an array the easy way, but how about listing and printing the array in reverse order?


Make a program that will input an integer and then using loops, add items on an array/list one by one for the same number of times as that of the first inputted integer. Then, print out the array/list in ascending order. After doing that, print the array again on the next line in reverse order, that is, starting from the last item on the array/list down to the first one, each in separated lines.


Input

The first line contains the size of the array.

The next lines contains the items of the array (integers).

5
1
64
32
2
11

Output

The first line contains the elements of the array printed in ascending order.

The second line contains the elements of the array printed in reversed order.

1·64·32·2·11
11·2·32·64·1

Search and Rescue

by CodeChum Admin

Make a program that will accept an integer and loop for the same number of times as that of the inputted integer and input random integers and add it to the array/list one by one, per line. Afterwards, make your program accept another random integer.


Using that final integer, compare from your array/list if the final integer's value is also present in your current array/list. If so, print "Present"; otherwise, print "None".


Start coding now!

Input

The first line contains the size of the array.

The next lines contain the integers.

The last line contains an integer to be searched.

5
3
21
2
5
23
2

Output

A line containing a string.

Present

 Only the Even Ones

by CodeChum Admin

I have an array of 3 numbers here with me that's already in the code editor, but I want you to add some more to this list by inputting some more numbers yourself in one line and then, print out only the even numbers from the array.


Can you do that for me?


Input

The first line contains the number of elements, n, to be added.

The next line contains the n integers separated by a space.

5
33·54·32·11·8

Output

Multiple lines containing an integer.

2
54
32
8

Arraying 101

I want you to make an array of numbers for me. All you have to do is make a program that will let me input any random integer in one line. Afterwards, it will then print out all the numbers I've inputted, backwards, on separate lines.


Care to do that for me?


Input

The first line contains the size of the array.

The next line contains the integers separated by a space.

5
1·64·32·2·11

Output

Multiple lines containing integers on each.

11
2
32
64
1




Matrix Rotation


You're given a square matrix A of dimentions N X n. You need to apply below 3 operations.


Rotation: It is represented as R S where S is an integer in {90,180,270...} which denotes the number of degrees to rotate .You need to rotate the matrix A by angle S in the clockwise direction.


The angle of rotation S will always be in multiples of 90 degrees.


Update: It is represented as U X Y Z. In initial matrix A , you need to update the element at row index X and column index Y with value Z.


Querying: It is represented as Q K L.You need to print the value at row index K and column index L of the matrix of the matrix A.




Sample Input 1


2


1 2


R 90


Q 0 0


Q 0 1


R 90


Q 0 0


U 0 0 6


Q 1 1


-1




Sample Output 1


3


1


4


6




Sample Input 2


2


5 6


7 8


R 90


Q 0 1


R 270


Q 1 1


R 180


U 0 0 4


Q 0 0


-1


Sample Output 2


5


8


8


Quotation marks are usually paired with a similar type, like a double quote (") paired with another double quote ("), and the same goes for single quotes ('). However, I'd like to try complicating things by putting together a pair of a double quote(") and a single quote(') in one statement!






Can you do this simple challenge?






Output






A line containing a string.






"'

Write a program that will get two numbers and print the average


LATEST TUTORIALS
APPROVED BY CLIENTS