CSE114: Introduction to Object Oriented Programming


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).
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值