Getting A Algorithm Format Of Butterfly Sub Division Technique?
Jul 16, 2014
Here is the Butterfly sub division technique which refines the mesh of a STL file.I have to prepare a java code based on this technique, give the step by step procedure or algorithm for this.(files attached)
View Replies
ADVERTISEMENT
Aug 27, 2014
if there is a possibility to use the pass by reference technique in java like in C++.URL....
View Replies
View Related
May 9, 2014
a)Write a method that recursively displays any given character the specified number of times on one line.For example, the call: displayRowOf Characters(,5);
Produce a line: *****Write another method that uses a for-loop to perform the same process.
B is something like this ?
for (i=1; i<=n; i++)
i= '*' * n;
System.out.print(i);
View Replies
View Related
Apr 17, 2012
I'm currently working on a RSA Encryption using Fast Exponential technique. As the numbers I'm working with will be very huge, I am forced to use BigInteger.
As this is the first time I'm using Big Integer, I encountered quite a number of issues. I'll try my best to explain the errors I'm facing:
1. I had done this step: BigInteger d;
So I'm currently trying to get d = 0;
However, I keep getting an error required: BigInteger, found int.
When I changed it to d = new BigInteger(0) , I get this error:
java:19: error: constructor BigInteger in class BigInteger cannot be applied to given types;
d = new BigInteger(0);
^
required: no arguments
found: int
reason: actual and formal argument lists differ in length
Part of Code:
public class BigFastExponential
{
BigInteger e; // public exponenet: all has this
BigInteger d; // private key: only key owner has this
BigInteger n; // public modulus: all has this
/**
* Create a LongRSA object for a public key holder, with just e and n.
*/
public BigFastExponential(BigInteger public_e, BigInteger public_n)
[Code] ....
View Replies
View Related
Apr 24, 2014
I wanna to know how to do division with remainder Presented as xry where x is result of the division
And y is the remainder like 9 % 3 = 9r3
View Replies
View Related
Feb 20, 2014
I have used FileInputStream class but its not working properly to divide the bits into blocks.I will attach the coding
public static void main(String[] args) {
ReadFileExample newclass = new ReadFileExample();
System.out.println("cryptography");
[Code].....
View Replies
View Related
Feb 7, 2014
I'm doing project in area of "Cryptography and Network security". I'm having a file with binary Unicode (mean file contain Unicode value of corresponding data (text file)), want to divide that as blocks with the size of 144bits.
View Replies
View Related
Apr 24, 2015
I am having problems with my code I have added the multiplication and division but they will not display also how can I correct any error when dividing by zero?
import java.awt.*;
import java.awt.event.*;
public class calculator2 extends java.applet.Applet implements ActionListener {
TextField txtTotal = new TextField("");
Button button[] = new Button[10];
[Code] .....
View Replies
View Related
Feb 4, 2015
I am using count++ in my program in order to count the number of division that occurs. It works but outputs:
The number of divisions is 1
The number of divisions is 2
The number of divisions is 3
The number of divisions is 4
The number of divisions is 5
All i want is the last line. How do I solve this?
import java.util.Scanner;
public class Program3
{
public static void main(String [] args)
{
int div;
[Code] ....
View Replies
View Related
Jun 11, 2014
This is my code so far, how can I improve to show the reminder of the operation as well.
package calculator4;
import java.io.*;
public class divide
{
public int num2;
public int num1;
public static void main(String args[])
[Code] ....
View Replies
View Related
Dec 15, 2014
The challenge is to weed out all the prime numbers without using any kind of division (%, /). My code doesn't weed out certain numbers, such as many multiples of 5, the number 49, etc, and I am not sure why. Here is my code.
My logic for the for loops was this: Starting with the upper numbers of the ArrayList, find every number that is a multiple of that number and remove it from the ArrayList. Every time you find a multiple, increase the variable multiply, so the program knows what the next multiple to look for.
// program doesn't work yet.
import java.util.ArrayList;
// import java.util.ListIterator;
public class Sieve2
{
public static void main(String[] args)
{
int upperLimit = 55;
ArrayList<Integer> primes = new ArrayList<Integer>();
[Code] .....
And this is the output:
1 2 3 5 7 11 13 17 19 23 25 29 31 35 37 41 43 47 49 53 55
View Replies
View Related
Mar 5, 2014
I was trying to execute the following program and the multiplication worked but the division didn't work.
import java.util.Scanner;
public class BodyMassIndex {
public static void main(String[] args) {
// Prompt the user for weight and height
// Create a scanner
Scanner input = new Scanner (System.in);
System.out.println("Please enter your weight in pounds");
int weight = input.nextInt();
System.out.println("Please enter your height in inches");
int height = input.nextInt ();
double BMI = weight * (0.45359237)/ (height * 0.0254)*(height * 0.0254);
// the weight * (0.45359237) executed but it wasn't divided by (height * 0.0254)*(height * 0.0254)
System.out.println ("Your BMI is "+BMI);
View Replies
View Related
Oct 22, 2014
Prompt for the project is "Write a program that will ask the user for a number of seconds and output the equivalent period of time in days, hours, minutes, and seconds.The program should:
-Use modulo division to calculate the number of days, hours, and minutes.
-Use compound operators when making assignments.
-Proper formatting and use of comments
-Symbolic constants defined as the number of seconds in a minute, hour, and day.
For example: final int sec_in_min = 60;"
public class Mod1
{
public static void main (String[] args)
{
int sec, min, hr, day;
final int SEC_IN_MIN = 60;
final int SEC_IN_HR = 60 * 60;
final int SEC_IN_DAY = 60 * 60 * 24;
[code]....
View Replies
View Related
Mar 24, 2014
I am trying to make a program that compares the 3 different search algorithms(sequential/binary/hashing). I have already made the sequential search algorithm, binary and hashing part of the code.My program OPENS a data file, and then OPENS a key data file. and then searches through them using both. How to go about the binary and hashing search algorithm (in the driver program).
*I have included a zip file with:
-base program
-driver program
-data file
-key data file
View Replies
View Related
Jan 2, 2015
I have a code that is meant to read a file and organize all the names from least to greatest salaries. It also allows the user to enter a name to find from the file, and the program finds the name and displays it. I have two errors, and I will show the error in my code
View Replies
View Related
Feb 7, 2015
I'm making a code for a log in system that allow me to verify if username and psw are correct (using a file txt as refer), and then i will add maybe the possibility to sign up.
The fact is that I want this kind of formatting on the .txt
username psw
username psw
username psw
...etc
So I have to read the lines and split to the " " and compare the insert data and the read data.
Here is my code, it star but give me this error when i insert any word
XML Code:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
at prova.main(prova.java:20) mh_sh_highlight_all('xml'); Java Code: import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class prova {
public static void main(String[] args) throws FileNotFoundException {
[Code] .....
View Replies
View Related
Feb 21, 2014
What is difference between algorithm and programming?How to develope algorithm knowledge?
View Replies
View Related
Oct 4, 2014
Encryptor
Java Code:
Private Sub cmdDeleteMessage_Click()
If txtMessage.Text = "" Then
a = MsgBox("No message to delete!", vbInformation, "")
Else: If MsgBox("Do you want to create a new message?", vbYesNo, "New") = vbNo Then Exit Sub
txtMessage.Text = ""
Pic.Picture = LoadPicture()
[Code] .....
Is these codes of the Block cipher encryptor for text-to-image algorithm (B-TTIE algorithm) by Abusukhon 2013? If not, how to make it the same with B-TTIE algorithm?
View Replies
View Related
May 23, 2015
how to create a genetic algorithm.I made this class that Is supposed to Generate the chromes or Possible solutions of the program. Im pretty sure It doesn't have any syntax error and I went over the logic a couple time yet Im getting a NumberFormatException Exception Error. What this error means nor why am I getting it. Here's my code:
/* Contains the genes or possible solutions to the problem
*/
public class Genes
{
/* Each element is a binary number that corresponds to index number they have been assigned to, these are the possible genes
* The last 4 elements in the array represent + - * / correspondingly
*/
private String[] encodedNumbers = {"0000", "0001", "0010", "0011","0100", "0101", "0110","0111","1000","1001","1010","1011","1100","1101"};
[code]...
View Replies
View Related
Jan 4, 2014
I have been trying to create an algorithm for the computer in my Tic-Tac-Toe game? So I searched for some good ones, and found about this confusing but effective algorithm, at least if you get it working, called Minimax. I tried implementing it into my game. Let's say it was easier said than done. Sometimes I think it's working, but sometimes it doesn't work at all. How do I get my algorithm working? What the variables BEST_SCORE_COMPUTER and BEST_SCORE_PLAYER in my code should have as starting values.
Java Code:
import java.util.Scanner;
public class TicTacToe{
private static char BOARD[] = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}; // This is the main board itself.
private static int ROWS[][] = {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}, {0, 3, 6}, {1, 4, 7}, {2, 5, 8}, {0, 4, 8}, {2, 4, 6}}; // These are all the rows one can win by filling.
private static int SCORE, BEST_MOVE_COMPUTER, BEST_SCORE_COMPUTER = -1, BEST_SCORE_PLAYER = 1; // These variables speak for themselves.
private static byte TURN = 1; // 1 means player's turn, and 2 means computer's turn.
[Code] .....
View Replies
View Related
May 7, 2014
I have a set of numbers within a text file.
2 6
1 4 4 1
When the program reads these numbers it will start with the first line. It reads 2, this is the number of times the program should loop through the numbers of the second line. Next it reads 6, this is the number that the sum of numbers on line 2 cannot go beyond, it must equal 6 or be less than.
Next it goes to line 2 and processes the numbers, 2 is less than 6 so it gets processed, so is 4 and when added to 2 it equals 6. This passes the rules therefore gets processed and added together and put in a variable. Once 2 and 4 has been processed it gets put at the back of the number queue, so the numbers look like 1 1 2 4.
With one loop done there is only one left, so it processes the next sum of numbers 1 1 2 as these equal 4 and pass the rule. So these get added together and and put to the back of the queue, 4 1 1 2. But all the loops are finished and the sum of the last loop is added on to the sum of the previous loop. 6 + 4 = 10.
What I need the algorithm to do is print the sum of this whole process when it reads these numbers from a file. I am able to read the numbers from a text file but not sure where to proceed from there.
Also the set of numbers vary, for example the next 2 lines of numbers could be,
10 7
3 1 1 1 4 4
View Replies
View Related
Jun 6, 2014
Is it possible to enable & disable "jdk.certpath.disabledAlgorithms" property programmatically. I want to remove all disabled Algorithms for some time and later I will enable it.
Or is it possible to enable only for a particular place & not in a JVM level. I want that Algorithm need to be enabled for a piece of code, but I don't want it to the remaining part of the application.
View Replies
View Related
Oct 13, 2014
I am looking to program a simple genetic algorithm in Java but where to start.
" In a computer language of your choice, implement a simple genetic algorithm (GA). That is, write code for a generational GA which uses a binary encoding, tournament selection, single-point crossover and bit-wise mutation" ....
View Replies
View Related
May 6, 2015
I have been given this Pseudocode for the Quicksort algorithm:
quicksort(a[], p, r)
if r>p then
j=partition(a[], p, r)
quicksort(a[], p, j-1)
quicksort(a[], j+1, r)
[code]....
I was wondering why:
- why the condition left < right needs to be true for the while loop in the function Partition
- what the while loop does in the function Partition
View Replies
View Related
Apr 12, 2015
I have a checker game already and I am trying to make an AI opponent even if not so Intelligent as long as it can move chips on its own until the game is over.
View Replies
View Related
Apr 29, 2015
I am using what is known as a Depth First Search to solve a maze using my own Stack created class for an assignment. The reason I believe I am getting this error is because my program is never meeting the `finishSpot` condition. I have used the debugger and it looks like it is infinitely stuck at the Point before the `finishSpot`. My logic seems to be mostly correct except until the point where my maze solver tries to finish the maze.
This is a sample maze:
*****
*s* *
* * *
* f*
*****
Here is my Main which uses my created Stack class.
//Creates a Stack and determines the start and endpoints.
public static void solveDFS( char [][] maze ){
LinkedStack stack = new LinkedStack();
Point currentSpot = findPoint( maze,'s' );
Point finishSpot = findPoint( maze, 'f' );
findPath( maze,currentSpot, finishSpot,stack );
[code]....
View Replies
View Related