
-----------------------------------
NegativeAzn
Tue Dec 02, 2008 8:58 pm

Grade 11 Mid-Term ISU
-----------------------------------
Well, This is my mid-term CPT, 
Completed in Approx. 1Hrs30Mins, 
My CPT /ISU is to create a quiz, with 15 questions on any appropiate topic you want. 
I chose Mario(Nintendo). I completed it, but i'm wondering if anyone has any suggestions for improvement,
or to find any flaws. I think my Program, Is error proof, May not be the best error proofed program, But I think it'll be fine.
Suggestions, Bad & Constructive Criticism welcome :) 
Sorry for the indentation, My teacher wants it to be like that; He says it's a good habit + the commenting.


package cpt;
import java.util.*;//Imports all util libraries.
public class cpt
{
    public static void main(String

-----------------------------------
syntax_error
Tue Dec 02, 2008 9:36 pm

RE:Grade 11 Mid-Term ISU
-----------------------------------
Using break is a horrible habit to get into, try not to, simple check if the condition of the original loop is meet or not in this case if Gameloop is n set it to false why have a while loop in the being if you don't use it?

btw, no one really likes the whole idea of fake loading screens; the latter is my $0.02; the former however, should be fixed.

-----------------------------------
andrew.
Tue Dec 02, 2008 9:47 pm

RE:Grade 11 Mid-Term ISU
-----------------------------------
It's cool, but it's pretty procedural and isn't the whole point of Java in grade 11 to learn object-oriented concepts?

-----------------------------------
syntax_error
Tue Dec 02, 2008 9:50 pm

Re: RE:Grade 11 Mid-Term ISU
-----------------------------------
It's cool, but it's pretty procedural and isn't the whole point of Java in grade 11 to learn object-oriented concepts?

I doubt they are even taught what an object is. Yet. Hopefully.

-----------------------------------
andrew.
Tue Dec 02, 2008 9:51 pm

RE:Grade 11 Mid-Term ISU
-----------------------------------
It's halfway through the course so they should know what an object is. It's fairly important in Java and it took me a while to wrap my head around the concept.

-----------------------------------
NegativeAzn
Tue Dec 02, 2008 10:56 pm

Re: RE:Grade 11 Mid-Term ISU
-----------------------------------
Using break is a horrible habit to get into, try not to, simple check if the condition of the original loop is meet or not in this case if Gameloop is n set it to false why have a while loop in the being if you don't use it?

btw, no one really likes the whole idea of fake loading screens; the latter is my $0.02; the former however, should be fixed.

I guess I should delete the whole false-load thing.
I don't really understand what you're trying to say, yes I already know break is a really bad thing to use, since the whole AT&T network disaster.
I tried doing a simple check if condition, but i'm not sure , this is what I tried, But can't really figure to work it.
At the end, it doesn't loop, anyone mind suggesting what to do?

while (GameLoop.equals("n") && !GameLoop.equals("y"));  < replace while(true)

>quiz crap here <

>Ending@Score comments.Question : would you like to quit?

if(quit.equals("y"))
{   
System.out.println("Thanks for playing, Good-bye.");
}
else
{
System.out.println("Restarting..");
ScoreCounter = 0;//Resets to score.


-----------------------------------
wtd
Wed Dec 03, 2008 12:32 am

RE:Grade 11 Mid-Term ISU
-----------------------------------
The following kind of comment would cost you points in wtd's classroom.

//ends class 

-----------------------------------
Okapi
Wed Dec 03, 2008 4:24 am

Re: RE:Grade 11 Mid-Term ISU
-----------------------------------
The following kind of comment would cost you points in wtd's classroom.

//ends class 

Why?

-----------------------------------
wtd
Wed Dec 03, 2008 12:02 pm

RE:Grade 11 Mid-Term ISU
-----------------------------------
Comments are meant to shed light on the reasoning behind a piece of code above and beyond the information the code itself provides.  

That type of comment does not do so.  It is just extra visual clutter and makes the code harder to read for no benefit.

-----------------------------------
S_Grimm
Wed Dec 03, 2008 12:32 pm

Re: RE:Grade 11 Mid-Term ISU
-----------------------------------
Comments are meant to shed light on the reasoning behind a piece of code above and beyond the information the code itself provides.  

That type of comment does not do so.  It is just extra visual clutter and makes the code harder to read for no benefit.


How is it visual clutter? I use this type of comment to easily identify where the block of code starts and ends and where the classes end. When my code is 1000+ lines of code, I need to be able to see my procedures.

-----------------------------------
wtd
Thu Dec 04, 2008 12:25 am

RE:Grade 11 Mid-Term ISU
-----------------------------------
It's extra....  stuff to look at.  And it doesn't say anything useful that the code itself shouldn't already be telling you.

-----------------------------------
syntax_error
Thu Dec 04, 2008 1:05 am

Re: RE:Grade 11 Mid-Term ISU
-----------------------------------
Using break is a horrible habit to get into, try not to, simple check if the condition of the original loop is meet or not in this case if Gameloop is n set it to false why have a while loop in the being if you don't use it?

btw, no one really likes the whole idea of fake loading screens; the latter is my $0.02; the former however, should be fixed.

I guess I should delete the whole false-load thing.
I don't really understand what you're trying to say, yes I already know break is a really bad thing to use, since the whole AT&T network disaster.
I tried doing a simple check if condition, but i'm not sure , this is what I tried, But can't really figure to work it.
At the end, it doesn't loop, anyone mind suggesting what to do?

while (GameLoop.equals("n") && !GameLoop.equals("y"));  < replace while(true)

>quiz crap here <

>Ending@Score comments.Question : would you like to quit?

if(quit.equals("y"))
{   
System.out.println("Thanks for playing, Good-bye.");
}
else
{
System.out.println("Restarting..");
ScoreCounter = 0;//Resets to score.


play with the true condition of the while loop. You should get it now.

-----------------------------------
rto
Thu Dec 04, 2008 10:09 am

Re: Grade 11 Mid-Term ISU
-----------------------------------
I've been working with java for about a year and (correct me if i'm wrong please wtd, AV or somebody else who knows), but I would suggest putting the correct / Incorrect statements into their own methods to clean up a couple of lines of text :)

again, i could be wrong so i would suggest waiting on another post to tell you whether this is a good idea or not azn :)

-----------------------------------
S_Grimm
Thu Dec 04, 2008 11:35 am

RE:Grade 11 Mid-Term ISU
-----------------------------------
putting the questions in there own procedures is helpful, but checking if the answer is right is just a couple of if statements and boolean variables.

-----------------------------------
HeavenAgain
Thu Dec 04, 2008 3:46 pm

Re: Grade 11 Mid-Term ISU
-----------------------------------
I've been working with java for about a year and (correct me if i'm wrong please wtd, AV or somebody else who knows), but I would suggest putting the correct / Incorrect statements into their own methods to clean up a couple of lines of text :)

again, i could be wrong so i would suggest waiting on another post to tell you whether this is a good idea or not azn :)

A general rule in programming is when you need to copy/paste codes, then you are doing something wrong...

-----------------------------------
chili5
Sat Dec 20, 2008 8:33 pm

RE:Grade 11 Mid-Term ISU
-----------------------------------
Another thing, your coding in all your questions directly into main. This doesn't really make your program more expandable easily.

Why don't you read in the questions and answers in from an external file?
