This repository contains a collection of Java programming projects created during my training at the J-Spider Software Training Institute (Noida Branch). These projects were developed by Ankush Raj, also known as Ankush Raj Mahe Yam, as part of the learning process.
Each project focuses on specific aspects of Java, including but not limited to:
- Method Implementation
- Conditional Logic
- Loops (While, For, Do-While)
- Object-Oriented Programming (OOP)
- Problem-Solving Techniques
Each Projectment is stored in a separate folder named according to the Projectment number (e.g., Project1
, Project2
, etc.). Inside each folder, you will find Java code files that solve specific problems given in the Projects.
Java-Projectment_J-Spider/
├── Project1/
│ └── ShoppingCart.java
├── Project2/
│ └── ElectricityChargeCalculation.java
└── (Future Projects will be added in separate folders)
The Project1 folder contains the following Java problems:
- Prompt the user to enter the number of items they wish to purchase.
- Allow the user to input the price of each item one by one.
- Calculate the total price of all the items.
- Apply a discount based on the total price using the following criteria:
- 40% discount if the total is ≥10,000.
- 30% discount if the total is ≥7,000 but less than 10,000.
- 20% discount if the total is ≥3,000 but less than 7,000.
- 8% discount for totals less than 3,000.
- Display:
- The total price before the discount.
- The discount percentage applied.
- The final amount to be paid after the discount.
- End with a "Thank you for shopping" message.
The Project1 folder contains the following Java problems:
Write a Java program to calculate the electricity bill based on the user's unit consumption. The program should:
- Prompt the user to enter:
- The old unit reading.
- The current unit reading.
- Validate that the current unit reading is greater than the old unit reading:
- If invalid, display an error message and terminate the program.
- Calculate the total unit consumption as:
totalUnitConsumed = currentUnit - oldUnit
.
- Calculate the electricity cost based on the following tariff:
- First 50 units: ₹1.25 per unit.
- Next 20 units (51 to 70): ₹1.75 per unit.
- Next 30 units (71 to 100): ₹2.25 per unit.
- Beyond 100 units: ₹3.00 per unit.
- Add a 20% surcharge to the calculated cost.
- Display the total consumption and the final bill amount.
Future Projects will follow the same structure and will be placed in their respective folders as they are added, for example:
- Project3/ (Coming soon)
- Project4/ (Coming soon)
-
Clone the repository:
git clone https://github.com/AnkushRajMaheYam/Java-Projectment_J-Spider.git
-
Navigate to the specific Projectment folder (e.g., Project1):
cd Java-Projectment_J-Spider/Project1
-
Compile and run the Java programs:
javac ShoppingCart1.java java ShoppingCart
-
Follow the on-screen instructions to input the necessary values and test the methods.
- Language: Java
- IDE: You can use any Java-supported IDE such as VScode, IntelliJ, Eclipse, or the command line to compile and run the programs.
The code provided in this repository has not been tested by a professional coder or programmer and may contain bugs. It is the user's responsibility to thoroughly test the code and make any necessary adjustments. The code is intended for educational purposes only and should not be used in production environments.
The Projectment questions in this repository were obtained from the Q-Spider and J-Spider Software Training Institute (Noida Branch).
Hi, I’m Ankush Raj Mahe Yam (ARMY), an aspiring software developer currently pursuing Java Full Stack Development. I’m also involved in various business ventures, including a tech-based YouTube channel, a logistics business, and real estate projects.
Connect with me on:
- Search on Google: Ankush Raj Mahe Yam
- LinkedIn: Ankush Raj Mahe Yam
- GitHub: Ankush Raj Mahe Yam
- Instagram: @AnkushRajaMaheYam
- Facebook: Ankush Raj Mahe Yam
License:
This repository is licensed under the MIT License.
Special thanks to the mentor(Shambhu Sir) and faculty at J-Spider Software Training Institute (Noida Branch) for providing excellent guidance and support throughout the course.
Feel free to explore the projects, and happy coding! 😊