Skip to content

Matt-777-tecch/Java-Assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

JavaPractice

This repository contains my Java assignments for **conditional statements, loops, and modulus exercises.

All assignments are implemented using core Java, without external libraries, and demonstrate my understanding of decision-making and logic in programming.

Project Structure src/ └── com/ └── matthew/ ├── practice/ │ ├── Main.java │ └── Student.java └── primeassignment/ ├── PrimeCheck.java └── BuzzThrillsLogic1.java

  • src/com/matthew/practice/ → Main and Student class //This is not actually part of the assignment.
  • src/com/matthew/primeassignment/ → Prime check assignment

Assignments

  1. PrimeCheck.java
  • Takes an integer input from the user.
  • Determines whether the number is prime.
  • Demonstrates:
    • for loops
    • if-else statements
    • Logical operators (&&, ||)
  1. BuzzThrillsLogic1.java
  • Takes an integer input from the user.
  • Classifies it according to divisibility rules:
    • Divisible by 3 → "Buzz"
    • Divisible by 5 → "Thrills"
    • Divisible by both → "BuzzThrills"
    • Negative numbers → "Negative numbers are not allowed"
    • Otherwise → "Not divisible by 3 nor 5"
  • Demonstrates:
    • Conditional statements
    • Modulus operator %
    • Input validation

How to Run the Programs

  1. Open a terminal or command prompt.
  2. Navigate to the src folder of this project:
cd src

About

Java assignments: conditional statements, loops, and modulus exercises

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages