【 备忘录-1 】

【 备忘录-1 】

package cn.itcast.demo_02;

import java.util.Scanner;

/**
 * 【 备忘录 】 ---备忘录菜单
 *         ---1.查看错误类型 
 *         ---2.查看错误历史 
 *         ---3.查看改正步骤
 *         ---4.退出
 * 
 */
public class BeiWanglu_01 {
	public static void main(String[] args) {
    //在主方法里的菜单功能序号选择中--进行调用方法
		while(true){
			             //调用备忘录菜单+返回的功能序号
			int choose = chooseFunction();
			switch(choose){
				case 1:
				  //1.查看错误类型
					wrongType();
				break;
				
				case 2:
				  //2.查看错误历史
					wrongHistory();
				break;
				
				case 3:
				  //3.查看改正步骤
					correctSteps();
				break;
				
				case 4:
				  //4.退出
					exit();
				break;
				default:
				  System.out.println("猪宝宝选择有误!请重新选择!");
				break;
		   }
	  }
}	


/*定义方法
	    ---备忘录菜单
	    ---1.查看错误类型 
	    ---2.查看错误历史 
        ---3.查看改正步骤
        ---4.退出
*/
	public static int chooseFunction() {
		// 重写抽象方法后,就可以写【具体】实现接口ZhuBaoBao的方法/功能
		System.out
				.println("--------------------------备忘录-----------------------");
		System.out.println("1.查看错误类型");
		System.out.println("2.查看错误历史");
		System.out.println("3.查看改正步骤");
		System.out.println("4.退出");
		// 键盘键入功能序号,进行选择
		Scanner sc = new Scanner(System.in);
		int chooseNumber = sc.nextInt();
		return chooseNumber;
	}

	// ---------------------------------------------------------------------
	// 抽象方法--1.查看错误类型---参数?(无)、返回值? (无)
	public static void wrongType() {
		System.out.println("---------------------1.查看错误类型--------------------");
		System.out.println();
		System.out.println("【" + "         生理期          " + "】");
		System.out.println();
	}

	// 抽象方法--2.查看错误历史---参数? (无)、返回值? (无)
	public static void wrongHistory() {
		System.out.println("---------------------2.查看错误历史--------------------");
		System.out.println("1.忘记生理期具体时间");
		System.out.println("2.猪宝宝提醒,本人较傻,说话不得体");
		System.out.println("3.关心不到位,实际行动没跟上");
		System.out.println("4.猪宝宝生气,要会哄");
		System.out.println("*最大的错误是猪宝宝原谅了我!哈哈!");
		System.out.println();
	}

	// 抽象方法--3.查看改正步骤---参数? (无)、返回值? (无)
	public static void correctSteps() {
		System.out.println("---------------------3.查看改正步骤--------------------");
		System.out.println("牢记猪宝宝的生理期!");
		System.out.println("每月主动关心她的生理期!");
		System.out.println("实际行动得有!-红糖-暖宝贴");
		System.out.println("猪宝宝生气要耐心的哄,说话得注意措词!");
		System.out.println();
	}

	// 抽象方法--4.退出---------参数? (无)、返回值? (无)
	public static void exit() {
		System.out
				.println("---------------------4.退出---------------------------");
		System.out.println("恭喜猪宝宝你已检阅完毕!请指示!");

	}

}

在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_41573718/article/details/88750287