Write a method that calculates the number of days between two dates given in DD-MM-YYYY format....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a method that calculates the number of days between two dates given in DD-MM-YYYY format. Consider number of days in a month as 30, and number of days in a year as 360. Your solution must be written in the calculateDaysBetween method given to you in the java file accompanying this assignment. parseDate method is written for you to be able to access the day, month, and year values. You can access the values by indexing the arrays. (parsedDate [0] for days, parsedDate [1] for months etc.). Explain your solution with comments. Problem II shopping Cart Price (30 points) Calculate the total price of a shopping cart which may contain the following items: Coke: 12.32 TL • Chips: 19.98 TL Chocolate: 7.12 TL Popcorn: 5.67 TL Shopping cart will be an array of strings which may contain the same item multiple times, for example ["coke", "chips", "chips", "popcorn"]. In this case total price that you need to return would be 57.95. Problem III shoppingCart Percentage (30 points) Using the shoppingCartPrice method, create a method that will show a graph of percentage of money you have spent on each item. Round the percentages into inte- gers (convert double values to int). For example if the input to the method is ["coke", "chips", "chips", "popcorn"], total price is 57.95. Percentages would be 21 for coke, 68 for chips and 0 for the popcorn. Then the graph would look like: ***********... (until 100) ************************* popcorn coke ******** chips Number of stars for each item should be equal to the percentage. Number of stars at the top line should be 91 (excluding multiples of 10), and should represent multiples of 10 as | symbol. Write a method that calculates the number of days between two dates given in DD-MM-YYYY format. Consider number of days in a month as 30, and number of days in a year as 360. Your solution must be written in the calculateDaysBetween method given to you in the java file accompanying this assignment. parseDate method is written for you to be able to access the day, month, and year values. You can access the values by indexing the arrays. (parsedDate [0] for days, parsedDate [1] for months etc.). Explain your solution with comments. Problem II shopping Cart Price (30 points) Calculate the total price of a shopping cart which may contain the following items: Coke: 12.32 TL • Chips: 19.98 TL Chocolate: 7.12 TL Popcorn: 5.67 TL Shopping cart will be an array of strings which may contain the same item multiple times, for example ["coke", "chips", "chips", "popcorn"]. In this case total price that you need to return would be 57.95. Problem III shoppingCart Percentage (30 points) Using the shoppingCartPrice method, create a method that will show a graph of percentage of money you have spent on each item. Round the percentages into inte- gers (convert double values to int). For example if the input to the method is ["coke", "chips", "chips", "popcorn"], total price is 57.95. Percentages would be 21 for coke, 68 for chips and 0 for the popcorn. Then the graph would look like: ***********... (until 100) ************************* popcorn coke ******** chips Number of stars for each item should be equal to the percentage. Number of stars at the top line should be 91 (excluding multiples of 10), and should represent multiples of 10 as | symbol.
Expert Answer:
Answer rating: 100% (QA)
Heres a Java code for the calculateDaysBetween method and the two additional methods shoppingCartPrice and shoppingCartPercentage Ill include comments ... View the full answer
Related Book For
Financial Accounting and Reporting a Global Perspective
ISBN: 978-1408076866
4th edition
Authors: Michel Lebas, Herve Stolowy, Yuan Ding
Posted Date:
Students also viewed these programming questions
-
Social Security's long term solvency problems. Explain these problems and evaluate the possible solutions to this problem and defend one or more of these as you come up with your own plan to fix this...
-
The Julian calendar was a reform of the Roman calendar introduced by Julius Caesar in 46 BC (708 AUC). It took effect in 45 BC (709AUC). It was the predominant calendar in most of Europe, and in...
-
In cell E14, enter a date function that calculates the number of days between the Initial Deadline (cell E10) and the Date Received for the first student (D14). Use mixed and relative references...
-
A 0.20-m-diameter, thin-walled steel pipe is used to transport saturated steam at a pressure of 20 bars in a room for which the air temperature is 25C and the convection heat transfer coefficient at...
-
An electron and a proton are released from rest in space, far from any other objects. The particles move toward each other, due to their mutual electrical attraction. (a) When they meet, is the...
-
The American Self-Help Clearinghouse What is a psychological, personal, professional, or health problem that you have seen in a family member or friend? After you have chosen one of these problems,...
-
Jack Swanson gave a creditor a 90-day, eight percent note payable for \(\$ 7,200\) on December 16 . What adjusting entry should Swanson make on December 31 ?
-
(EPS with Warrants) Worth Corporation earned $260,000 during a period when it had an average of 100,000 shares of common stock outstanding. The common stock sold at an average market price of $15 per...
-
Income Statement Revenue Bikes Sold Average Price per Bike Total Revenue Variable Expenses Break-Even Analysis Bikes Sold Total Revenue Total Expenses Net Income 330 $890 $293,700 100 200 300 400...
-
At the beginning of the current period, Coe Ltd. had balances in Accounts Receivable of 200,000 and in Allowance for Doubtful Accounts of 9,000 (credit). During the period, it had net credit sales of...
-
New Orleans Beer, Inc. a corporation which is incorporated in Louisiana is a __________________corporation as it pertains to the State of Texas. a Native b Domestic c Alien d Foreign
-
Use the Edgeworth Box below (FGS Figure 18.1) to help answer the following four questions: Food Fo FB OA Abner E C B UBB MB -Medicine UAB Contract curve Belinda Mo
-
Use the FY2022-2023 info to calculate, for each port-of-call as well as the "grand total": TEUs, Revenue, Ratio of 20':40' containers, Total weight, etc. You may want to comment on whether some...
-
A transformer is created with 60 coils in its primary coil and 10 in its secondary coil. a)Is it a step-up or step-down transformer? b)If are put into the primary coil, what voltage is induced in the...
-
What are the prevailing paradigms and emerging trends in organizational design, and how do they reflect evolving perspectives on employee empowerment, organizational culture, and strategic alignment ?
-
What are the emerging trends observed in today's Organization Behaviour? Explain any two. Answer for each trend in three to four sentences.
-
A stock has a volatility of 35%. A call option with an exercise price of $50 has an expiration of 6 months. The risk-free rate is 5 percent. Please find the call and put price of assuming stock price...
-
The following data are supplied for the common stocks of Nikola Corporation, Tesla, Inc. and General Motors: Nikola Corp (NKLA) Tesla Inc. (TSLA) Close Price ($) Close Price ($) 67.53 30.00 40.81...
-
During year X1, the Nielsen Company reported sales for 2,400 CU and total expenses for 1,800 CU. It has no preexisting deferred tax liability or tax asset. The following information is provided in...
-
Unilever is a Anglo-Dutch supplier of fast moving consumer goods. The two parent companies, Unilever N.V. and Unilever PLC, together with their group companies, operate as Unilever Group. The...
-
The sale by a shareholder of shares of a company to another shareholder should be recorded by the company (a) True (b) False
-
What is asymmetric information?
-
Public goods, like national defense, are usually funded through government because a. no one cares about them because they are public. b. it is prohibitively difficult to withhold national defense...
-
Adverse selection refers to a. the phenomenon that occurs when one party in an exchange takes advantage of knowing more than another party. b. the tendency for individuals to alter their behavior...
Study smarter with the SolutionInn App