Software Development and Programming Careers (Official Discussion Thread)

Trustus

Black like the planet that they fear
Supporter
Joined
May 31, 2012
Messages
697
Reputation
1,170
Daps
2,222

Code:
import java.util.Scanner;
public class MyClass() {
    public static void main(String[] args) throws FileNotFoundException {
        int[] firstyr = new int[15];
        int[] lastyr = new int[15];
        String[] title = new String[15];
        String[] network = new String[15];
    
        Scanner input = new Scanner(new File("tvshows.txt"));
        int totalShows = 0;
        int i = 0;
        while(input.hasNextLine()) {
            String line = input.nextLine(); // 1989 1997 Coach ABC
            String[] fields = line.split(); // [ "1989", "1997", "Coach", "ABC" ]
            firstyr[i] = fields[0]; //1989
            lastyr[i] = fields[1]; //1997
            title[i] = fields[2]; //Coach
            network[i] = fields[3]; //ABC
            i++;
        }
        input.close(); // Should always close your Scanner
      
        printSentences(firstyr, lastyr, title, network);
    
    }// end main
  
    public static void printSentences(int[] firstyr, int[] lastyr, String[] title, String[] network) {
        for(int i = 0; i < firstyr.length - 1; i++) { //assuming they'll always be the same length
            System.out.printf("%s aired from %d to %d on %s.\n", title[i] , firstyr[i] , lastyr[i] ,network[i]);
        }
    }
  
}

Cool, but what about the other 14 entries into the arrays?

That's how you should do it, but Scanner is quick and easy when learning file i/o. I learned using Scanner and that was only 5 years ago.

That's the thing that has me :snoop: what are the best practices in java? I tried looking up this stuff and its all done a different way from how we learned from our textbook.
We used "Building Java Programs 4th edition" along with https://practiceit.cs.washington.edu/problem/list
I have a team treehouse account and they don't do input and output the same as the book either. They use the readLine() method. I don't know if its because they're using the command line and the console. We were using BlueJ for our environment. I like IntelliJ but can see why BlueJ was used to teach the class.

Thanks, bruh for the code I'll practice it on some other files to get the concept down
https://practiceit.cs.washington.edu/problem/list#
 

F K

All Star
Joined
Jan 13, 2017
Messages
3,204
Reputation
480
Daps
10,121
Cool, but what about the other 14 entries into the arrays?



That's the thing that has me :snoop: what are the best practices in java? I tried looking up this stuff and its all done a different way from how we learned from our textbook.
We used "Building Java Programs 4th edition" along with https://practiceit.cs.washington.edu/problem/list
I have a team treehouse account and they don't do input and output the same as the book either. They use the readLine() method. I don't know if its because they're using the command line and the console. We were using BlueJ for our environment. I like IntelliJ but can see why BlueJ was used to teach the class.

Thanks, bruh for the code I'll practice it on some other files to get the concept down
I don't do java but I think the "while(input.hasNextLine())", means you'll go line by line and get all 14 until you reach the end.
 

Trustus

Black like the planet that they fear
Supporter
Joined
May 31, 2012
Messages
697
Reputation
1,170
Daps
2,222
I don't do java but I think the "while(input.hasNextLine())", means you'll go line by line and get all 14 until you reach the end.
I understand that part. I was worried about the arrays (I'm still learning about them)
:francis:I just re-read his code I understand it now.
 

DJSmooth

Superstar
Joined
Oct 22, 2015
Messages
3,981
Reputation
1,229
Daps
23,690
I understand that part. I was worried about the arrays (I'm still learning about them)
:francis:I just re-read his code I understand it now.

The same advice is given over and over in here.

Build programs you would actually use basically a large project and do problems on Hackerrank and Leetcode. If you did these three things CS undergrad will be breeze.
 

Trustus

Black like the planet that they fear
Supporter
Joined
May 31, 2012
Messages
697
Reputation
1,170
Daps
2,222
The same advice is given over and over in here.

Build programs you would actually use basically a large project and do problems on Hackerrank and Leetcode. If you did these three things CS undergrad will be breeze.
Thanks, I didn't know about these sites. I'm trying to learn as much as possible.
 

Obreh Winfrey

Truly Brehthtaking
Supporter
Joined
Nov 18, 2016
Messages
20,852
Reputation
25,252
Daps
131,941
Cool, but what about the other 14 entries into the arrays?



That's the thing that has me :snoop: what are the best practices in java? I tried looking up this stuff and its all done a different way from how we learned from our textbook.
We used "Building Java Programs 4th edition" along with https://practiceit.cs.washington.edu/problem/list
I have a team treehouse account and they don't do input and output the same as the book either. They use the readLine() method. I don't know if its because they're using the command line and the console. We were using BlueJ for our environment. I like IntelliJ but can see why BlueJ was used to teach the class.

Thanks, bruh for the code I'll practice it on some other files to get the concept down

I don't do java but I think the "while(input.hasNextLine())", means you'll go line by line and get all 14 until you reach the end.
hasNextLine() just checks to see if there are any more lines in the file, it doesn't advance the scanner position. nextLine() grabs the next line of input, delimited by a newline character (\n) and advances the scanner to the next character after the line. So that's what actually causes you to iterate over the file.

Stay with the Scanner technique for now, the concept is basically the same for the FileReader classes. Learn basics before concerning yourself with best practices.
 

TXTrill1

All Star
Joined
May 9, 2012
Messages
4,456
Reputation
180
Daps
9,749
Reppin
TX
I'm sure this question has been asked a few times here. But what is everyone's experience with codeacademy? Is it really a good way to learn the basics or should I just enroll in a Udemy course?
 

Renkz

Superstar
Supporter
Joined
Jun 12, 2012
Messages
7,825
Reputation
2,310
Daps
18,049
Reppin
NULL
I'm sure this question has been asked a few times here. But what is everyone's experience with codeacademy? Is it really a good way to learn the basics or should I just enroll in a Udemy course?

The thing with code academy is you learn the basics, you lose interest because there is no tangible project in which you produce with doing the basics.
So, I recommend learning academy, and then follow along on some youtube newbie projects, or your own project.
Udemy is nice, but you dont need spend money to learn the basics if they're offering it free some where else. Also, only buy courses on sale.
 

TXTrill1

All Star
Joined
May 9, 2012
Messages
4,456
Reputation
180
Daps
9,749
Reppin
TX
The thing with code academy is you learn the basics, you lose interest because there is no tangible project in which you produce with doing the basics.
So, I recommend learning academy, and then follow along on some youtube newbie projects, or your own project.
Udemy is nice, but you dont need spend money to learn the basics if they're offering it free some where else. Also, only buy courses on sale.
Got you. What about codeacademy pro? Do you think that's worth it? They have some shyt on there that I think would be pretty helpful like projects and quizzes..Have you ever tried it or know somebody that has?
 
Last edited:

BiggWebb79

You Don't Have The Answers...
Supporter
Joined
Nov 12, 2012
Messages
10,942
Reputation
2,297
Daps
47,485
Reppin
Elm City
Got you. What about codeacademy pro? Do you think that's worth it? They have some shyt on there that I think would be pretty helpful like projects and quizzes..Have you ever tried it or know somebody that has?
Try FreeCodeCamp you can learn the basics and they give you projects to do at the end of the course.
 

null

...
Joined
Nov 12, 2014
Messages
29,242
Reputation
4,894
Daps
46,429
Reppin
UK, DE, GY, DMV
UK Training Scheme.

Step into Tech - BBC Tech Training Course for Women
Job Introduction
The BBC Step Into Tech training course is the ideal opportunity for women wanting to move into a career in Software Engineering. This in-depth course provides the fundamental skills needed to kick start a career in the sector.

This course is ideal for women who may be returning to work after a break, college leavers and career changers; anyone that is motivated for a career in software Engineering but need to learn the core skills first.

One of the new students on the programme, Emma, said: "When I heard I had been selected to join the first Step Into Tech programme I was so excited to get started. I have always wanted to get into technology but didn't know how I could break into the industry without going to University. This programme had given me the opportunity to not only learn the skills required to get started in a technology career, it also helped me to understand and feel more confident in how I could apply for an entry level role, hopefully within the BBC."

Step into Tech - BBC Tech Training Course for Women | Jobs and careers with BBC
 

Pyrexcup

Superstar
Joined
Dec 30, 2012
Messages
4,746
Reputation
765
Daps
14,814
Reppin
NULL
UK Training Scheme.

Step into Tech - BBC Tech Training Course for Women
Job Introduction
The BBC Step Into Tech training course is the ideal opportunity for women wanting to move into a career in Software Engineering. This in-depth course provides the fundamental skills needed to kick start a career in the sector.

This course is ideal for women who may be returning to work after a break, college leavers and career changers; anyone that is motivated for a career in software Engineering but need to learn the core skills first.

One of the new students on the programme, Emma, said: "When I heard I had been selected to join the first Step Into Tech programme I was so excited to get started. I have always wanted to get into technology but didn't know how I could break into the industry without going to University. This programme had given me the opportunity to not only learn the skills required to get started in a technology career, it also helped me to understand and feel more confident in how I could apply for an entry level role, hopefully within the BBC."

Step into Tech - BBC Tech Training Course for Women | Jobs and careers with BBC
this is good but its for women
 
Top