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...
-
The last department in a production process shows the following information at the end of the period: Beginning work in process: 25,000 Started into Production: 200,000 Ending Work in Process: 50,000...
-
Certain item descriptions and amounts are missing from the monthly schedule of cost of goods manufactured and income statement of Charlie Manufacturing Company. Fill in the blanks with the missing...
-
Water flows steadily down the inclined pipe as indicated in Fig P5.124. Determine the following: (a) the difference in pressure \(p_{1}-p_{2}\), (b) the loss between sections (1) and (2), (c) the net...
-
The inventory of Wei Company on December 31, 2014, consists of the following items. aPart No. 21 is obsolete and has a realizable value of $0.20 each as scrap. Instructions (a) Determine the...
-
What does the Performance Management (PM) process consist of? On what motivational theory is the PM process based on?
-
A major credit card company (call it MasterDebt) receives checks from all different regions in the country on a daily basis. Once these checks are mailed, the time a check spends in the mail (called...
-
Q10. The peak temperature T, in degrees Kelvin, on a July day in Ooty is a Gaussian random variable with a variance of 289. With probability 3/4, the temperature T exceeds 305 degrees. a. What is...
-
What kinds of legal issues do you think stem cell research and genetic therapies will present in the coming years?
-
In todays economy, what are some examples of intrastate commerce? In other words, what business does not affect interstate commerce?
-
Given the information in Problem 28-17, how much more or less do the firms in this industry spend, in total, on the labor employed each hour as a consequence of establishment of the union wage W =...
-
An entity prepares financial statements to 31 December each year. The following events occurred-after 31 December 2009 but before the financial statements for the year ended 31 December 2009 were...
-
John Timms is the sole owner of Sunshine Wholesale Traders, a company which buys fruit from farmers and sells it to supermarkets. All goods are collected from farms and delivered to supermarkets on...
-
4) For the following reaction: Heat+CaCO3 (s) + CO2 (g) + HO (1) Cat2 (aq) + 2 HCO3 (aq)
-
Chloroplasts are illuminated until the levels of the Calvin cycle intermediates reach a steady state. The light is then turned off. How does the level of RuBP vary after this point?
-
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
-
Eq. 7.36a is written for the conservation of momentum in y direction. Obtain Eq. 7.36-b wherein the stream function is independent variable. Eq. 7.36(a,b) y - v v +(1-y/R)v- + momentum: u u R-y + R P...
-
Using Maslen method, find the approximate value of pressure and density at the junction of the sphere and the cone of Problem 7.29 at Mach number 8. Problem 7.29 An empirical way to determine shock...
-
Show that the derivative of the boundary layer edge velocity is given by Eq. 7.64 for the figure given below. Eq. 7.64 M>>1 Ue dx R dy/dx = 1/R
Study smarter with the SolutionInn App