Ideas for Java projects

Discuss how to write good code, break bad code, your current pet projects, or the best way to approach novel problems

Ideas for Java projects

Post by ghostheadx2 on Mon Aug 03, 2015 1:45 pm
([msg=89223]see Ideas for Java projects[/msg])

I need to do more java projects to make myself a better programmer. I just completed a Lab for my Comp Sci class. Now, I want ideas for other java projects to do for fun. I'll give you the code of my last project to show you where I'm at:

Code: Select all
import java.util.*;
import java.io.*;


public class TriviaTest{

   private String [] correctAnswers;
   private String [] userResponses;
   private int numQuestions;
   private String [] testQuestions;
   

   public static void main(String[] args) throws IOException {
      Scanner input = new Scanner(System.in);
      String filename = input.nextLine();
      TriviaTest test = new TriviaTest(filename);
      test.giveTest();
      System.out.println("Your score: " + test.scoreTest() + "% correct");
      test.showCorrectAnswers();
   }

   public TriviaTest(String fileName) throws IOException{
      //Throws IOException
      //reads file name
     
   /*   public static void exceptionCatcher() throws IOException {
         throw new IOException("throws IOException");
      }
     
      try {
         File inputFile = new File(fileName);
         TriviaTest.fileName;
      }
      */
      File inputFile = new File(fileName);
      Scanner input = new Scanner(inputFile);
     
      numQuestions = input.nextInt();
      correctAnswers = new String[numQuestions];
      testQuestions = new String[numQuestions];
      userResponses = new String [numQuestions];
      input.nextLine();
      for (int i = 0; i < numQuestions; i++){
         correctAnswers[i] = input.next();
      }
     
      input.nextLine();
      for (int i = 0; i < numQuestions; i++){
         testQuestions[i]=input.nextLine();
      }
   }
   
   public TriviaTest(){
      System.out.println("You did not enter a file name...");
      System.exit(0);
   }
   
   public void giveTest(){
      Scanner input = new Scanner(System.in);
      for(int i = 0; i < userResponses.length; i++){
         System.out.println(testQuestions[i]);
         String answer = input.next();
         userResponses[i] = answer;
      }
   }
//incompatible types error with if statement
   public int scoreTest(){
      int a = 0;
      for (int i = 0; i < userResponses.length; i++){
         if (userResponses[i].equals(correctAnswers[i])){
            a++;
         }
      }
      return (int)(((a * 1.0)/ correctAnswers.length) * 100);
   }
   
   public void showCorrectAnswers(){
      System.out.print("The correct answers are: ");
      for (int i = 0; i < correctAnswers.length; i++){
         System.out.print(correctAnswers[i] + " ");
      }
      System.out.println();
      System.out.print("Your responses were: ");
      for (int i = 0; i < userResponses.length; i++){
         System.out.print(userResponses[i] + " ");
      }
   }
}


It ran and compiled perfectly, tested with another file. So, I want a project that I could improve a lot from from here on out. I want something that will encompass all of my programming skills. Anything that forces me to pay attention to detail is good, since I need to work on that. Thanks so much.

:D

Best,

your friendly neighborhood ghostheadx2
ghostheadx2
Contributor
Contributor
 
Posts: 728
Joined: Wed Nov 19, 2014 1:19 am
Blog: View Blog (0)


Re: Ideas for Java projects

Post by tgoe on Mon Aug 03, 2015 5:15 pm
([msg=89225]see Re: Ideas for Java projects[/msg])

You're into Python as well, right? Maybe play around with Jython and port an existing Python project to the Java platform or vice versa. You won't have to start from scratch and will likely get you using Java, Python and version control.
User avatar
tgoe
Contributor
Contributor
 
Posts: 718
Joined: Sun Sep 28, 2008 2:33 pm
Location: q3dm7
Blog: View Blog (0)


Re: Ideas for Java projects

Post by ghostheadx2 on Mon Aug 03, 2015 7:17 pm
([msg=89226]see Re: Ideas for Java projects[/msg])

I am into python. I just have to learn java for now because its what my class is doing. I'm probably going to learn python again when I'm done with Java. But I'm looking for a project I can do to practice Java. Jython sounds cool though. Can that be learned easily after Java if I haven't done Python in a few months? I guess I was playing with python for a while. Lol. Is it recommended I refresh on Python first?

-- Mon Aug 03, 2015 7:18 pm --

What type of project can I make with Jython?
ghostheadx2
Contributor
Contributor
 
Posts: 728
Joined: Wed Nov 19, 2014 1:19 am
Blog: View Blog (0)


Re: Ideas for Java projects

Post by tgoe on Tue Aug 04, 2015 10:08 pm
([msg=89231]see Re: Ideas for Java projects[/msg])

I am into English. I just have to learn Spanish for now because its what my class is doing. I'm probably going to learn English again when I'm done with Spanish. But I'm looking for a project I can do to practice Spanish. Spanglish sounds cool though. Can that be learned easily after Spanish if I haven't done English in a few months? I guess I was playing with English for a while. Lol. Is it recommended I refresh on English first?


What type of project can I make with Spanglish?


You can be as rich as Adam Sandler if you set your mind to it.
User avatar
tgoe
Contributor
Contributor
 
Posts: 718
Joined: Sun Sep 28, 2008 2:33 pm
Location: q3dm7
Blog: View Blog (0)


Re: Ideas for Java projects

Post by ghostheadx2 on Wed Aug 05, 2015 11:29 am
([msg=89235]see Re: Ideas for Java projects[/msg])

I kind of want to make an app, but I don't think its a first project. My comp sci class just had their last lesson and now we're going to have another midterm and the final. Now we have no lessons left. I want to further my java education to the point where I might be able to make an app. Would I be ready to learn to do that after these tutorials?

Beginner:

https://www.youtube.com/playlist?list=P ... 9D83EE3E28

Intermediate:

https://www.youtube.com/playlist?list=P ... 63B6A864E3

Anything else I might have to do to be able to make an app?

-- Wed Aug 05, 2015 12:04 pm --

I might also want to make a calculator with buttons to represent the numbers, etc. What should I learn to get there? Should I just do those tutorials, or should I do more?
ghostheadx2
Contributor
Contributor
 
Posts: 728
Joined: Wed Nov 19, 2014 1:19 am
Blog: View Blog (0)



Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests