/Java-Sololearn-projects

Some simple projects make by me to solve Sololearn "Introduction to Java" practices.

Primary LanguageJava

_Purple Futuristic Technology Linkedin Banner (2)

Imagine you are working on a "student information system" for a university, which stores information about its students, such as their names, ages, average scores, and whether they graduated or not. Variables representing these parameters are declared incorrectly in the system's code.

Task: Fix the errors so that the system can print the values.

You are making a program for a chess tournament, that needs to calculate the points earned by a player. A win is worth 1 point, while a tie is worth 0.5 points. The given program declares two variables: wins and ties with the corresponding values.

Task: Create a program to calculate and output the points earned by the player. Multiply the ties value by 0.5, to get the points earned for ties.

You always tip 15% of the bill amount. To make the calculation easier, you decide to write a program that will do that for you.

Task: Take the bill amount as input and output the corresponding tip amount, which should be 15% of the amount. To calculate 15% of a number, multiply it by 15, then divide by 100. The input amount can be a decimal, so take a double from the input.

You are making a program for a water sensor that should check if the water is boiling.

Task: Take the integer temperature in Celsius as input and output "Boiling" if the temperature is above or equal to 100. Output "Not boiling" if it's not.

You are making a robot that should categorize items by their color. Each color corresponds to a box with a specific number.

For simplicity, our program will handle 3 colors: red goes to box #1 green goes to box #2 black goes to box #3

Task: Your program needs to take a color as input and output the corresponding box number.

Your robot can recognize your emotions and can assign them a number to represent each of them:

You are happy! You are sad! You are angry! You are surprised! The given code takes the emotion number as an user input.

Task: Complete the code to output the corresponding message in the given format. If the input is an emotion that the program doesn’t know, it should output: "Unknown emotion".

Given the age of a person as an input, output their age group.

Task Here are the age groups you need to handle: Child: 0 to 11 Teen: 12 to 17 Adult: 18 to 64

Your math teacher asked you to calculate the sum of the numbers 1 to N, where N is a given number.

Task: Take an integer N from input and output the sum of the numbers 1 to N, inclusive.

For your math class you need a program to calculate the factorial of a number. The given code takes the number from user input and declares a "fact" variable for calculation.

Task: Complete the code to calculate the factorial of the given number and output it.

The factorial of a number N is equal to 1 * 2 * 3 * ... * N For example, the factorial of 5 is 1* 2 * 3 * 4 * 5 = 120.

Task: Create a program that takes a number from input and output the factorial of that number.

You are creating an automated phone system for bank clients.

Number selections should activate the actions noted below as follows: 1 => Language selection 2 => Customer support 3 => Check account balance 0 => Exit You can use the first 3 commands in a random sequence without interrupting the phone call - only the number 0 interrupts it. The given code takes numbers continuously.

Task: Complete the code to output the corresponding messages, until the client enters 0.

The given code declares an array that holds the monthly revenues for a company for a year.

Task: You need to calculate the average monthly revenue for the year. For that, calculate the sum of the revenue for all the months and divide it by the number of items in the array.

The given code declares an array that holds the monthly revenues for a company for a year.

Task: You need to calculate the average monthly revenue for the year. For that, calculate the sum of the revenue for all the months and divide it by the number of items in the array.

You are creating a ticketing program for a small movie theater. The seats are represented using a 2-dimensional array. Each item can have the values 1 and 0 - 1 is occupied, and 0 if it's free.

Task: Your program needs to take as input the row and the column of the seat and output Free if it's free, and Sold if it's not.

You are making an automated response program for a store. The bot should take a number from the user as input and reply with an automated message. There are currently 3 responses, that you need to a handle:

User message: "1", Reply: "Order confirmed" User message: "2", Reply: "info@sololearn.com" For any other number, the reply should be: "Try again".

Task: The given code calls a method called bot(). Define the method, which should take an integer input from the user, and handle the above mentioned cases, by outputting the corresponding reply.

Let's imagine that you are writing a program that will help your sibling pass an exam. It should calculate and output the area of the rectangle. The code you are given takes the length and width of a rectangle as input and has a “printArea” method which is incomplete.

Task: Complete the method to take length and width as parameters.

Let's imagine that you are writing a program that will help your sibling pass an exam. It should calculate and output the area of the rectangle. The code you are given takes the length and width of a rectangle as input and has a “printArea” method which is incomplete.

Task: Complete the method to take length and width as parameters.