Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help generating a java program to run the following. I's using eclipse to generate the code. This what my assignment is requiring, please

I need help generating a java program to run the following. I's using eclipse to generate the code. This what my assignment is requiring, please see the attached jpg files!

Thank you!

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
If U. S. POL INGDALER _ Follow programming style guidelines 21 ( 20 points ) :" You will write Java code to solve a problem on the rental for the ski resort and the total charge You will write one Java class ( name it as SkiRental Calculation . java ) to accomplish this . Within the main method of as SkiRental Calculation . java , various code will be written to accomplish this . The input values need to be validated meaning , if no value is entered , or an empty space is entered , or an improper value is entered , the program will not crash . VY P Use different JOption Pane ( s ) to get the following input values 1 . The program first asks for the total number of ski customers , in order to create A number of THIS ski customers in an array . Use a JOption Pane to get this information . VICE For each ski customer , get the following pieces of information using different JOption Pane ( s ) : 2 . The name of the customer , which will hold both the first name and the last name of the ski customer . The acceptable value is John Doe . If no value is entered , or empty space is entered , or an invalid value is entered ( e .8 . abc ) , the program will not crash . There is no requirement to include the middle name , suffix , or prefix ; just first name and last name are sufficient to understand this programming concept . 3. Number of days . 4 . The number of the rental units for the ski customer . The acceptable values are 0 , 1 , 2 , and 3. If no value is entered , or empty space is entered , or an invalid value is entered ( e.g . abc ) , the program will not crash 5 . Whether the ski customer is a first time user . The acceptable values are Yes , and No . If no value is entered , or empty space is entered , or an invalid value is entered ( e .g . abc ) , the program will not crash 6 . Whether the ski customer has a discount coupon . The acceptable values are Yes , and No . IfNO value is entered , or empty space is entered , or an invalid value is entered ( e. 8 . abc ) , the program will not crash 7 . Whether the ski customer has a membership . The acceptable values are Yes , and No . If now value is entered , or empty space is entered , or an invalid value is entered ( e.8. abc ) , the program will not crash . Based on the above input values for each customer , use the table below to determine the total charge for each ski customer . Rate Category # Rental # Rental # Rental # Rental items = 0 items = ] items = 2 items = 3 Base rate per day . Multiply it by number of days $60 $1 10 $155 $190 Membership discount 5%/0 8%/0 First Time User discount 10% 12%0 Coupon discount $5 $10 Sale tax 7.5% adet the $ rate as / 5%/ as the same tax rate applies to all the customersFirst Time User discount 10% 12% Coupon discount $5 $10 Sale tax 7.5% In the program , hard code the tax rate as 7.5% , as the same tax rate applies to all the customers , irrespective of the total charge . For this , in your program , code a final instance variable SALES TAX PERCENTAGE and initialized to 7.5% .` The code will be written so that the total charge of one customer at a time is calculated . The total charge computed may have a decimal value . In the code , define two different arrays , one String array , " i.e . , namesArr" and one double array " i.e ., valuesArr" . The nameArr will hold the names of all the customers ( first name and the last name ) . The value Arr will hold the total charges of all the customers . The fixed size of this names Arr and the values Arr is the same as the number entered in the JOption Pane for the number of ski customers . String number ofski customers = ]Option Pane . show InputDialog ( " Enter the number of ski customers in whole number , e. 8 . . 3" ); int number ofCustomers = Integer . parse Int ( number OfSki Customers ) ; String [ ] namesArr = new String [ number Of Customers ] ; double [ ] valuesArr = new double [ number of Customers ] ; Where , I is the numeric value obtained from the JOption Pane on the number of the ski customers .MET EI Input Enter the number of ski customers in whole number, e.g., 3 mob 10 E OK Cancel arab to sodaun Write code to ask for the number of customers using JOptionPane. - ofdazedtotoro ead soiltofly It is important to understand that each element of namesArr matches with the corresponding element of valuesArr. In other words, populate both namesArr and valuesArr in a way so that the same value of the index (of the array) is used to populate both the arrays. If you do so, then the same index value will hold the matching customer information and the total charge. Following is a hint on how to do that. Loop through the number of customers and for the same index value, populate the elements of namesArr and valuesArr. I pilt el Oo2 bas evab To todmun odis al $ sis w ) 0912 - 08295 for (i=0; i

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

Students also viewed these Programming questions