- Write a method called getPrice that takes no parameters and return double In the method body generate a random number between 1 and 50
import java.util.Random;public class Random_generator {public static void main(String args) throws Exception{System.out.println(getPrice());System.out.println(getPrice());…





