This repository contains a series of Java programs organized into training modules to demonstrate basic programming concepts, including arithmetic operations, conditional statements, loops, and object-oriented programming concepts such as class definitions, methods, and user input handling.
Training Day 1
- If-Else-If.java
- Loops.java
- Division.java
Training Day 2
- Supply.java
- Main.java
A program that takes user input for marks and prints the corresponding grade based on the specified ranges using if-else-if statements.
A program that prints even numbers from 1 to 30 using a while loop and odd numbers from 1 to 30 using a do-while loop.
A program that performs a division operation between two integers and prints the result as a floating-point number.
The Supply class manages food information by providing methods to input and display details about the food item. It includes:
GetType(): Determines the type of food based on the sticker color.FoodIn(): Prompts the user to input food details and sets the member variables.FoodOut(): Displays the food details.The Main class serves as the entry point for the program. It creates an instance of the Supply class, calls the FoodIn() method to input food details, and then calls the FoodOut() method to display them.