Skip to content

This repository contains a collection of simple Java programs designed to demonstrate various programming concepts and techniques. Each program is described below with its functionality and purpose.

Notifications You must be signed in to change notification settings

rezapace/java-program

Repository files navigation

Simple Java Programs

This repository contains a collection of simple Java programs designed to demonstrate various programming concepts and techniques. Each program is described below with its functionality and purpose.

Program 1: Conditional Branching in Java

  • If the score is less than or equal to 40, the grade is D.
  • If the score is less than 61, the grade is C.
  • If the score is less than 81, the grade is B.
  • Otherwise, the grade is A.

Program 2: Output Example

  • Your score is 50.
  • Sorry, you did not pass.

Program 3: Odd Numbers from 1 to 100

  • Displays all odd numbers between 1 and 100.

Program 4: Triangle Area Calculator

  • Calculates the area of a triangle given the base and height.

Program 5: Character Count in a String

  • Displays the number of characters in the string "Programmer".

Program 6: Triangle Area Calculation

  • Calculates the area of a triangle.

Program 7: Rectangle Area Calculation

  • Calculates the area of a rectangle given the length and width.

Program 8: Circle Area Calculation

  • Calculates the area of a circle with π = 3.14 and radius = 7.

Program 9: Even Numbers from 1 to 75

  • Displays all even numbers between 1 and 75.

Program 10: Days of the Week Array

  • Creates an array containing the names of the days from Monday to Sunday.
  • Example: "Day 1 is Monday", "Day 2 is Tuesday", etc.

Program 11: Fibonacci Sequence

  • Displays the first 5 Fibonacci numbers with the first term = 6 and the second term = 9.

Program 12: Right-Angled Triangle with Stars

  • Creates a right-angled triangle using stars.

Program 13: Full Triangle with Stars

  • Creates a full triangle using stars.

Program 14: Simple Calculator

  • A basic calculator program.

Program 15: Rectangle Area Calculation

  • Calculates the area of a rectangle.

Program 16: Rectangle Area Calculation

  • Calculates the area of a rectangle.

Program 17: Trigonometric Calculations

  • Calculates sine, cosine, and tangent angles.

Program 18: Density Calculation

  • Calculates the density of a substance.

Program 19: Counting from 1 to 1 Million

  • Counts from 1 to 1 million and displays the record.

Program 20: Cube Surface Area Calculation

  • Calculates the surface area of a cube.

Program 21: Odd Numbers from 1 to 75

  • Displays all odd numbers between 1 and 75.

Powered by Reza

About

This repository contains a collection of simple Java programs designed to demonstrate various programming concepts and techniques. Each program is described below with its functionality and purpose.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages