Java可选择的趣味测试系统

 

import java.util.Locale;

import java.util.Scanner;

public class Mytest {

public static void main(String[] args) {

Scanner scanner=new Scanner(System.in);

System.out.println("***********************");

System.out.println("趣味测试系统");

System.out.println(" 1-------爱情");

System.out.println(" 2-------性格");

System.out.println(" 3-------心理");

System.out.println("***********************");

System.out.println("请选择你要参加的趣味测试序号:");

String select_no=scanner.next();

if (select_no.equals("1")){

System.out.println("欢迎您来到爱情趣味测试!");

Scanner input=new Scanner(System.in);

//输入男生名字

System.out.println("请输入男生名字:");

String boy=input.next();

//输入女生名字

System.out.println("请输入女生名字:");

String girl=input.next();

//计算姻缘指数,random()产生的是0-1之间的小数

//保留两位小数Math.round四舍五入

//加入提示的语句,boy和girl合成时不加引号

//如果是a和b,则100%

if (boy.equals("a")&&girl.equals("b")){

System.out.println("a和b的姻缘指数:100%");

}else{

System.out.println(boy+"和"+girl+"姻缘指数:");

System.out.println(Math.round(Math.random()*100)+"%");

}

}else if (select_no.equals("2")) {

Scanner input = new Scanner(System.in);

System.out.println("欢迎您来到性格趣味测试!");

System.out.println("请回答以下问题:");

System.out.println("1. 你是一个很清楚自己缺点的人吗?");

System.out.println("A:是的");

System.out.println("B:还好");

System.out.println("C:不是");

//输入A/B/C

String answer1 = input.nextLine();

System.out.println("2. 你是一个知错就改的人吗?");

System.out.println("A:是的");

System.out.println("B:还好");

System.out.println("C:不是");

//输入A/B/C

String answer2 = input.nextLine();

System.out.println("3. 你最喜欢哪个阶段的太阳呢?");

System.out.println("A:早晨的日出");

System.out.println("B:中午的烈阳");

System.out.println("C:傍晚的余晖");

//输入A/B/C

String answer3 = input.nextLine();

//定义初始分数为0

int score = 0;

//三个题目 选A+3分 选B+2分 选C+1分

if (answer1.toUpperCase().equals("A")) {

score += 3;

}

if (answer1.toUpperCase().equals("B")) {

score += 2;

}

if (answer1.toUpperCase().equals("C")) {

score += 1;

}

//第二个题目

if (answer2.toUpperCase().equals("A")) {

score += 3;

}

if (answer2.toUpperCase().equals("B")) {

score += 2;

}

if (answer2.toUpperCase().equals("C")) {

score += 1;

}

//第三个题目

if (answer3.toUpperCase().equals("A")) {

score += 3;

}

if (answer3.toUpperCase().equals("B")) {

score += 2;

}

if (answer3.toUpperCase().equals("C")) {

score += 1;

}

System.out.println("你的得分是:" + score);

if (score >= 9) {

System.out.println("你是一个乐观积极的人!");

} else if (score >= 5) {

System.out.println("你是一个比较平凡的人!");

} else {

System.out.println("你是一个相对消极的人!");

}

}

else if (select_no.equals("3")){

Scanner input = new Scanner(System.in);

System.out.println("欢迎您来到心理趣味测试!");

System.out.println("请回答以下问题:");

System.out.println("1. 下面几种事物,你最喜欢的是??");

System.out.println("A:水晶");

System.out.println("B:翡翠");

System.out.println("C:琥珀");

//输入A/B/C

String answer1 = input.nextLine();

if (answer1.toUpperCase().equals("A")) {

System.out.println("可能是你很早就意识到,自己的人品要败完了,因为它时刻都在消耗,如果不懂得积攒更高的人品,未来的日子说不定真的很难熬!所以你迅速地行动起来了,为要攒攒人品,做了很多的努力。不管是帮助别人,还是摆脱中庸的老好人姿态,充分地展现出自己的能力,魅力都要蹭蹭地往上升。");

}

if (answer1.toUpperCase().equals("B")) {

System.out.println("你的人品倒也不是差,毕竟思来想去,自己明明不算一个坏人,也没有怎么违反规定,也不会去害人!但是谁说无害的就是有功啦!有的时候消极的人生态度,也会扣掉人品的。正如现在,你还剩下一点儿的人品。如果想要人品快快地升上来,还是赶紧努力地向善,做好事,关爱他人,不再做一个消极的人,积攒自己的人品值吧!");

}

if (answer1.toUpperCase().equals("C")) {

System.out.println("有时候觉得很无奈,因为做任何事情都会觉得不顺利。有时候也疑惑,人家的事情总是做得那么好,可是为何自己的工作总是遭遇别人挑错呢?是应该好好反思一下了。有时候还会愤怒,为是为什么!其实原因很简单,就是因为你的人品很早就被败光了而已。从现在起,做任何事情,都不要心浮气躁,而是脚踏实地地干好,说话前要想一想,人品还是容易攒成的。");

}

System.out.println("2. 难得的连续假期,如果要去参加旅游活动,坐火车是你选择的交通工具,在漫长的旅程中,你会期望看到什么样的场景??");

System.out.println("A:隧道");

System.out.println("B:大海");

System.out.println("C:森林");

//输入A/B/C

String answer2 = input.nextLine();

//第二个题目

if (answer2.toUpperCase().equals("A")) {

System.out.println("当你一个人的时候,最想的就是睡觉,或是赶快找人玩乐,不过通常前面的成份高出狠多,这不代表你是一个狠懒的人,相反的你活动力惊人,只是想利用只有一个人的时间好好的休息一番,补足力气后再去玩。");

}

if (answer2.toUpperCase().equals("B")) {

System.out.println("当你一个人的时候,就是你最想好好一个人享受的时候,可能做个舒服的,或是放鬆的按摩,让自己的身体,有受到宠爱的感觉。");

}

if (answer2.toUpperCase().equals("C")) {

System.out.println("当你一个人的时候,你会想要利用这样的时间,好让自己有一个深度之旅,例如看看书或是到户外,藉由阅读或是参观,来增广见闻,继续充实自我。");

}

System.out.println("3. 请你准备一张纸、一支笔,在纸上画出你心中的太阳,你会把太阳画在纸上的哪一个方向呢??");

System.out.println("A:画在纸的左上方");

System.out.println("B:先画一座山,再把太阳画在山峦中");

System.out.println("C:画在纸的正中央");

//输入A/B/C

String answer3 = input.nextLine();

//第三个题目

if (answer3.toUpperCase().equals("A")) {

System.out.println("你的企图心强烈,有着乐观的态度,能够奋勇向前、不顾一切往前冲,但一定不可忽视前方的障碍,不要只会一个劲地冲。");

}

if (answer3.toUpperCase().equals("B")) {

System.out.println("你通常是个性情温和的人,比较缺乏安全感,但因为个性善良,常能得到他人的帮助,也就是说经常有贵人相助。");

}

if (answer3.toUpperCase().equals("C")) {

System.out.println("你的社交关系不太及格,是因为你对事物的是非有独特的见解及敏锐的判断,从不委屈自己做认为不合理的事,因此常给人不通情达理的感觉。所以不要太过于傲骨,也要适当地随波逐流。");

}

}

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值