Skip to content

Commit

Permalink
Update readme and add pattern programming
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankush Raj Mahe Yam committed Dec 9, 2024
1 parent 5a8b2dd commit 6a4a377
Show file tree
Hide file tree
Showing 16 changed files with 705 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Assign21/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,11 +431,15 @@ Hi, I’m Ankush Raj Mahe Yam (ARMY), an aspiring software developer currently p

Connect with me on:
- **Search on Google:** [Ankush Raj Mahe Yam](https://www.google.com/search?q=ankush+raj+mahe+yam)
- **Portfolio:** [Ankush Raj](https://ankushrajamaheyam.blogspot.com/)
- **LinkedIn:** [Ankush Raj](https://linkedin.com/in/AnkushRajMaheYam)
- **GitHub:** [Ankush Raj](https://github.com/AnkushRajMaheYam)
- **Leetcode:** [Ankush Raj](https://leetcode.com/u/AnkushRajMaheYam/)
- **HackerRank:** [Ankush Raj](https://www.hackerrank.com/profile/ankushrajmaheyam/)
- **Instagram:** [@AnkushRaj](https://instagram.com/AnkushRajaMaheYam)
- **Facebook:** [Ankush Raj](https://facebook.com/AnkushRajMaheYam)
- **Fiverr:** [Ankush Raj](https://www.fiverr.com/ankushrajmaheya/)
- **Upwork:** [Ankush Raj](https://www.upwork.com/freelancers/~01bf6d1e8483199ba6)

---

Expand Down
39 changes: 39 additions & 0 deletions Assign24/Q1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
*
*
*
*
*
*/

import java.util.Scanner;
class Q1 {
public static void pattern(int n){
for(int i = 1; i<=n; i++){
System.out.println("*");
}
}

public static void main(String [] args){
Scanner sc = new Scanner(System.in);

System.out.print("Enter a number : ");
int n = sc.nextInt();

pattern(n);
}
}

/*
More Pattern Based Questions uploaded in this folder link :-
https://github.com/AnkushRajMaheYam/Java-Assignment_J-Spider/tree/main/Assign24
// Folder Structure :-
Java-Assignment_J-Spider/
├── Assign24/
└── Q1.java
*/
45 changes: 45 additions & 0 deletions Assign24/Q10.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* * * * *
* * * * *
* * * *
* * * * *
* * * * *
*/
import java.util.Scanner;
public class Q10 {
public static void pattern(int n){
for(int i = 1; i<=n; i++){
for(int j=1; j<=n; j++){
if(i<=2 || j<=2 || i>=n-1 || j>=n-1){
System.out.printf("* ");
}
else{
System.out.printf(" ");
}
}
System.out.println();
}
}

public static void main(String [] args){
Scanner sc = new Scanner(System.in);
System.out.print("Enter a number : ");
int n = sc.nextInt();

pattern(n);
sc.close();
}
}

/*
More Pattern Based Questions uploaded in this folder link :-
https://github.com/AnkushRajMaheYam/Java-Assignment_J-Spider/tree/main/Assign24
// Folder Structure :-
Java-Assignment_J-Spider/
├── Assign24/
└── Q8.java
*/
50 changes: 50 additions & 0 deletions Assign24/Q11.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* * * * *
* * *
* * * * *
* * *
* * * * *
*/
import java.util.Scanner;
public class Q11 {
public static void pattern(int n){
int mid = n/2+1;
if(n%2==0){
System.out.println("it is only give perfect structure in odd number. So, Please Enter a odd number.");
return;
}
for(int i = 1; i<=n; i++){
for(int j=1; j<=n; j++){
if(i==mid || j==mid || i==1 || j==1 || i==n || j==n){
System.out.printf("* ");
}
else{
System.out.printf(" ");
}
}
System.out.println();
}
}

public static void main(String [] args){
Scanner sc = new Scanner(System.in);
System.out.print("Enter a number : ");
int n = sc.nextInt();

pattern(n);
sc.close();
}
}

/*
More Pattern Based Questions uploaded in this folder link :-
https://github.com/AnkushRajMaheYam/Java-Assignment_J-Spider/tree/main/Assign24
// Folder Structure :-
Java-Assignment_J-Spider/
├── Assign24/
└── Q11.java
*/
46 changes: 46 additions & 0 deletions Assign24/Q12.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* * * * *
* * * *
* * *
* * * *
* * * * *
*/
import java.util.Scanner;
public class Q12 {
public static void pattern(int n){
for(int i = 1; i<=n; i++){
for(int j=1; j<=n; j++){
if(i==1 || j==1 || i==n || j==n || i==j || i+j==n+1){
System.out.printf("* ");
}
else{
System.out.printf(" ");
}
}
System.out.println();
}
}

public static void main(String [] args){
Scanner sc = new Scanner(System.in);
System.out.print("Enter a number : ");
int n = sc.nextInt();

pattern(n);
sc.close();
}
}

/*
More Pattern Based Questions uploaded in this folder link :-
https://github.com/AnkushRajMaheYam/Java-Assignment_J-Spider/tree/main/Assign24
// Folder Structure :-
Java-Assignment_J-Spider/
├── Assign24/
└── Q12.java
*/
51 changes: 51 additions & 0 deletions Assign24/Q13.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* * * *
* *
* * * * *
* *
* * * *
*/
import java.util.Scanner;
public class Q13 {
public static void pattern(int n){
int mid = n/2+1;
if(n%2==0){
System.out.println("Please enter odd number for get proper pattern.");
return;
}
for(int i = 1; i<=n; i++){
for(int j=1; j<=n; j++){
if(i==mid || j==mid || i==1 && j>=mid || j==1 && i<=mid || i==n && j<=mid || j==n && i>=mid){
System.out.printf("* ");
}
else{
System.out.printf(" ");
}
}
System.out.println();
}
}

public static void main(String [] args){
Scanner sc = new Scanner(System.in);
System.out.print("Enter a number : ");
int n = sc.nextInt();

pattern(n);
sc.close();
}
}

/*
More Pattern Based Questions uploaded in this folder link :-
https://github.com/AnkushRajMaheYam/Java-Assignment_J-Spider/tree/main/Assign24
// Folder Structure :-
Java-Assignment_J-Spider/
├── Assign24/
└── Q13.java
*/
32 changes: 32 additions & 0 deletions Assign24/Q2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* * * * * * *
*/
import java.util.Scanner;
public class Q2 {
public static void pattern(int n){
for(int i = 1; i<=n; i++){
System.out.print("* ");
}
}

public static void main(String [] args){
Scanner sc = new Scanner(System.in);

System.out.print("Enter a number : ");
int n = sc.nextInt();

pattern(n);
}
}

/*
More Pattern Based Questions uploaded in this folder link :-
https://github.com/AnkushRajMaheYam/Java-Assignment_J-Spider/tree/main/Assign24
// Folder Structure :-
Java-Assignment_J-Spider/
├── Assign24/
└── Q2.java
*/
42 changes: 42 additions & 0 deletions Assign24/Q3.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
* * * * * * *
*/

import java.util.Scanner;

public class Q3 {
public static void pattern(int n){
for(int i = 1; i<=n; i++){
for(int j=1; j<=n; j++){
System.out.print("* ");
}
System.out.println();
}
}

public static void main(String [] args){
Scanner sc = new Scanner(System.in);

System.out.print("Enter a number : ");
int n = sc.nextInt();

pattern(n);
sc.close();
}
}

/*
More Pattern Based Questions uploaded in this folder link :-
https://github.com/AnkushRajMaheYam/Java-Assignment_J-Spider/tree/main/Assign24
// Folder Structure :-
Java-Assignment_J-Spider/
├── Assign24/
└── Q3.java
*/
37 changes: 37 additions & 0 deletions Assign24/Q4.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* * *
* * *
* * *
* * *
* * *
*/

public class Q4 {
public static void pattern(int n){
for(int i = 1; i<=n; i++){
for(int j=1; j<=n-4; j++){
System.out.print("* ");
}
System.out.println();
}
}

public static void main(String [] args){
int n = 7;

pattern(n);

}
}

/*
More Pattern Based Questions uploaded in this folder link :-
https://github.com/AnkushRajMaheYam/Java-Assignment_J-Spider/tree/main/Assign24
// Folder Structure :-
Java-Assignment_J-Spider/
├── Assign24/
└── Q4.java
*/
Loading

0 comments on commit 6a4a377

Please sign in to comment.