28
Take out a piece of paper and PEN . The quiz starts ONE minute after the tardy bell rings. You will have 30 or 45 seconds per question. PreAP Computer Science Quiz 02.07-10

PreAP Computer Science Quiz 02.07-10

  • Upload
    adriel

  • View
    107

  • Download
    0

Embed Size (px)

DESCRIPTION

PreAP Computer Science Quiz 02.07-10. Take out a piece of paper and PEN . The quiz starts ONE minute after the tardy bell rings. You will have 30 or 45 seconds per question. Title the quiz as shown below The quiz starts in ONE minute. Question 01. Question 02. Question 03. - PowerPoint PPT Presentation

Citation preview

Page 1: PreAP  Computer Science Quiz 02.07-10

Take out a piece of paper and PEN.

The quiz starts ONE minute after the tardy bell rings.

You will have 30 or 45 seconds per question.

PreAP Computer ScienceQuiz 02.07-10

Page 2: PreAP  Computer Science Quiz 02.07-10

Title the quiz as shown belowThe quiz starts in ONE minute.

Name Period Date Quiz 02.07-101. 14.2. 15.3. 16.4. 17.5. 18.6. 19.7. 20.8. 21.9. 22.10. 23.11. 24.12. 25.13. EC.

Page 3: PreAP  Computer Science Quiz 02.07-10

Question 01Which lines in this program contain comments?#1 // Java0201.java#2 // This program demonstrates text output with println.#3 // Note how the file name, Java0201, is the same as the#4 // class identifier Java0201. #5 // Make sure that you observe "case-sensitivity".#6 public class Java0201#7 {#8 public static void main (String args[])#9 {#10 System.out.println("Hello World!");#11 }#12 }

(a) Lines 1-5 (b) Lines 7-9(c) Lines 10-12(d) Lines 7, 9, 11, 12

Page 4: PreAP  Computer Science Quiz 02.07-10

Question 02Which line in this program generates output?#1 // Java0201.java#2 // This program demonstrates text output with println.#3 // Note how the file name, Java0201, is the same as the#4 // class identifier Java0201. #5 // Make sure that you observe "case-sensitivity".#6 public class Java0201#7 {#8 public static void main (String args[])#9 {#10 System.out.println("Hello World!");#11 }#12 }

(a) Line 1 (b) Line 6(c) Line 8(d) Line 10

Page 5: PreAP  Computer Science Quiz 02.07-10

Question 03Which line in this program must contain the name of the file?#1 // Java0201.java#2 // This program demonstrates text output with println.#3 // Note how the file name, Java0201, is the same as the#4 // class identifier Java0201. #5 // Make sure that you observe "case-sensitivity".#6 public class Java0201#7 {#8 public static void main (String args[])#9 {#10 System.out.println("Hello World!");#11 }#12 }

(a) Line 1 (b) Line 6(c) Line 8(d) Line 10

Page 6: PreAP  Computer Science Quiz 02.07-10

Question 04Which word from this program is not a Java Reserved Word?#1 // Java0201.java#2 // This program demonstrates text output with println.#3 // Note how the file name, Java0201, is the same as the#4 // class identifier Java0201. #5 // Make sure that you observe "case-sensitivity".#6 public class Java0201#7 {#8 public static void main (String args[])#9 {#10 System.out.println("Hello World!");#11 }#12 }

(a) public(b) static(c) void(d) Java0201

Page 7: PreAP  Computer Science Quiz 02.07-10

Question 05

Which symbol is used for single-line comments?

(a) //

(b) \\

(c) /*

(d) */

Page 8: PreAP  Computer Science Quiz 02.07-10

Which symbol is used to start a multi-line comment?

(a) //

(b) \\

(c) /*

(d) */

Question 06

Page 9: PreAP  Computer Science Quiz 02.07-10

Which symbol is used to end a multi-line comment?

(a) //

(b) \\

(c) /*

(d) */

Question 07

Page 10: PreAP  Computer Science Quiz 02.07-10

Question 08What is the output of this program?

public class Java0202{

public static void main(String args[])

{ System.out.println("Line

1"); System.out.println("Line

2"); System.out.println("Line

3");}

}

(a)Line 1Line 2Line 3

(b)Line 1

Line 3

(c)Line 1Line 2Line 3

(d)Line 1Line2Line3

(e)Compile Errors

Page 11: PreAP  Computer Science Quiz 02.07-10

Question 09What is the output of this program? (a)

Line 1Line 2Line 3

(b)Line 1

Line 3

(c)Line 1Line 2Line 3

(d)Line 1Line2Line3

(e)Compile Errors

public class Java0203{

public static void main(String args[])

{ System.out.print("Line

1"); System.out.print("Line

2"); System.out.print("Line

3");}

}

Page 12: PreAP  Computer Science Quiz 02.07-10

Question 10What is the output of this program? (a)

Line 1Line 2Line 3

(b)Line 1

Line 3

(c)Line 1Line 2Line 3

(d)Line 1Line2Line3

(e)Compile Errors

public class Java0204{

public static void main(String args[])

{ System.out.println("Line

1"); System.out.println( ); System.out.println("Line

3");}

}

Page 13: PreAP  Computer Science Quiz 02.07-10

Question 11What is the output of this program? (a)

Line 1Line 2Line 3

(b)Line 1

Line 3

(c)Line 1Line 2Line 3

(d)Line 1Line2Line3

(e)Compile Errors

public class Java0205{

public static void main(String args[])

{ System.out.println("Line

1") System.out.println("Line

2") System.out.println("Line

3")}

}

Page 14: PreAP  Computer Science Quiz 02.07-10

Question 12What is the output of this program? (a)

Line 1Line 2Line 3

(b)Line 1

Line 3

(c)Line 1Line 2Line 3

(d)Line 1Line2Line3

(e)Compile Errors

public class Java0206{

public static void main(String args[])

{ System.out.print("Line

1"); System.out.println("Line

2"); System.out.println("Line

3");}

}

Page 15: PreAP  Computer Science Quiz 02.07-10

Question 13What is the output of this program? (a)

Line 1Line 2Line 3Line 4Line 5Line 6Line 7

(b)Line 1Line 3Line 4Line 5Line 7

(d)Line 1Line 2Line 6Line 7

(c)Line 2Line 6

(e) Compile Errors

public class Java0207{

public static void main(String args[])

{ System.out.println("Line

1");// System.out.println("Line 2");

System.out.println("Line 3");

System.out.println("Line 4");

System.out.println("Line 5");// System.out.println("Line 6");

System.out.println("Line 7");

}}

Page 16: PreAP  Computer Science Quiz 02.07-10

Question 14What is the output of this program? (a)

Line 1Line 2Line 3Line 4Line 5Line 6Line 7

(b)Line 1Line 3Line 4Line 5Line 7

(d)Line 1Line 2Line 6Line 7

(c)Line 2Line 6

(e) Compile Errors

public class Java0208{

public static void main(String args[])

{ System.out.println("Line

1"); System.out.println("Line

2");/* System.out.println("Line 3");

System.out.println("Line 4");

System.out.println("Line 5"); */

System.out.println("Line 6");

System.out.println("Line 7");

}}

Page 17: PreAP  Computer Science Quiz 02.07-10

Question 15What is the output of this program? (a)

Line 1Line 2Line 3Line 4Line 5Line 6Line 7

(b)Line 1Line 3Line 4Line 5Line 7

(d)Line 1Line 2Line 6Line 7

(c)Line 2Line 6

(e) Compile Errors

public class Java0209{

public static void main(String args[])

{// System.out.println("Line 1");

System.out.println("Line 2");/* System.out.println("Line 3");

System.out.println("Line 4");

System.out.println("Line 5"); */

System.out.println("Line 6");// System.out.println("Line 7");

}}

Page 18: PreAP  Computer Science Quiz 02.07-10

Question 16In order to compile, what namemust this program have?

(a)Java0206.java

(b)Java0206.html

(c)Java0206.exe

(d)Any file that endswith .java

(e)Any file name. The file name does not matter.

public class Java0206{

public static void main(String args[])

{ System.out.print("Line

1"); System.out.println("Line

2"); System.out.println("Line

3");}

}

Page 19: PreAP  Computer Science Quiz 02.07-10

Question 17Java source code files end with

(a) .class(b) .exe(c) .html(d) .java(e) .rbt

Page 20: PreAP  Computer Science Quiz 02.07-10

Question 18Java bytecode files end with

(a) .class(b) .exe(c) .html(d) .java(e) .rbt

Page 21: PreAP  Computer Science Quiz 02.07-10

Question 19Which of the following icons will only compile a Java program?

(a) (b) (c) (d)(e)

Page 22: PreAP  Computer Science Quiz 02.07-10

Question 20Which of the following icons will execute a Java program?

(a) (b) (c) (d)(e)

Page 23: PreAP  Computer Science Quiz 02.07-10

Question 21What is the “Number 1 source of grief” for many students when it comes to computers?

(a) Physical damage to the computer(b) Loss of data(c) Loss of equipment(d) AVR

Page 24: PreAP  Computer Science Quiz 02.07-10

Question 22Which of the following describes computer viruses?

(a) Malicious programs(b) Programs that copy themselves to other

computers(c) Programs that have been used in warfare to

disable enemy computers(d) All of the above

Page 25: PreAP  Computer Science Quiz 02.07-10

Question 23From a legal and ethical standpoint, copying copyrighted software is considered

(a) stealing – as in felony theft.

(b) no big deal.

Page 26: PreAP  Computer Science Quiz 02.07-10

Question 24Even if your computer has the best security, which of the following will leave your computer vulnerable?

(a) Changing your password often(b) Leaving your computer unattended(c) Saving often(d) Frequently backing up your files

Page 27: PreAP  Computer Science Quiz 02.07-10

Question 25If you are foolish enough to make an unethical choicewhen using a computer, what can happen to you?

(a) You can be charged with a felony.

(b) You may never be able to get a decent job because you have a felony on your record.

(c) You will not be able to take care of your family because you cannot get a decent job.

(d) You will never be able to vote or adopt children.

(e) All of the above

Page 28: PreAP  Computer Science Quiz 02.07-10

Extra CreditWhich of the following statements is false?

(a) Simply attempting to hack into another computer or network is a misdemeanor.

(b) If you successfully hack into another computer or network, you have already committed a felony, even if you do not do anything else.

(c) Companies are reluctant to prosecute minors.

(d) Some hackers who think they are “just visiting” do not even realize that viruses are being released by the hacking software they downloaded.