Use the isPrime method that you wrote in previous question in a program that stores a list of all the prime numbers from 1 through 100 in a file. this was the previous question ?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

can you plz make it so i can copy and past 

and can you plz make it in java.util.scanner

Use the isPrime method that you wrote in previous question in a program that

stores a list of all the prime numbers from 1 through 100 in a file.

this was the previous question ?

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package milimil;
import java.util.Scanner;
/**
*
* @author Mabda
*/
public class Milimil {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int selection;
double distance;
Scanner key = new Scanner(System.in);
do
{
System.out.print("Enter a positive distance in meters: ");
distance = key.nextDouble();
}while(distance <= 0);
do
{

menu();

System.out.print("\nEnter your choice 1 through 4 by typing a number: ");
selection = key.nextInt();

while (selection < 1 || selection > 4)
{
System.out.print("Invalid selection. Enter your choice: ");
selection = key.nextInt();
}

switch (selection)
{
case 1 : metersToKilometers(distance);
break;
case 2 : metersToInches(distance);
break;
case 3 : metersToFeet(distance);
break;
case 4 : System.out.println("Bye!");
}
System.out.println();
} while (selection != 4);
}

public static void menu()
{
System.out.println("1. Convert to kilometers");
System.out.println("2. Convert to inches");
System.out.println("3. Convert to feet");
System.out.println("4. Quit the program");
}
public static void metersToKilometers(double meters)
{
double kilometers = meters * 0.001;
System.out.println(meters + " meters is " +
kilometers + " kilometers.");
}


public static void metersToInches(double meters)
{
double inches = meters * 39.37;
System.out.println(meters + " meters is " +
inches + " inches.");
}

public static void metersToFeet(double meters)
{
double feet = meters * 3.281;
System.out.println(meters + " meters is " +
feet + " feet.");
}
}

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Fundamentals of Testing Strategies
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education