Program (using java) that is suppose to find the largest

Assignment Help JAVA Programming
Reference no: EM13167780

writing a program (using java) that is suppose to find the lowest integer that can be evenly divided by a range (ex. 1-25). I need help fixing/debugging it so it comes up with the proper output. this is the part of my code that does the calculations

 

void main(String[] args){

int num = lowest(1,25);

System.out.println("The smallest divisible number is" + num);

}

public static int lowest(int lower_limit, int upper_limit){

boolean find = false;

int L = upper_limit;

while (find) {

boolean yes = true;

for (int j=lower_limit; j<= upper_limit; j++) {

if (j/L != (L/j ))

break;

yes = false;

}

if (yes){

find = true;

}

else{

L++;

}

}

 

return L;

}

}

 

 

Reference no: EM13167780

Questions Cloud

Unit conversions : Unit Conversions. The following problem generate tables of unit conversions. Include a table heading and column headings for the tables. Choose the number of decimal place based on the values to be printed.
What is the median of the reported blood pressure values : What is the median of the reported blod pressure values?
Saddle point is an element : For a square nXn a array, a saddle point is an element that is the maximum in its row and the minimum in its column.
What is the magnitude of the accumulated difference : The difference is accumulated every 1/10th of a second for one day. What is the magnitude of the accumulated difference
Program (using java) that is suppose to find the largest : writing a program (using java) that is suppose to find the lowest integer that can be evenly divided by a range (ex. 1-25). I need help fixing/debugging it so it comes up with the proper output.
What would be the volume if the pressure were changed : Suppose that a sample of gas occupies 162 mL of volume at 25C and a pressure of 291 torr. What would be the volume if the pressure were changed to 503 torr at 25C? Answer in units of mL.
System by gauss elimination method : Perform six iterations and find absolute approximate error with exact solution. Also solve this system by Gauss elimination method with partial pivoting in order to get exact solution.
Find the pair of compound inequalities : Show the solution sets written algebraically and as a union or intersection of intervals. Describe in words what the solution sets mean, and then display a simple line graph for each solution set as demonstrated
The transmitter and receiver are separated : The transmitter and receiver are separated by a channel (medium of transmission). What types of channels are available?  Please keep it short and simple and please no copy and paste.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd