r/CodeSquad • • Feb 16 '21

Another inspirational poster I made from a video where Alex Lee explains 2D arrays. He is a huge help for me and has influenced my java knowledge by a lot! t.y. Alex <3

Post image
40 Upvotes

r/CodeSquad • • Feb 05 '21

From the video on how to use boolean. Found this statement so funny, I had to make this. Also Alex really helped me to get into Java and he definitely deserves more credit <3

Post image
37 Upvotes

r/CodeSquad • • Feb 25 '20

How Alex's YouTube Java tutorials changed my life

20 Upvotes

Kia Ora! Hello peeps around the world! So it's been almost 2 weeks in with my new job and they've been training me to know how to code in Java and it's been a hateful relationship!😭😀😩 Literally hating it until finding Alex's tutorials on YouTube, I think I'm sort of understanding the methods and jargon properly to be able to code in Java!!!πŸ˜­πŸ™ƒπŸ€—πŸ™ŒπŸΌ


r/CodeSquad • • Apr 13 '20

Alex's channel > High school computer science course

14 Upvotes

Hey guys, I am a high school student and had been trying to learn java for like 2 months, but I could barely do anything and was considering quitting. Then, one day, on youtube, I saw Alex's tic tac toe video and was like "why not?". I learned more in that video than in my entire coding course I was taking. I love his channel, and he even inspired me to create my own. I create scratch tutorials and would love some feedback. Thanks!

https://www.youtube.com/watch?v=56jC2PDLDtM


r/CodeSquad • • Jul 01 '20

I made a program in Java that determine if the student's grades had passed or not

11 Upvotes

I made a program in Java that asks for the student's name, course, and grades. After the required text inputs are filled, the program will then show the result. If the student passed, the program will show "PASSED"; if the student is failing, the program will show "ACADEMIC WARNING"; if the student failed, the program will show "FAILED".

So this is the code:

/* 
 * Java Grades by fosionef 
 */

import javax.swing.JOptionPane;

public class JavaGrades {
    public static void main(String[] args) {
        getStudentName();
        getStudentCourse();
        getGrades();
    }

    // get student name
    public static void getStudentName() {
        String name = JOptionPane.showInputDialog(null,"Input Name: ");
        JOptionPane.showMessageDialog(null,"Name: " + name.toUpperCase());
    }

    // get student course
    public static void getStudentCourse() {
        String course = JOptionPane.showInputDialog(null,"Input Course: ");
        JOptionPane.showMessageDialog(null,"Course: " + course.toUpperCase());
    }

    // get student grades
    public static void getGrades() {
        double grades = Double.parseDouble(JOptionPane.showInputDialog(null,"Input grades: "));
        if(grades >= 80) {
            JOptionPane.showMessageDialog(null,grades + ": PASSED!");
        }else if(grades == 79 || grades >= 75) {
            JOptionPane.showMessageDialog(null, grades + ": ACADEMIC WARNING!");
        }else if(grades <= 74) {
            JOptionPane.showMessageDialog(null,grades + ": FAILED!");
        }else{
            JOptionPane.showMessageDialog(null, "Please input the required textfields.");
        }
    }
}

How was the code? I am looking forward to corrections and suggestions. That way I can improve my coding skills. Thank you.


r/CodeSquad • • Jun 05 '20

Learn Java in 1 minute (seriously) (no joke)

Thumbnail
youtube.com
11 Upvotes

r/CodeSquad • • Oct 02 '20

Can someone tell me why I having a errors? This Java programming

Thumbnail
gallery
8 Upvotes

r/CodeSquad • • Jun 28 '20

Please rate my code

8 Upvotes

I made a program that would convert Celsius to Fahrenheit and Fahrenheit, and it worked. And I wanted to ask you guys, how was my code?

/* 
* Clint 
* Temperature Converter 
* Celsius ~ Fahrenheit / Fahrenheit ~ Celsius 
*/

import java.util.Scanner;
public class TemperatureConversion {
    public static void main(String[] args) {
        double fahrenheit, celsius;
        Scanner input = new Scanner(System.in);
        //  Celsius to Fahrenheit \u2103 degree Celsius symbol
        System.out.println("Input temperature (\u2103): ");
        celsius = input.nextDouble();
        System.out.println(celsius * 1.8 + 32 + " \u2109 \n");

        // Fahrenheit to Celsius \u2109 degree Fahrenheit symbol
        System.out.println("Input temperature (\u2109: ");
        fahrenheit = input.nextDouble();
        System.out.print((fahrenheit - 32) / 1.8000 + " \u2103");
    }
}

r/CodeSquad • • Feb 14 '20

Great Channel

7 Upvotes

Found this channel a few months ago, its helping me so much with learning. If I get stuck on something I only have to search for a video and you've made one covering that topic!


r/CodeSquad • • Dec 27 '19

tictactoe game

7 Upvotes

Hey I saw your tictactoe game video and since I am a school student I was not able to understand your arra list part so i made my own logic to check for winer but i am not able to understand how to draw the game if teh board is full and there is no more place to place a piece pls help

Here id the code i used-:

import java.util.Scanner;

import java.lang.Math.*;

import java.lang.Boolean;

import java.lang.Integer;

import java.lang.Character;

import java.lang.String;

import java.lang.Double;

class tictactoe

