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 simple encryption program using string functions which apply the substitution method. Here is the given Substitution Table. Substitution Table: A * E $ I / O + U -


Write a program using one-dimensional array that searches a number if it is found on the list of the given 5 input numbers and locate its exact location in the list.


Sample input/output dialogue:


Enter a list of numbers: 5 4 8 2 6 Enter a number to be searched: 2 2found in location 4


Write a program using two-dimensional arrays that computes the sum of data in rows and sum of data in columns of the 3x3 (three by three) array variable n[3[3]. Sample input/output dialogue: 5 9 8 = 22 3 8 2 = 13 4 3 9 = 16 --------------------- 12 20 19


Create a program to compute the volume of a sphere. Use the formula: V= (4/3)*πr 3 where π is equal to 3.1416 approximately. The variable r is the radius. Display the volume of a sphere.


Roman Numerals


Write a program to convert a non-negative integer

N to its Roman numeral representation.Roman numerals are usually written largest to smallest from left to right.

symbol value

I 1

V 5

X 10

L 50

C 100

D 500

M 1000

A number containing several decimal digits is built by appending Roman numeral equivalent for each, from highest to lowest, as in the following examples:

  • 39 = XXX + IX = XXXIX.
  • 246 = CC + XL + VI = CCXLVI.
  • 789 = DCC + LXXX + IX = DCCLXXXIX.
  • 2,421 = MM + CD + XX + I = MMCDXXI.
  • 160 = C + LX = CLX
  • 207 = CC + VII = CCVII
  • 1,009 = M + IX = MIX
  • 1,066 = M + LX + VI = MLXVI
  • 1776 = M + DCC + LXX + VI = MDCCLXXVI
  • 1918 = M + CM + X + VIII = MCMXVIII

Input

The input will be a single line containing a positive integer N.

The input number not be greater than 104.


Output

The output should be a single line containing representation of Roman Numeral of number N.


See Roman Numerals Table for Symbol and corresponding value.




Sample Input 1

2


Sample Output 1

II


Sample Input 2

1994


Sample Output 2

MCMXCIV


Closest Palindrome Number

Given a string N, representing an integer, return the closest integer (not including itself), which is a palindrome. If there is a tie, return the smaller one.

The closest is defined as the absolute difference minimized between two integers.

Input

The input will be a single line containing an integer.

Output

The output should be a single line containing the closest palindrome number to the given integer.

Explanation

For example, if the given integer is 19, the palindrome number greater than 19 is 22 and the palindrome number less than 19 is 11. As 22 is closest to the number 19. So the output should be 22.

For example, if the given integer is 15, the palindrome number greater than 15 is 22 and the palindrome number less than 15 is 11. As 11 is closest to the number 19. So the output should be 11.


Sample Input 1

19


Sample Output 1

22


Sample Input 2

15


Sample Output 2

11




Explain the following:

a)     Memory Leak

b) Dangling Pointer  


Write c++ program code that can multiply any two matrices. The matrices read from a file. The result kept in a separate file


Write a program that prompts the user to input the coordinates of a line which lie on the circumference of a circle .write a program to compute area of circle (hint: use distance formula for calculating the diameter of a circle.)


Write a complete c++ program code which can multiply any two matrices.

The two matrices must be any size.

The elements of the two matrices is read from a file ex:matrix.dat

The result will be kept in a separate file call ex:matrix.res

Your program must be able to check whether the multiplication of the matrix can be done.



LATEST TUTORIALS
APPROVED BY CLIENTS