No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
A pseudoperfect number, sometimes also called a semiperfect number (Benkoski 1972, Butske et al. 1999), is a positive integer such as which is the sum of some (or all) of its proper divisors, A pseudoperfect number which is the sum of all its proper divisors is called a perfect number. … |
|
pls help me with this the user enters a number n.consider the sequence from 1 through n in ascending order.insert either '+' or'-' between each of the digits so that the resultant sum is zero. for eg: input=7 output= 1+2-3+4-5-6+7=0 1+2-3-4+5+6-7=0 1-2+3+4-5+6-7=0 1-2-3-4-5+6+7=0 however when i programmed it i only … |
|
the following program is to print all possible sum combinations of a number for example 6=1+5,2+4,3+3,1+1+4,1+2+3 12=3+9,4+8,5+7,.......,1+1+2+3+5 but i m not getting any output...maybe there's a problem with proper ending of loops pls help[CODE]import java.io.*; public class sumpermutations { public void main()throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int input,i,j,d=0,s=0,num=0,d1=0; … |
|
the following code is to print the nearest twin primes to a number.for eg if the input is 20...the output should be 17 and 19 logic to my code is that it checks for twin primes within the range of a given number and then adds the twin primes.....the twin … |
|
any time a number is present in a word inflate its value by 1........ for eg, input anyone up four tennis output anytwo up five elevennis [CODE]import java.io.*; public class inflationary { public void main()throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String num[]=new String[14]; num[0]="zero"; num[1]="one"; num[2]="two"; num[3]="three"; num[4]="four"; num[5]="five"; … |
|
Polybius Square is a table that allows someone to translate letters into numbers. To give a small level of encryption, this table can be randomized and shared with the recipient. In order to fit the 26 letters of the alphabet into the 25 spots created by the table, the letters … |
|
[code]import java.io.*; class caesercipher { String str; int key; public void main()throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("ENTER A STRING"); str=br.readLine(); System.out.println("ENTER A SHIFT"); key=Integer.parseInt(br.readLine()); String encrypted=encrypt(str,key); System.out.println(encrypted); String decrypted=decrypt(encrypted,key); System.out.println(decrypted); } public String encrypt(String str,int key) { String encrypted=""; int i; for(i=0;i<str.length();i++) { int c=str.charAt(i); if(Character.isUpperCase(c)) { c+=(key%26); … |
|
A matrix to be designed in following manner for a n x n order : 1 5 9 2 12 13 14 6 8 16 15 10 4 11 7 3 view sourceprint?01 int i,j,k,l,m,b=n; 02 int w=1, x=2, y=3, z=4; 03 int a[][] = new int[n][n]; 04 for(i=0;i<=n/2;i++) 05 … |
|
spiral matrix for n*n order 1 2 3 4 12 13 14 5 11 16 15 6 10 9 8 7 . It is for printing a spiral matrix when n=5. It gave a correct output only for the elements on the sides. view sourceprint?01 class spiral_matrix 02 { 03 … |
|
Correct Sequence of brackets is always of primary importance both for written programs and mathematical expressions. By correct sequence we mean that for every opening bracket there is a closing bracket. The problem is to write a program that takes a random sized (size max 15) input of brackets from … |
|
I have this Caesar Cipher program, but it's decoding function is buggy. When you try to decode ABCDEFGHIJKLMNOPQRSTUVWXYZ it should return NOPQRSTUVWXYZABCDEFGHIJKLM but instead it returns DEFGHIJKLMNOPABCDEFGHIJKLM. I believe the code is in lines 36, 37, 43, & 44 and occurs when c becomes negative but I don't know how … |
|
though the maortgagae cals works correctly the answers are not i columns [code] import java.io.*; import static java.lang.Math.*; import java.util.Scanner; import java.text.DecimalFormat; import java.text.NumberFormat; /** * @(#)AmortWeek3.java * * AmortWeek3 application * * @author * Week 3-Service Request SR-mf-003 * Change Request 1 * Display breakdown of monthly payments * … |
|
any time a number is present in a word inflate its value by 1........ for eg, input anyone up four tennis output anytwo up five elevennis |
|
i really need help with this program i am finding a saddle number of a 2-d array which is the min value in a particular column and maximum value in its row.......and my error with the code is arrayindexoutofboundexception eg input num=4 7 6 9 10 5 3 4 6 … |