Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use beginner java coding, follow directions and have code look like the example. Thank you! Suppose you 've started Subprime, a competitor to Amazon

Please use beginner java coding, follow directions and have code look like the example. Thank you! image text in transcribed
image text in transcribed
image text in transcribed
Suppose you 've started Subprime, a competitor to Amazon Prime that otfers half the henetits for double the price. Sounds like a surefire formula for suecess! Amazon Prime costs $119 per yer. . Subprime's price is $238 per year As part of your customer service efforts, you offer prorated refunds of the aunal priee wheu custoners caucel their Subprime service. Your policy is that all the remainiug days of the year (excluding the day of cancellation) are included in the refund. For example, a customer who cancels on Jan. 1. 2019 have 364 unused days and thus get a refund of 364/365 x $238 $237.35. A custoex who caucels on Dec. 31. 2019 would have 0 unused days and thus get a refund of 0/365 x s238.00. You dont believe in holiday cheer.) the calculations above will be a little off next year since 2020 is a leap year and has one extra day. Uh oh. Let's tackle this problem with METHOD POWERTM Within the 1900 folder ou your desktop. create a new folder nam your L methods. Note that user input shoul ed LabLastnaneFiratnane. Within ab6 folder, create a new class named RefundsGalore java. Within that class, write the following d be read only in the main method at the end! The other methods get their information from their parameters. 1. (2 pts) public static boolean isLeapYear (int year) This method should return whether the year paraueter is a leap year. Leap years are years tha are divisible by 4, except those that are also divisible by 100. But there's also au exeeption to the cxception: ycars that arc divisible by 400 are lcap years. Here are some example arguments for the isLeapYear metlod and their cxpected returu values Argument Return Valuc 2019 2020 2100 2400 false true alsc true 2. (3 pta) public static int daysInMonth Cint sonth. nt year This method should return the number of days in the specifed r previntuts a assuue the month parameter needed month of the specified year. You that April. June. Septenbet. aud Novesulber luave 30 days leap year, or 28 days otherwise. Al other months have for the daysInMonth method and their expected return 31 dave. Here nre so values inents 19) (2, 2020) (11. 2019) 12. 2020 29 public static double fractionorYearRemainingCin thshould return the fraction of the year remnini t month, int day. int year) (express a decinnl) starting Th frous the specified month aud the startin nd year. Call your previously writtcu methods as uec methoo tween 1-12, and the day parameter luus a valid value for the givei month hod aud their expected day. excluding the startiug day itself. You enu nsstune he mont Here are some example arguments for the fractionofYearRemaining net rcturn valucs: olcs Arguments Ou Jan. 1, there are 364 days renaining 364/365 0.9972602739726028 (1. 1. 2010) | 0.9072602739726028 On Dec. 31, there are 0 days remaiuing 0/365 0.0 2020 is a leap year, so there nre 366 total days On Jan. 1, there are 365 days remaining 365/3660.9972677595628415 202015 'Tapyoar.sc,ThereareTi tom any (12. 31. 2019) 0.0 (1, 1, 2020) 0.9972677595628415 On Apr. 3, 31 + 29 + 31 + 3 = 91 days haw. passed. so there arc 366 94 272 days remaining. 272/3660.7431693980071039 (4. 3, 2020)07431693989071039 4. (5 pts) public static void main (String args) Finally, the main method shoul d allow the user to euter three inputs: the month. day. and year of the cancellation date. Call your previously written methods to coupute aud show the amount of Your main method should also include a loop that checks the user iuput to ensure it.'s valid. Valid tho month and year. (For cxample, 29 is not a valid day if the month is Fobruary aud it's uot a the prorated refund for that date. input means the month is between 1-12. the year is at least 2019. and the day is cousistent leap year.) If the user enters an invalid date, sliow au error message aud ask him/er to try agai. This should be done as many times as necessary an example of what your cosmpleted program might lonk like whea yon run i. what you type in as the progra nina pen did you cancel your Subprise service? Month: Day: 22 Year: 2018 sorry, 2/29/2019 doesn't appear to be a valid date. Care to try again Month: 2 Day: 29 Year: 2016 Sorry, 2/29/2016 doesn't appear to be a valid date Month: Day:3 Care to try again Year: 2020 OK, you'll b Subprime disappointing customers since 2019 e isued a prorated refund of $176.8743 1693989072 Submission contains all your ja appropriate dropbox folder in your Courseware lab section va files from tis assignment. Zip the Lab6 folder Make sure that your Lab6 folder contains all your and submit that zip file to the dropbox

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems X Special Issue On Database And Expert Systems Applications Lncs 8220

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2013th Edition

3642412203, 978-3642412202

More Books

Students also viewed these Databases questions

Question

recognise typical interviewer errors and explain how to avoid them

Answered: 1 week ago

Question

identify and evaluate a range of recruitment and selection methods

Answered: 1 week ago

Question

understand the role of competencies and a competency framework

Answered: 1 week ago