This video explains a challenge to create a payroll program in Scala. The challenge uses the concepts reviewed in this section such as writing functions, creating variables and using decision statements.
(light music)…- [Instructor] It's time for the next challenge.…In this challenge your objectives are to create…a new project in the Scala IDE, to create a worksheet…in this project, write code for a payroll function.…The payroll function will calculate the weekly paycheck…for an hourly employee.…In our example hourly employees receive overtime,…which means the first 40 hours are calculated…at the regular rate.…Anything about 40 hours should be calculated…at 1.5 times their hourly rate.…
Use an hourly rate of $10.50.…Check to see if the employee…is hourly or salaried before calculating their paycheck.…If they're salaried, just print a message.…Make sure you test your program with several…different types of employees.…Maybe an hourly employee who worked 40 hours,…another hourly employee who worked 45 hours,…an hourly employee who only worked 25 hours,…and finally make sure you test what happens…if you have a salaried employee.…
I'd estimate this challenge will take about 15 minutes,…and when you're done, come back and check out…
Join Peggy Fisher as she helps get you started with Scala, so you can leverage the unique capabilities it offers. First, learn the basics of type inference, variables, loops, functions, and operators. Then, find out how to read files using a console, perform pattern matching, handle exceptions, and more. Finally, learn how to use classes, fields, methods, and objects.
- Integrating with IDEs
- Scala worksheets
- Scala repl sessions
- Type inference
- Creating variables
- Working with loops
- Higher-order functions
- Scala operators
- Working with decision statements
- Handling exceptions using try or catch
- Working with tuples and arrays
- Classes, fields, and methods
Skill Level Intermediate
Java Platforms Compared: SE vs EE vs MEwith Peggy Fisher25m 38s Intermediate
Scala Essential Training for Data Sciencewith Dan Sullivan1h 51m Intermediate
1. Getting Started with Scala
2. Scala Basics
3. More Scala Basics
4. Objects with Scala
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.