Skip to content

YuriiJavaDev/JavaBasics_Task_10

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Prize Distribution Logic (JavaBasics_Task_10)

📌 Description

This project demonstrates the use of integer division and the modulo operator (%) in Java. It simulates a scenario where a set number of prizes must be distributed equally among teams, and the remainder is calculated.

🚀 Task Requirements

  1. Create two int variables: prizes (15) and teams (4).
  2. Calculate and display:
    • How many whole prizes each team receives (integer division).
    • How many prizes remain after distribution (remainder).

📋 Expected Output

After running the program, the console should display:

Number of prizes for each team: 3
Remaining prizes: 3

🛠 Technical Stack

  • Language: Java 23
  • IDE: IntelliJ IDEA
  • Concepts: Integer division (/), Modulo operator (%), Console output.

⌨️ Practical Implementation

The code follows Java naming conventions and clean code principles.

💻 Code Example

The code calculates the distribution using integer division and the modulo operator, providing clear and informative console output:

package com.yurii.pavlenko;

public class Task_10_App {
   public static void main(String[] args) {
      int prizes = 15;
      int teams = 4;

      int prizesForTeam = prizes / teams;
      int remainingPrizes = prizes % teams;

      System.out.println("Number of prizes for each team: " + prizesForTeam);
      System.out.println("Remaining prizes: " + remainingPrizes);
   }
}

⚖️ License

This project is licensed under the MIT License.

Copyright (c) 2026 Yurii Pavlenko

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files...

License: MIT

About

This is a learning project. JavaBasics_Task_10 This is an example of how code calculates division using integer division and the modulus operator, providing clear and informative output to the console. 150126_0335

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages