Question: 1) Write a method that is passed in a String and returns a new String with every pair of characters reversed. If there are an

1) Write a method that is passed in a String and returns a new String with every pair of characters reversed. If there are an odd number of characters, the last character is unchanged. For example, person becomes epsrno the become hte

2) Write a method that is passed in a stock price and a stock quantity. Print what to sell based on the following rules

if stock price is over $100 sell all

Otherwise, sell half of stock only if quantity is 1000 or more, otherwise sell 10% of the stock

3) Write a method named daysInMonth that accepts a month (an integer between 1 and 12) as a parameter and returns the number of days in that month in this year. For example, the call daysInMonth(9) would return 30 because September has 30 days. Assume that the code is not being run during a leap year (that February always has 28 days).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!