Category: Java assignments

Java assignment 08: Examen results

The output of this code is nothing. We pass the variable grade to the method. The method should do the following! If the number 10 is passed to the method, the ouput is Excellent. If the number 9 is passed to the method, the ouput is Very good. If the numbers 8, 7 and 6 […]

Java assignment 07: Find the leap years

The output of this code is nothing. if the code is compiled and run, the method leapYear should write all the leap years from 2021 till 2053 to the standard output. Write the code inside the method leapYear to achieve that. Note: A leap year is divisible by 4 with no remainder. Java assignment 07: […]

Java assignment 06: Find the sum of integers

The output of this code is nothing. The method writeSum should write the sum of three integers, namely i, i2, i3 to the standard output. If your method works correctly, the output of the program will be 23 + 17 + 3 = 43. Test your method by passing the following set of parameters to […]

Java assignment 05: Write the largest integer

Write the body of the method getLargest. The method writes the largest number out of three integers. If two or more equal largest integers are passed to the method, the output of the program should be “Enter unique numbers!”. If your method works correctly, the output of the following program will be 7. Test your […]

Java assignment 04: Working with strings

As a Java programmer you will often need to work with the┬áJava standard API specification. I tried to write a Java assignment based on one of my favorite quotes. The text of the quote2 is a quote by Mahatma Gandhi, but there is an unwanted web site link inside the quote. Write only one statement […]

Java assignment 03: Converting dollar to euro

Today, I am gonna teach you to write a simple useful Java program. This program converts any amounts of dollars to euros, when 1 euro = 1.18 dollar. If you run the program, a text appears in the standard output that asks users to enter an amount in dollars. When the user enters the amount […]

Java assignment 02: Calculate net salary

You can solve this assignment easily if you have learned from the first one. The method getNetSalary calculates the net salary of employees. The method applies only if the tax rate is equal to 0.20 and the monthly income is $4000. Change the code of the method so that it can calculate the net salary […]

Java assignment 01: Calculate net salary

Guys, here is a Java assignment for beginner programmers. When you start to work by a company, you often need to write Java methods and classes! The method getNetSalary calculates the net salary of employees who have a monthly income of $3200. This┬ámethod is correct only if the tax rate is equal to 0.30. Change […]

Sarmaroof © 2017