Urgenthomework logo
UrgentHomeWork
Live chat

Loading..

CPT 307 Week 1 Assignment

CPT 307: Data Structure & Algorithms

I had to do a lot of research for this program. This is my first time attempting to use Java. I started by googling and using YouTube to figure out how to get a user’s input. This is where I found the java.util.Scanner. While doing my research the Scanner is a class inside the java.util package, so I import it into my program. Since attributes and behaviors make up a class, the attributes of a class are taking the input of the user. I then define the “Calculate Pay” class. This is where I start using the attributes of the Scanner class and assigning the user’s input to various variables. From there I used the if and elseif conditional statements. I used these to separate employees that worked 40 hours or less and employees that work over 40 hours. For figuring deductions, net and gross pay, I used basic arithmetic operations that were in the instructions for this assignment. For problems that dealt with pay I used the Double datatype to get decimals places. For hours, I used the Integer data type since I would be using whole numbers. May be to get more accurate you could use the Double datatype to get when employees worked half hours, like 37.5 or 65.5 hours. Once I got all the information I need needed, I then output all necessary information using the System.out.println statement.

CPT 307 Week 1 Assignment Image 1CPT 307 Week 1 Assignment Image 2CPT 307 Week 1 Assignment Image 3CPT 307 Week 1 Assignment Image 4

OUTPUT:

CPT 307 Week 1 Assignment Image 5CPT 307 Week 1 Assignment Image 6

Resources

  • 24 x 7 Availability.
  • Trained and Certified Experts.
  • Deadline Guaranteed.
  • Plagiarism Free.
  • Privacy Guaranteed.
  • Free download.
  • Online help for all project.
  • Homework Help Services

Testimonials

Urgenthomework helped me with finance homework problems and taught math portion of my course as well. Initially, I used a tutor that taught me math course I felt that as if I was not getting the help I needed. With the help of Urgenthomework, I got precisely where I was weak: Sheryl. Read More

Copyright © 2009-2023 UrgentHomework.com, All right reserved.