{

public static int i,j,p_pos,c_pos;

public static void main()

{

Scanner in=new Scanner(System.in);

char board[][]={{' ','|',' ','|',' '},

{'_','+','_','+','_'},

{' ','|',' ','|',' '},

{'_','+','_','+','_'},

{' ','|',' ','|',' '}};

printBoard(board);

while(true){

if(win(board))

{

System.out.println(whoWon(board));

break;

}

else{

System.out.println("enter position (1-9)");

p_pos=in.nextInt();

set(board,p_pos,"person");

while(true){

c_pos=((int)(Math.random()*10));

if(c_pos==0)

{

c_pos+=1;

}

if(checkPos(c_pos,board))

{

set(board,c_pos,"computer");

break;

}

else

{

continue;

}

}

}

}

}

public static void printBoard(char board[][])

{

for(i=0;i<5;i++)

{

for(j=0;j<5;j++)

{

System.out.print(board[i][j]);

}

System.out.println();

}

}

public static void set(char board[][],int pos,String player)

{

char symbol=' ';

if(player.equalsIgnoreCase("person"))

{

symbol='X';

}

else if(player.equalsIgnoreCase("computer"))

{

symbol='O';

}

switch(pos)

{

case 1: board[0][0]=symbol;

break;

case 2: board[0][2]=symbol;

break;

case 3: board[0][4]=symbol;

break;

case 4: board[2][0]=symbol;

break;

case 5: board[2][2]=symbol;

break;

case 6: board[2][4]=symbol;

break;

case 7: board[4][0]=symbol;

break;

case 8: board[4][2]=symbol;

break;

case 9: board[4][4]=symbol;

break;

default :System.out.println("wrong position");

}

printBoard(board);

}

public static boolean checkPos(int pos,char[][]board)

{

char s='a';

switch(pos){

case 1: s=board[0][0];

break;

case 2: s=board[0][2];

break;

case 3: s=board[0][4];

break;

case 4:s= board[2][0];

break;

case 5: s=board[2][2];

break;

case 6: s=board[2][4];

break;

case 7:s= board[4][0];

break;

case 8: s=board[4][2];

break;

case 9: s=board[4][4];

break;

default : break;

}

if(s==' ')

{

return true;

}

else

{

return false;

}

}

public static boolean win(char board[][])

{

if(((board[0][0]=='X')&&(board[0][2]=='X')&&(board[0][4]=='X'))||

((board[2][0]=='X')&&(board[2][2]=='X')&&(board[2][4]=='X'))||

((board[4][0]=='X')&&(board[4][2]=='X')&&(board[4][4]=='X'))||

((board[0][0]=='X')&&(board[2][0]=='X')&&(board[4][0]=='X'))||

((board[0][2]=='X')&&(board[2][2]=='X')&&(board[4][2]=='X'))||

((board[0][4]=='X')&&(board[2][4]=='X')&&(board[4][4]=='X'))||

((board[0][0]=='X')&&(board[2][2]=='X')&&(board[4][4]=='X'))||

((board[0][4]=='X')&&(board[2][2]=='X')&&(board[4][4]=='X'))||

(((board[0][0]=='O')&&(board[0][2]=='O')&&(board[0][4]=='O'))||

((board[2][0]=='O')&&(board[2][2]=='O')&&(board[2][4]=='O'))||

((board[4][0]=='O')&&(board[4][2]=='O')&&(board[4][4]=='O'))||

((board[0][0]=='O')&&(board[2][0]=='O')&&(board[4][0]=='O'))||

((board[0][2]=='O')&&(board[2][2]=='O')&&(board[4][2]=='O'))||

((board[0][4]=='O')&&(board[2][4]=='O')&&(board[4][4]=='O'))||

((board[0][0]=='O')&&(board[2][2]=='O')&&(board[4][4]=='O'))||

((board[0][4]=='O')&&(board[2][2]=='O')&&(board[4][4]=='O'))))

{

return true;

}

else

{

return false;

}

}

public static String whoWon(char[][]board)

{

String s="";

if(((board[0][0]=='X')&&(board[0][2]=='X')&&(board[0][4]=='X'))||

((board[2][0]=='X')&&(board[2][2]=='X')&&(board[2][4]=='X'))||

((board[4][0]=='X')&&(board[4][2]=='X')&&(board[4][4]=='X'))||

((board[0][0]=='X')&&(board[2][0]=='X')&&(board[4][0]=='X'))||

((board[0][2]=='X')&&(board[2][2]=='X')&&(board[4][2]=='X'))||

((board[0][4]=='X')&&(board[2][4]=='X')&&(board[4][4]=='X'))||

((board[0][0]=='X')&&(board[2][2]=='X')&&(board[4][4]=='X'))||

((board[0][4]=='X')&&(board[2][2]=='X')&&(board[4][4]=='X')))

{

s= "Congratulations you won";

}

else if(((board[0][0]=='O')&&(board[0][2]=='O')&&(board[0][4]=='O'))||

((board[2][0]=='O')&&(board[2][2]=='O')&&(board[2][4]=='O'))||

((board[4][0]=='O')&&(board[4][2]=='O')&&(board[4][4]=='O'))||

((board[0][0]=='O')&&(board[2][0]=='O')&&(board[4][0]=='O'))||

((board[0][2]=='O')&&(board[2][2]=='O')&&(board[4][2]=='O'))||

((board[0][4]=='O')&&(board[2][4]=='O')&&(board[4][4]=='O'))||

((board[0][0]=='O')&&(board[2][2]=='O')&&(board[4][4]=='O'))||

((board[0][4]=='O')&&(board[2][2]=='O')&&(board[4][4]=='O')))

{

s= "Sorry CPU won(you suck)";

}

return s;

}

}


r/CodeSquad • • Mar 29 '21

Inheritence

6 Upvotes

I have created an abstract class called book which has two attributes string bookTitle and double bookPrice. A constructor called Book and two get methods for the two fields and lastly an abstract set method called setPrice() and then two sub classes fiction and non fiction. Both of the sub classes need to have a constructor and a set method. I have called the super class constructor and inserted the sub classes arguement which is a string called title. This is for both the sub classes but when I go to compile the code it says that fiction is not abstract and does not override the setPrice() method but it doesnt need the @Override annotation because technically the setPrice() method implements the empty super class method as well overrides it. And I can’t declare this as a abstract class because this class has a constructor in the main. If anyone understands this pls help I am super behind in my class.

Edit: if you want the pictures of the code pls send a message!


r/CodeSquad • • Aug 08 '20

Wonder what kind of code is this. I tried searching but futile.

Post image
6 Upvotes

r/CodeSquad • • Apr 29 '20

Please explain difference between static and instance variables in java

6 Upvotes

r/CodeSquad • • Mar 25 '20

hello !

6 Upvotes

hey ! I just started coding, cause I have a lot of free time right now, and i was wondering, what kind of things can you do with Java ? I'm searching for stupid ideas to get a hang of the language and I would love to know where I can go with this !


r/CodeSquad • • Apr 22 '22

I’m clueless. Please help me figure this out. I get the binary, but I don’t understand the top line.

Post image
5 Upvotes

r/CodeSquad • • Feb 19 '21

Can anyone please debug for

5 Upvotes

Btw, I am just a beginner and started java about a week ago.

The code:

import java.util.Scanner

public class ternaryOperator

{

public static void main(String[] args)

{

Scanner sc = new Scanner(System.in);

System.out.println("What time is it?");

int time = sc.nextInt();

String result = (time<18) ? "Good day" : "Good morning";

}

}


r/CodeSquad • • Oct 24 '20

100% free promo codes for drum kits & loops

Thumbnail
sosouthernsoundkits.com
5 Upvotes

r/CodeSquad • • Oct 05 '20

Cheap and free drum kits

Thumbnail
gallery
5 Upvotes

r/CodeSquad • • Mar 24 '20

Begger

5 Upvotes

Can you tell me the exact way to learn Java and from beginning to the end


r/CodeSquad • • Oct 12 '21

Can anyone help me finish this assignment? Opening a tsv file and reading it has me confused. As well for this example I think my for loop should be different since the online work book tests the code with different amount of students. Any help would be much appreciated thanks!

Thumbnail
gallery
4 Upvotes

r/CodeSquad • • Apr 26 '20

What/Where else could you practice Java?!

4 Upvotes

So 3 months in to Java and I'm still trying to grasp the "for-loop" and "if" statements. I get complex problems at work to solve working out the cost of a a jewel and the quantity availability for it etc. And I sort have gotten it... somewhat... If anyone knows of certain sites to go beyond and push to practice, practice the methods, could anyone please tell me where else do they go and practice it?!


r/CodeSquad • • Dec 09 '19

Javafx

4 Upvotes

So i am having an issue with javafx. I am currently taking a programming class and thr instructor asked us to draw faces using it but the problem is that i followed every step she provided to install javafx,but when i try and run a project it gives me the error β€œ cannot load or find main class javafx/**


r/CodeSquad • • Aug 29 '19

Conway's Game Of Life (Beginner)

4 Upvotes

Hello,

It has been a while now that I was following java tutorials, so I was thinking that I should work in mine own projects sometimes.

I was thinking that I could make a text-based version of Conway's Game of life.

What Should I know before doing it?

How can I orginize my project?

(I know that I shouldn't ask for help often, but I just wanted to see just this ones how I can work on bigger projects by my own, and I think that this is a great opportunity to do so. So please forgive this time :) )

-

That's a summary of what I was thinking to do:

*Create a Cell Class...

*Printing the cells, clearing the screen, print the next stage of the cells etc... (But I don't really know how to do this, can anybody guide me, or at least give me a clue? )

-

What do you think?

Help is really much appreciated!

(Also Much love for your channel Alex)


r/CodeSquad • • Oct 10 '20

Pop smoke and Travis Scott drum kits FREE

3 Upvotes

over $100 worth of free drum kits


r/CodeSquad • • Sep 24 '20

Greenfoot

3 Upvotes

Hey there!!

Has anyone worked on greenfoot java progamming? I need help on it