CSE 114: September 23, 2016 by 11:59 pm Directions: Solve the following problems to the best of your ability.
This question has been answered
Question

Hello! I need help with my 100 level Java programming hw assignment.

I uploaded a pdf document, currently trying to work on part III but not sure how to get started. Thank you so much.

1 Attachment
CSE 114: Computer Science I Homework #3 Fall 2016 Assignment Due: September 23, 2016 by 11:59 pm Directions: Solve the following problems to the best of your ability. At the top of every file you write for this assignment, include the following information in a comment, with each item on a separate line: your first and last name as they appear in Blackboard your Stony Brook ID # the course number (CSE 114) the assignment name and number (Homework #3) ± Your files, Java classes, Java methods, etc. must be named and/or defined as proscribed below. Work that does not meet the program specifications (e.g., wrong file names or wrong method names) will not be graded. ± Upload your .java files to Blackboard by the indicated due date and time. Late work will not be accepted for grading. Work is late if it is submitted after the due date and time. ± Source code that does not compile will not be graded. ± Do not upload .class files. Such files be deleted. ± Do not combine your .java files into a zip file, rar file or other archive. Such files will be deleted. The grader will not unpack archive files to search for your source code. ± Do not include any package declarations in your source code unless directed to do so. Points may be deducted if your code must be edited to remove unnecessary package declarations. Assignment Objectives By the end of this assignment you should be able to design, code, run and test original Java programs featuring if-statements, string manipulation and basic output formatting. Part I: Time Flies When You’re Having Fun (3 points) Filename(s): PalindromicDate.java Write a program that prompts the user to enter, in this order , (i) a month (which could be in mixed upper- case/lowercase), (ii) a day and (iii) a four-digit year. Then, the program prints the date in a format MM/DD/YY , with exactly two digits each for the month, day and year. It also prints whether the reformatted date is a palin- drome. CSE 114 – Fall 2016 Homework #3 Page 1
Background image of page 1
± Note: Your program must check for bad input, such as an invalid month name, invalid day of the month, or invalid year (less than 1). In such cases, print only the error message “Bad input.” and produce no other output. Your program must handle leap years correctly. Below are sample runs of the program. ± Note: You must use these prompts and output messages exactly as written. The grading system will be looking for this wording. Enter month: FEBruary - Enter day: 18 - Enter year: 1979 - Reformatted date: 02/18/79 Palindrome? no Enter month: ocTobEr - Enter day: 11 - Enter year: 2001 - Reformatted date: 10/11/01 Palindrome? yes Enter month: APRIL - Enter day: 31 - Enter year: 2011 - Bad input. Part II: What A View! Wait, What’s That Smell? (3 points) Filename(s): StonyBrookResort.java The Stony Brook Resort and Manure Depot offers a vacation package as follows: The regular price for each adult is $125 per day. However, any days beyond the fifth day that an adult stays are 25% off the regular price. The price for each child is $75 per day regardless of how many days a group stays. A $150 discount is given if the group’s stay begins on a Monday and lasts no more than 4 days (including Monday itself). A service charge of 5% of the original, non-discounted cost is applied for groups of 6 or more. Write a program that prompts for, in this order , (i) the number of adults, (ii) the number of children, (iii) the length of the vacation in days, and (iv) the day of the week that the vacation begins (which might be given in mixed uppercase/lowercase). Then, print the following values – again, in this order – formatted as dollar amounts with two digits after the decimal point for cents: (i) the total before any discounts have been applied, (ii) discounts (if any), (iii) service charges (if any), and (iv) the grand total. CSE 114 – Fall 2016 Homework #3 Page 2
Background image of page 2

End of preview

Answered by Expert Tutors

facilisis. Pellentesque dapibus effi


congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui
Get unstuck

443,297 students got unstuck by Course
Hero in the last week

step by step solutions

Our Expert Tutors provide step by step solutions to help you excel in your courses