LAB5 PART2 REQUIREMENT IF YOU DO NOT HAVE THE UML and PSEUDO-CODE,…
Question Answered step-by-step LAB5 PART2 REQUIREMENT IF YOU DO NOT HAVE THE UML and PSEUDO-CODE,… LAB5 PART2 REQUIREMENTIF YOU DO NOT HAVE THE UML and PSEUDO-CODE, YOU HAVE TO READ THE BELOW REQUIREMENT THEN CREATE UML OF DATA TYPE CLASS AND WRITE THE PSEUDO-CODE BEFORE WRITING THE CODE DATA TYPE CLASSClass SP2022_CreditCardAccount_yourLastNameThis class SP2022_CreditCardAccount that holds the information of one credit card about credit card number, csv number, name, available credit, current balance, last statement balance, interest rate. -The credit card number (String) is generated as random number with 16 digits (SEE HOW TO DO LAB)-The csv number (String) is generated as random number with 3 digits -The name is read from the keyboard-available amount is set to CREDIT_LINE that is a constant passed from the keyboard-current balance is initialized to 0-statement balance is initialized to 0-interest rate is set to INTEREST_RATE that is a constant passed from the keyboard Also, the class includes some methods to do the following tasks: open new credit card account, verify account, verify csv, process one transaction, read interest rate, read credit line, payment process. Method verifyAccountNumber-the method accepts the account number that is passed from the driver class-compare the account number to credit card numberIf they are the same return true; otherwise return false Method verifyCSV-the method accepts the csv number that is passed from the driver class-compare the csv number to csvIf they are the same return true; otherwise return false Method generateCurrentDateimport java.text.SimpleDateFormat; import java.util.Date; public String getCurrentDate() { SimpleDateFormat formatter = new SimpleDateFormat(“MM/dd/yyyy”); Date date = new Date(); return formatter.format(date); } Method generateCreditCardNumberimport java.util.Random; public static String generateCreditCardNumber() { Random rand = new Random(); int value1 = rand.nextInt(9000) + 1000; int value2 = rand.nextInt(9000) + 1000; int value3 = rand.nextInt(9000) + 1000; int value4 = rand.nextInt(9000) + 1000; return String.valueOf(value1) + String.valueOf(value2) + String.valueOf(value3) + String.valueOf(value4); } Method OPEN NEW CREDIT CARD ACCOUNT: display the following output File: SP2022_CreditCardService_Martinez.javaOPEN NEW CREDIT CARD ACCOUNT – LUIS MARTINEZ——————————————————Name: Mary LaneCard Number: 6124280537103054csv: 265——————————————————Available Amount: 5000.00Current Balance: 0.00Statement Balance: 0.00Interest Rate: 14.29% Method PROCESS ONE TRANSACTION-Method must accept the transaction amount that is passed from the keyboard read from the driver class.-if the transaction amount is greater than available amount then display message “Invalid transaction amount”Otherwise, calculate: Available amount = available amount – amount Current balance = current balance + amount -Display the following output: File: SP2022_CreditCardService_Martinez.javaPROCESS TRANSACTION CREDIT CARD ACCOUNT – LUIS MARTINEZ——————————————————Name: Mary LaneCard Number: 6124280537103054——————————————————Transaction Amount: 624.36Current Balance: 624.36Available Amount: 4375.64 File: SP2022_CreditCardService_Martinez.javaPROCESS TRANSACTION CREDIT CARD ACCOUNT – LUIS MARTINEZ——————————————————Name: Mary LaneCard Number: 6124280537103054——————————————————Transaction Amount: 728.28Current Balance: 1352.64Available Amount: 3647.36 Method READ CURRENT BALANCE-Display the following output: File: SP2022_CreditCardService_Martinez.javaCREDIT CARD SERVICE – LUIS MARTINEZ——————————————————Name: Mary LaneCard Number: 6124280537103054Current Balance: 1352.64 Method READ INTEREST RATE-Display the following output: File: SP2022_CreditCardService_Martinez.javaCREDIT CARD SERVICE – LUIS MARTINEZ——————————————————Name: Mary LaneCard Number: 6124280537103054Interest Rate: 14.29% Method PRINT STATEMENT-Display the following output: File: SP2022_CreditCardService_Martinez.javaCREDIT CARD SERVICE STATEMENT – LUIS MARTINEZDate: 03/06/2022——————————————————Name: Mary LaneCard Number: 6124280537103054——————————————————Available Amount: 3647.36Statement Balance: 1352.64 Method Payment Process-The method must accept the payment amount that passed from the driver class-calculate the following: The balance left = statement amount – payment amount Interest mount = balance left * interest rate / 100 The current balance = balance left + interest amount Available amount = available amount + payment amount File: SP2022_CreditCardService_Martinez.javaCREDIT CARD PAYMENT PROCESS – LUIS MARTINEZDate: 03/06/2022——————————————————Name: Mary LaneCard Number: 6124280537103054——————————————————Statement Amount: 1352.64Payment Amount: 800.00Interest Amount: 78.97Current Balance: 631.61Available Amount: 4447.36 DRIVER CLASSClass SP2022_CreditCardService_yourLastNameDeclare float constant for CREDIT_LINE = 5000.00 and INTEREST_RATE = 14.29 First the application displays the following menu to allow users to select a task.SP2022_CreditCardService_Martinez.javaCREDIT CARD SERVICE MENU – LUIS MARTINEZ——————————————– 1.Open new credit card account2.Process One transaction3.Read Current Balance4.Read Interest Rate5.Payment process 0.Exit Read the number from users.If users select the task 2 to task 5 before selecting task 1, the application must display the message “You must select 1 to open credit account first.” Then redisplay the menu to allow users to open account.” TASK 1. OPEN NEW CREDIT CARD ACCOUNT-Read from the keyboard about customer name (String)-Create credit card account object with the name, CREDIT_LINE, INTEREST_RATE.-Use the object to access the method to open new credit card account of the class SP2022_CreditCardAccount_yourLastName to display the information of the new account. TASK 2. PROCESS ONE TRANSACTION-Display the message and read from the keyboard the credit card number-Use the object created at Task1, to access method verifyAccountNumber() of class SP2022_CreditCardAccount_yourLastName-If method verifyAccountNumber() return false; display message “Invalid Credit Card Number”Otherwise, display message to ask and read the transaction amount and csv number-Use the object to access method verifyCSV of class SP2022_CreditCardAccount_yourLastName-if method verifyCSV return false, display message “Invalid CSV”Otherwise, use the object to access the method of class SP2022_CreditCardAccount_yourLastName to process one transaction TASK 3. READ CURRENT BALANCE-Display the message and read from the keyboard the credit card number-Use the object created at Task1, to access method verifyAccountNumber() of class SP2022_CreditCardAccount_yourLastName-If method verifyAccountNumber() return false; display message “Invalid Credit Card Number”Otherwise, use object to access the method of class SP2022_CreditCardAccount_yourLastName to display the current balance TASK 4. READ INTEREST RATE:-Display the message and read from the keyboard the credit card number-Use the object created at Task1, to access method verifyAccountNumber() of class SP2022_CreditCardAccount_yourLastName -If method verifyAccountNumber() return false; display message “Invalid Credit Card Number”Otherwise, use object to access the method of class SP2022_CreditCardAccount_yourLastName to display the interest rate TASK 5. PRINT STATEMENT-Display the message and read from the keyboard the credit card number-Use the object created at Task1, to access method verifyAccountNumber() of class SP2022_CreditCardAccount_yourLastName-If method verifyAccountNumber() return false; display message “Invalid Credit Card Number”Otherwise, use object to access the method of class SP2022_CreditCardAccount_yourLastName to display the statement. TASK 6. PAYMENT PROCESS-Display the message and read from the keyboard the credit card number-Use the object created at Task1, to access method verifyAccountNumber() of class SP2022_CreditCardAccount_yourLastName-If method verifyAccountNumber() return false; display message “Invalid Credit Card Number”Otherwise, use object to access the method of class SP2022_CreditCardAccount_yourLastName to process the payment. Computer Science Engineering & Technology Java Programming COSC 1437 Share QuestionEmailCopy link Comments (0)


