联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2024-10-02 11:49


CSE114: Introduction to Object Oriented Programming

Lab 8

Instructions: Complete the steps below. Be sure to upload a copy of all your source code (.java)

files to the link on Brightspace by its deadline, so that you can receive credit for this lab. 1. Write a program to compute the following summation:

1+3+5+7+ 9 +11+?+95+97 3 5 7 9 11 13 97 99

2. Dates are printed in several common formats. Two of the more common formats are 04/25/1995 and April 25, 1995.

Write a program in Java that reads the date in the first format (e.g., 04/25/1995) and prints it in the second format (e.g., April 25, 1995).

3. The third person singular verb form in English is distinguished by the suffix -s, which is added to the stem of the so-called infinitive form. Verbs given in the infinitive form are typically written with “to” in front, as in “to sleep” or “to walk.” Often we simply add the letter “s” to the infinitive form (as in “sleep” → “sleeps” and “run” → “runs”), but in other cases, we need to modify the end of the word. Here are some simple rules we could consider:

· If the verb ends in y, remove the y and add ies. Example: “cry” becomes “cries”.

· If the verb ends in o, ch, s, sh, or x, add es. Example: “push” becomes “pushes”, and

“hiss” becomes “hisses”.

· Otherwise, just add s.

Write a program (VerbTense.java) that takes a verb in its infinitive form (but without “to”) as an argument and converts it to its third person singular verb form according to the rules above.

Here are some sample runs:

Enter a verb: wax waxes

Enter a verb: type types

Enter a verb: go goes

Enter a verb: play plaies

Grading Guidelines: This lab is graded on a scale of 0-3 points, assigned as follows:

CSE114: Introduction to Object Oriented Programming

· 0 - The student did not attend the lab,

· 3 - The solutions are complete OR the student spent the entire lab solving the required lab problems

(in this case, the students may not arrive at the lab after the lab started and may not leave until the lab ends).


相关文章

【上一篇】:到头了
【下一篇】:没有了

版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp