专业编程基础技术教程

网站首页 > 基础教程 正文

小宗学编程(十三)switch-case练习题

ccvgpt 2024-08-02 11:51:44 基础教程 14 ℃

switch-case练习题

小宗学编程(十三)switch-case练习题

分享兴趣,传播快乐,增长见闻,留下美好!亲爱的您,这里是LearningYard新学苑。今天小编为大家带来“switch-case练习题”,欢迎您的访问。

Share interests, spread happiness, increase knowledge, and leave good news! Dear you, this is the new LearningYard Academy. Today, Xiaobian brings you "switch-case practice questions", welcome your visit.


Java学习入门——switch-case练习题

switch-case练习题

1使用switch把小写类型的char型转为大写。只转换a,b,c,d,e. 其它的输出"other'


1Use switch to convert lowercase char types to uppercase. Convert only a,b,c,d,e. Other output "other"


2.对学生成绩大于60分的,输出“合格”。低于60分的,输出“不合格”。

说明:在switch-case中当部分case执行语句相同的情况下,可以考虑合并



2. For students whose scores are greater than 60 points, the output will be "qualified". If the score is lower than 60, the output is "unqualified".


Note: In switch-case, when part of the case execution statements are the same, you can consider merging

3.根据用于指定月份,打印该月份所属的季节。3.4.5春季6.7.8夏季9.10.11 秋季12.1.2冬季



3. According to the specified month, print the season to which the month belongs. 3.4.5 Spring 6.7.8 Summer 9.10.11 Autumn 12.1.2 Winter



4.编写程序:从健盘上输入2019年的month和day要求通过程序输出输入的日期为2019年的第几天。

Write a program: Input the month and day of 2019 from the keyboard and require that the input date through the program output be the day of 2019.

今天的分享就到这里了。如果您对今天的文章有独特的想法,欢迎给我们留言,让我们相约明天,祝您今天过得开心快乐!

That's it for today's sharing. If you have a unique idea about today’s article, Welcome to leave us a message. Let us meet tomorrow, I wish you a happy day today!


END

翻译:来自Googl翻译

本文由LearningYard新学苑原创,欢迎关注,带你一起长知识。

排版:谢宗佑

文字:谢宗佑

审核:李小雪

最近发表
标签列表