Skip to content

This Java project collects numbers from the user, calculates the sum, counts even and odd numbers, and tracks values above 100. It continues prompting until the user enters 0 to stop. The program displays statistics like the total sum, even/odd counts, and average of all values.

Notifications You must be signed in to change notification settings

davitelesn1/super_calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Overview: This project in Java was created to practice and reinforce various programming concepts, such as loops, conditionals, user input handling, and basic arithmetic operations. It allows the user to input a series of numbers and generates statistics based on the input.

Key Concepts Learned and Reinforced: User Input with JOptionPane:

I used JOptionPane.showInputDialog to take user input in a graphical way, which was important for learning how to interact with users in Java applications. Loops (do-while loop):

I practiced the use of the do-while loop, which repeatedly asks for input until the user provides a value of 0 to stop. This was important for practicing loop control in a real-world context. Conditionals (if statements):

Inside the loop, I used if statements to check if the input number is even or odd and if it is greater than 100. This reinforced my understanding of conditional logic. Arithmetic Operations:

The project involved calculating the sum of the entered values and counting the total numbers, even numbers, odd numbers, and numbers greater than 100. This helped me practice basic arithmetic and logical calculations in Java. Handling Edge Cases:

I handled the case where the user enters 0 to stop the program, and ensured that the statistics would only be calculated when at least one valid number was input. This helped me understand how to handle edge cases and prevent errors in the program flow. Displaying Results with HTML Formatting:

I used HTML formatting inside the JOptionPane.showMessageDialog method to present the results in a neat and readable way. This helped me learn how to format output in a GUI-based Java application. Type Casting (for division):

When calculating the average of the numbers, I used type casting to ensure the result was a double rather than an integer. This reinforced my understanding of data types and type conversion in Java. Conclusion: This project was a great opportunity to practice and consolidate my knowledge of Java basics, including user input, loops, conditionals, arithmetic operations, and handling results in a GUI environment.

About

This Java project collects numbers from the user, calculates the sum, counts even and odd numbers, and tracks values above 100. It continues prompting until the user enters 0 to stop. The program displays statistics like the total sum, even/odd counts, and average of all values.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages