Object Oriented Programming with data type class and driver class Selection Statements

COSC 1437 – LAB4 TITLE Object Oriented Programming with data type class and driver class Selection Statements – Sale Employee Information and Sale Employee Salary HOW TO DO LAB HOW TO DO PART 1 Use a Word document named SP2024_LAB4PART1_yourLastName to answers questions LAB4 PART1 REQUIREMENT Use the word document SP2024_LAB4PART1_yourLastName to write the answers to the following questions: QUESTION 1: Suppose that we have the following piece of the code in main() float floatNumber1, floatNumber2; Scanner keyboard = new Scanner(System.in); System.out.println(“Enter a decimal number: “); floatNumber1 = keyboard.nextFloat(); Continue providing an if STATEMENT such that the floatNumber2 will be 32.25 when floatNumber1 is a number less than 64.50 QUESTION 2: Suppose that we have the following piece of the code in main() float theFirst, theSecond; Scanner keyboard = new Scanner(System.in); System.out.println(“Enter a decimal number: “); theFirst = keyboard.nextFloat(); Continue providing an if..else STATEMENT such that theSecond will be 32.25 when theFirst is a number less than or equal to 128.29; otherwise theSecond will be 64.125 QUESTION 3: Using the following chart, write an if..else..if STATEMENT to select the rate depending on the sale amount listed on the left column: Sale Amount Greater than $16000 Greater than $12000 and up to $16000 Greater than 0 and up to $12000 0 Bonus Rate 3.19% 2.39% 1.59% 0% QUESTION 4: Suppose we have the following lines of code in main() int num1, num2; Scanner keyboard = new Scanner(System.in); System.out.println(“Enter a number: “); number1 = keyboard.nextInt(); System.out.println(“Enter another number: “); number2 = keyboard.nextInt(); Continue providing a NESTED IF STATEMENT that performs the following When number1 is greater than 300 and number2 is less than 600 And when number2 is less than number1 then display the message: “number1 and number2 are greater than 600” QUESTION 5: Suppose we have the following lines of code in main() int option; Scanner keyboard = new Scanner(System.in); System.out.println( “MENU OF TASKSn” + “1. Task 1n” + “2. Task 2n” + “3. Task 3n” + “0. Exit.n”; + “Enter a number from 1 to 3 to select a task or 0 to Exit”); task = keyboard.nextInt(); if (task == 1) { System.out.println(“You select task 1”); } else if (task == 2 || task == 3) { System.out.println(“You select task 2 and task 3” ); } else if (task == 0) { System.out.println( “Your select EXIT.”); } else { System.out.println(“Invalid task”); } Question: Convert the above if..else..if STATEMENT into a SWITCH STATEMENT HOW TO DO PART 2 We do the lab with the following steps: STEP1: CREATE THE UML FOR THE DATATYPE CLASS, THE PSEUDO-CODE FOR THE DRIVER CLASS AND LEARN JAVA SYNTAX BEFORE WRITING THE CODE 1. Read the lab requirement then figuring out the following to create UML of data type class *name of the object *data members to describe the object. *list of tasks that are described as methods performing to solve the problems of the requirement. 2. Based on the requirements, build the pseudo-code for main() After reading enough input, create the object, then access the methods to provide the required output STEP2: CREATE THE JAVA PROJECT AND WRITE THE JAVA CODE *From now and on yourLastName will be changed to your last name *Your program should change Martinez to your last name *Change LUIZ MARTINEZ to your full name *write the file name as the first comment line at the top of program. The java comment line starting with // as the comment line in java *After running your program successfully, take the picture of the output window and paste the picture at the bottom of the document having pseudo-code to turn in 1. Start editor eclipse, create the project → write the project name Project name of the Part 2: SP2024_LAB4PART2_yourLastName 2. Add the class with the class name. Class name will be the file name. Part2 : add the datatype class: SP2024_SaleEmployee_yourLastName add the driver class: SP2024_SaleEmployeeSalary_yourLastName STEP3: COMPILE THE CODE AND FIX THE ERRORS STEP4: RUN THE PROGRAM *With eclipse, the project will be automatically compiled, creates the object file .class then run to provide the output on the Console window if the code with no syntax errors. TO KNOW HOW TO WRITE THE CODE OF A DATA TYPE CLASS AND HOW TO CREATE AN OBJECT AND USE THE OBJECT TO ACCESS THE METHODS OF DATA TYPE CLASS IN THE DRIVER CLASS; YOU CAN GET HELP BY READING THE TOPICS RELATING TO THESE IN “HOW TO DO LAB” AND FOLLOW THE INSTRUCTION IN THIS LAB. FOR ANY QUESTIONS, CONTACT VIA EMAIL LiemLe@dcccd.edu OR JOINT TO OFFICE HOUR TO GET HELP. LAB4 PART2 REQUIREMENT Provide UML , the pseudo-code, and the java project SP2024_LAB4PART2_yourLastName to help a company to calculate the salary of Sale Employee at the end of the month in the Object Oriented Programming. -The UML will be created for the Datatype class -The pseudo-code will be created for the main() of the Driver class DATA TYPE CLASS Class SP2024_SaleEmployeeInfo_yourLastName Provide the UML and the data type class SP2024_SaleEmployeeInfo_yourLastName that holds the following information of a Sale Employee about: –name (string), –employee id (string), –sale amount (float) that is the total of sale money the Sale Employee made in the month –base salary(float) –commission rate (float) –bonus rate (float) Also, the class SP2024_SaleEmployeeInfo_yourLastName has *no-argument constructor, *parameterized constructor *the method to calculate the commission amount *the method to calculate the bonus amount The commission amount and the bonus amount should be calculated based on the information in the following table: Sale amount Commission Rate Bonus Rate If sale amount is greater than or equal to $15000 3.19% On the sale 1.89% On any sale amount beyond $8000 If sale amount is greater than or equal to $12000.00 and less than $15000.00 2.39% On the sale 1.59% On any sale amount beyond $8000 If sale amount is greater than $8,000 and less than $12000.00 1.59% On the sale 1.29% On any sale amount beyond $8000 If sale amount is less than $8000.00 1.59% On the sale 0 *the method to calculate the salary Salary = base salary + commission amount + bonus amount *The method toString() to create the output string as below: DRIVER CLASS Based on the pseudo-code provide the code in main() First, the java application should read input from the keyboard for the information of the sale employee about employee name, employee id, base salary and sale amount making in month from the keyboard. Then, create the object of the data type class SP2024_SaleEmployeeInfo_yourLastName and use the object to access the methods toString() to display on the screen the monthly salary split in the required format. HOW TO TURN IN THE LAB ATTENTION: Compress each project folder into a file .zip or a file .rar. that includes source files and execute files. -If you do not have the source file and execute file, your lab gets 0 points -If you do not provide file .class of the part, you only have half of the max score of the part You should turn in the following files: 1.LAB4PART1_Answers_yourLastName.docx 2.Lab4_pseudoCode_yourLastName.docx (including UML, Pseudo-code, and the output pictures part2) 3.SP2024_LAB4PART2_yourLastName.zip (including the following files: * SP2024_SaleEmployeeInfo_yourLastName.java * SP2024_SaleEmployeeInfo_yourLastName.class * SP2024_SaleEmployeeSalary_yourLastName.java * SP2024_SaleEmployeeSalary_yourLastName.class HOW TO GRADE THE LAB Items Turn in on time Score 3 Items Score PART1 Question 1 1 Question 2 1 Question 3 2 Question 4 1 Question 5 2 PART2 Submit all files requested 1 Pseudo-code(main) – UML (data type class) -output pictures 2 Data type class Define data members 1 No argument constructor – parameterized constructor 2 Method to calculate commission 1 Method to calculate bonus 2 Method to calculate total salary in month 1 Method toString() display the salary slip as requested format 2 Driver class Read input 1 Create the object of data type class 1 Display the salary slip by calling the method toString() 1 Write the comment – file name at the top of file 2 Compile success – qualified all the requirements 3 Total` 30

Object Oriented Programming with data type class and driver class Selection Statements

We offer the best custom writing paper services. We have answered this question before and we can also do it for you.

GET STARTED TODAY AND GET A 20% DISCOUNT coupon code DISC20

We offer the bestcustom writing paper services. We have done this question before, we can also do it for you.

Why Choose Us

  • 100% non-plagiarized Papers
  • 24/7 /365 Service Available
  • Affordable Prices
  • Any Paper, Urgency, and Subject
  • Will complete your papers in 6 hours
  • On-time Delivery
  • Money-back and Privacy guarantees
  • Unlimited Amendments upon request
  • Satisfaction guarantee

How it Works

  • Click on the “Place Order” tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
  • Fill in your paper’s requirements in the "PAPER DETAILS" section.
  • Fill in your paper’s academic level, deadline, and the required number of pages from the drop-down menus.
  • Click “CREATE ACCOUNT & SIGN IN” to enter your registration details and get an account with us for record-keeping and then, click on “PROCEED TO CHECKOUT” at the bottom of the page.
  • From there, the payment sections will show, follow the guided payment process and your order will be available for our writing team to work on it.