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
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
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.
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
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
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
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
Question 05
Which symbol is used for single-line comments?
(a) //
(b) \\
(c) /*
(d) */
Which symbol is used to start a multi-line comment?
(a) //
(b) \\
(c) /*
(d) */
Question 06
Which symbol is used to end a multi-line comment?
(a) //
(b) \\
(c) /*
(d) */
Question 07
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
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");}
}
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");}
}
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")}
}
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");}
}
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");
}}
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");
}}
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");
}}
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");}
}
Question 17Java source code files end with
(a) .class(b) .exe(c) .html(d) .java(e) .rbt
Question 18Java bytecode files end with
(a) .class(b) .exe(c) .html(d) .java(e) .rbt
Question 19Which of the following icons will only compile a Java program?
(a) (b) (c) (d)(e)
Question 20Which of the following icons will execute a Java program?
(a) (b) (c) (d)(e)
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
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
Question 23From a legal and ethical standpoint, copying copyrighted software is considered
(a) stealing – as in felony theft.
(b) no big deal.
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
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
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.