What is the development of Java two-color ball system?
This article introduces how the development of Java two-color ball system is, the content is very detailed, interested friends can refer to, I hope it can be helpful to you.
Function description 1.1. Menu page function package lotteryDemo1;import java.util.Scanner;public class Menu {public static void main (String [] args) {Scanner sc=new Scanner (System.in); o:while (true) {System.out.println ("Welcome to the two-color ball system, official website www.zhongbuliao.com"); System.out.println ("* Please enter menu options *") System.out.println ("* 1: buy two-color ball *"); System.out.println ("* 2: view lottery *"); System.out.println ("* 3: view winning *") System.out.println ("* 4: exit system *"); System.out.println ("* *"); System.out.println ("Please enter options"); int option = sc.nextInt () Switch (option) {case 1: System.out.println ("run Buy double Color Ball Code"); break; case 2: System.out.println ("run View Lottery Code"); break Case 3: System.out.println ("run to see the winning code"); break; case 4: System.out.println ("guests often come!"); break o Default: System.out.println ("guest officials are not allowed"); Buy two-color ball 1.3. Check the lottery.
Prepare lottery tool class
Store a method to generate lottery tickets
Package lotteryDemo1;import java.util.Arrays;public class LotteryUtil {public static int [] getLottery () {int [] lottery=new int [6]; for (int I = 0; I