Skip to content

LaunchCodeEducation/software-dev-course-classes-and-objects-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Classes and Objects - Methods

Introduction

In this exercise, you will use java methods to solve a series of problems. You will use provided unit tests to verify that your solutions are correct.

There are two sets of required exercises in this project: Calculator and StringUtilities. You will find the exercises in the src/main/java/org/example/ directory.

Note

You may notice that the build is broken when you open the project and there are errors showing. This is because the methods are not yet implemented and the tests are referencing methods that do not exist. This is expected and you will fix this by implementing the methods.

Tip

We will soon be learning to write our own tests, but for now, you may want to look at the code for the provided tests to see how they work and for some clues about how to implement the methods for exercises in this project.

Calculator Exercises (Required)

You will find the calculator exercises in the src/main/java/org/example/Calculator.java file.

This class is empty other than comments explaining the four methods you need to implement. Each method is a calculator operation. Follow the instructions in the comments to implement the methods.

Once you have completed the exercises, run the tests in the src/test/java/org/example/CalculatorTests.java file to verify that your solutions are correct.

To run these tests, right-click on the CalculatorTests class and select Run 'CalculatorTests'.

You will see the results of the tests in the Run tab at the bottom of the IDE.

StringUtilities Exercises (Required)

You will find the string utilities exercises in the src/main/java/org/example/StringUtilities.java file.

This class is empty other than comments explaining the methods you need to implement. Each method is a string utility operation. Follow the instructions in the comments to implement the methods.

Tip

Refer to the Java Basics 1 course for information on common String methods.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages