Computer Fundamentals and Java Programming Concepts, Exams of Computer Science

A wide range of computer fundamentals and java programming concepts, including topics such as computer hardware, software, networks, data storage, and java programming basics. It provides explanations and answers to various questions related to these topics, making it a valuable resource for students and learners interested in understanding the fundamental principles of computing and java programming. The document delves into topics like morse code, memory types, computer components, software categories, network types, java tools and features, object-oriented programming concepts, and more. With its comprehensive coverage and detailed explanations, this document could serve as a study guide, lecture notes, or reference material for those seeking to gain a solid foundation in computer science and java programming.

Typology: Exams

2023/2024

Available from 08/07/2024

dillon-cole
dillon-cole šŸ‡ŗšŸ‡ø

4.3

(6)

2.1K documents

1 / 32

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
AP Computer Science Examination 2024 with Revised
Answers
What advantages do computers have over humans? - Correct answer
Faster, more accurate, better memory
Many so-called computer errors are caused by: - Correct answer
sloppy data entry
How does Morse Code work? - Correct answer It uses short and long
signals, representing dots and dashes
How does the binary system used by a computer work? - Correct
answer It uses 1s and 0s, representing electrical current that is on or off
Which of the following describes ASCII? - Correct answer It uses 1 byte
to store a character and is used by many programming languages
Which of the following describes Unicode? - Correct answer It uses 2
bytes to store a character and is used by Java
How BITs are in a byte? - Correct answer 8
What number system do people in America use? - Correct answer
Base-10 (decimal)
What number system does the computer use to process information? -
Correct answer Base 2 (binary)
What did early computers used to store each bit? - Correct answer A
vacuum tube
Characteristics of early computers - Correct answer very large,
programmed by people switching wires, used vacuum tubes
Characteristics of modern computers - Correct answer small enough to
fit on a desk, programmed with languages like Java, use microchips
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download Computer Fundamentals and Java Programming Concepts and more Exams Computer Science in PDF only on Docsity!

AP Computer Science Examination 2024 with Revised

Answers

What advantages do computers have over humans? - Correct answer Faster, more accurate, better memory Many so-called computer errors are caused by: - Correct answer sloppy data entry How does Morse Code work? - Correct answer It uses short and long signals, representing dots and dashes How does the binary system used by a computer work? - Correct answer It uses 1s and 0s, representing electrical current that is on or off Which of the following describes ASCII? - Correct answer It uses 1 byte to store a character and is used by many programming languages Which of the following describes Unicode? - Correct answer It uses 2 bytes to store a character and is used by Java How BITs are in a byte? - Correct answer 8 What number system do people in America use? - Correct answer Base-10 (decimal) What number system does the computer use to process information? - Correct answer Base 2 (binary) What did early computers used to store each bit? - Correct answer A vacuum tube Characteristics of early computers - Correct answer very large, programmed by people switching wires, used vacuum tubes Characteristics of modern computers - Correct answer small enough to fit on a desk, programmed with languages like Java, use microchips

In computers, the main circuit board with all the primary computer components is called the - Correct answer motherboard Types of computer chips - Correct answer Ram, Rom, Cup Which of the following stores permanent information and is not erased when the computer is turned off - Correct answer Rom Which of the following stores temporary information and is erased when the computer is turned off - Correct answer Ram Which is of the following is the brains of the computer - Correct answer Cup How many bytes are in a megabyte - Correct answer 1 million How many bytes are in a terabyte - Correct answer 1 trillion How many bytes are in a kilobyte - Correct answer 1000 How many bytes are in a gigabyte - Correct answer 1 billion Information on a disk or tape is stored magnetically by arranging iron oxide which most people call... - Correct answer rust Which of the following stores/retrieves information using laser light - Correct answer CD-ROM A _______ is a sequence of instructions, which enables a computer to perform a desired task - Correct answer program What language is understood by the computer - Correct answer Machine code Which language is made up of 1s and 0s - Correct answer Machine code Which language will you be learning in APCS - Correct answer Java

Word, PowerPoint, and excel are all examples of - Correct answer Application software Which of the following is a small network where all of the computers are considered equal - Correct answer peer to peer Which of the following networks has at least one dedicated computer to handle services like logging on, network printing, and file sharing - Correct answer client server Copying a file to a USB jump drive and then handing it to a friend for him to copy to his computer is an example of - Correct answer Sneaker net The connection of all the networks in the world is called the - Correct answer internet Advantages of an intranet - Correct answer more speed, more security, less cost How have computers changed over the past 70 years - Correct answer smaller, faster, easier to use, less expensive What motivated the creation of the internet - Correct answer The Department of Defense during the Cold War With ______ information it is always possible to make a precise copy of the original - Correct answer digital A programming language is considered ___________ if program source code created on one type of computer platform can execute on another computer platform without any difficulty - Correct answer platform independent Programs start out as _____ written by a programmer in a somewhat human language, like Java - Correct answer source code Java uses a compiler to translate source code into - Correct answer byte code

Which of the following is like the intermediate language of English in the United Nations analogy - Correct answer byte code Byte code is understood (and executed) by a Java - Correct answer interpreter A java program that is designed to execute inside a web page is called what - Correct answer an applet A java program that is designed to execute inside a stand-alone environment is called what - Correct answer an application Basic Java tools - Correct answer text editor, compiler, interpreter What type of software combines the 3 basic Java tools into one package

  • Correct answer IDE Creator is an example of an - Correct answer IDE What extension do Java source code files have - Correct answer .java What extension do Java byte code files have? - Correct answer .class What extension do most web page files have? - Correct answer .html What does IDE stand for? - Correct answer Integrated Development Environment What does JDK stand for? - Correct answer Java Development Kit Which of the following is true about Java and the AP Computer Science exam? - Correct answer The number of topics available in Java is enormous, and you need to know a subset of these What symbol is the 'escape sequence' for a tab? - Correct answer /t Which symbol is the 'escape sequence' for a back space? - Correct answer /b Java keywords are - Correct answer case sensitive

company's network and copying the information, succeeding in hacking into a company's network and damaging the information Which symbol is used to create a single-line comment - Correct answer // Which symbol is used to begin a multi-line comment - Correct answer /* Which symbol is used to end a multi-line comment - Correct answer *
The print keyword - Correct answer displays text output to the monitor without a carriage return The printing keyword - Correct answer displays text output to the monitor with a carriage return How to tell if a program has been compiled? - Correct answer If the file name ends in .class System.out.println("Computer Science"); - Correct answer Computer Science System.out.println("Computer"); System.out.println("Science"); - Correct answer Computer Science System.out.print("Computer"); System.out.print("Science"); - Correct answer Computer Science //System.out.println("Computer"); //System.out.println("Science"); - Correct answer No output System.out.println("Computer"); System.out.println(); System.out.println("Science"); - Correct answer Computer Science System.out.print("The "); //System.out.print("quick ");

System.out.print("brown "); System.out.print("fox "); System.out.print("jumps "); System.out.print("over "); System.out.print("the "); //System.out.print("lazy "); System.out.print("dog "); - Correct answer The brown fox jumps over the dog System.out.print("The "); System.out.print("quick "); System.out.print("brown "); System.out.print("fox "); System.out.print("jumps "); /*System.out.print("over "); System.out.print("the "); System.out.print("lazy "); System.out.print("dog "); \ - Correct answer The quick brown fox jumps System.out.print("The "); /System.out.print("quick "); System.out.print("brown "); *
System.out.print("fox "); System.out.print("jumps "); System.out.print("over "); System.out.print("the "); //System.out.print("lazy "); System.out.print("dog "); - Correct answer The fox jumps over the dog System.out.print("The "); System.out.print("quick "); System.out.print("brown "); System.out.print("fox "); System.out.print("jumps "); System.out.print("over "); System.out.print("the "); // sistim.OWT.pWintLINE('incredibly "] System.out.print("lazy "); System.out.print("dog "); - Correct answer The quick brown fox jumps over the lazy dog

Java has ____ binary integer arithmetic operations - Correct answer five in number = 100 / 3; - Correct answer 33 in number = 100 % 3; - Correct answer 1 Which of the following are Java real number data types? - Correct answer double and float Which real number data type is the most accurate? - Correct answer double Which of the following is not a common binary arithmetic operator for real numbers? - Correct answer % Java allocates _____ bytes of memory for its largest real number data type - Correct answer eight Unary operators can be written in ____ style - Correct answer prefix, postfix, infix The expression ++q will _______ execute the same as the expression q++ - Correct answer always (PROVIDED that q is an in data type) in x= 10; System.out.println(x); x+= ++x + x++; System.out.println(x); - Correct answer The syntax is correct, the segment will display two values for variable x, and this segment displays a program style, which should not be used numb += 10 - Correct answer numb = numb + 10 numb = numb * 100 - Correct answer numb =100; Which of the following are the binary operator shortcuts - Correct answer =+ =- = =/ =%

in q=10; System.out.print(q + " "); q+= 20; System.out.println(q); q*= 5; - Correct answer 10 30 char c1 = 'A'; char c2 = 'B'; char c3 = 'C'; System.out.println(c1+c2+c3); c1=c2=c3= 'Q'; System.out.println(c1+c2+c3); - Correct answer ABC QQQ in age= 25; String first Name = "John"; String last_name = "Doe"; System.out.println(first Name + lastName+age); - Correct answer JohnDoe in age= 25; String first Name = John; String last_name = Doe; System.out.println(first Name + " " + last_name+ " " + age); - Correct answer Error Message in age= 25; String first Name = "John"; String last_name = "Doe"; System.out.println(first Name + " " last_name+ " " + age); - Correct answer John Doe 25 in age= 25; String first Name = "John"; String last_name = "Doe"; System.out.println(first Name + "\n" + last_name+ "\n" + age); - Correct answer John Doe 25

What does (double) mean - Correct answer The answer can have decimal points in var1 = 65; char v2= (char) var1; double var3 = (double) var2; System.out.println(var1+ " " + var 2 + " " + var3); - Correct answer 65 A

Are float and double covered on the AP exam - Correct answer Yes Which of the following are Java keywords - Correct answer reserved word, predefined identifiers, user defined identifiers How to subtract 1 from x - Correct answer x--; --x; x-=1; x=x-1; How to double x - Correct answer x=2; x+=x; x=x2; x=mx+b What was true about the Cryptic Programming Stage? - Correct answer Computers were extremely expensive, programmer salaries were very low, and programs were designed for future updates Spaghetti Programming is categorized by the use of - Correct answer the got statement Structured Programming is categorized by the use of - Correct answer modules to combine program statements used for a common purpose Object Oriented Programming is categorized by the use of - Correct answer classes and objects Which of the following program features are part of OOP? - Correct answer Encapsulation, polymorphism, class interaction What is encapsulation? - Correct answer Combining data and the actions that access the data inside the same module The statement "a square is a rectangle" is an example of - Correct answer class interaction with inheritance

OOP ......... - Correct answer makes programs more reliable, simulates real life, uses a lot of intimidating vocabulary (which is not as bad as it sounds) The actions in a Java class are called - Correct answer methods Which of the following program statements uses sort correctly? - Correct answer System.out.println(Math.sqrt(16)); Which of the following Math class features converts real numbers to integers? - Correct answer floor, ceil, round Which of the following keywords are not methods? - Correct answer PI, E, final in result = Math.pow(5,2); - Correct answer 25 in result = Math.pow(-2,2); - Correct answer 4. in result = Math. Ax(4,3); - Correct answer 4 in result = Math. Ax(3,4); - Correct answer 4 in result = Math. In(Math. Ax(11,22), Math. Ax(33,44) - Correct answer 22 When you round with Math. Floor.... - Correct answer round down to the nearest number When you round with Math. Ceil... - Correct answer round up to the nearest number When you round with Math. Round... - Correct answer follow regular rounding rules (when the number is 5 or greater, round up) in a = 25; in b = 16; in result = Math.sqrt(Math. Abs(b-a)); - Correct answer ABS takes the absolute value of b-a

In an 800 x 600 applet window: Which command will draw one single pixel? - Correct answer g.drawLine(100,200,100,200); In an 800x600 applet window: Which command will make the entire applet window red? - Correct answer g.setColor(Color. Red); g.fillRect(0,0,800,600); The draw Oval method uses the exact same parameters as what 3 other methods? - Correct answer fill Oval, drawers, fillet If you are using the draw Arc command, and the 3rd and 4th parameters are not equal, and the last parameter is 360, what will you draw? - Correct answer An oval If you are using the draw Arc command, and the 3rd and 4th parameters are equal, and the last parameter is 180, what will you draw? - Correct answer A semi-circle In an 800 x 600 applet window: Which of the following commands will display a message near the bottom of the screen? - Correct answer drawstring("APCS is awesome!", 200, 550); Which of the following are the three general types of control structures?

  • Correct answer simple sequence, selection, repetition Selection is also called - Correct answer conditional branching or decision making Which of the following are types of selection control structures? - Correct answer One way selection, two way selection, multiple way selection A repetition control structure - Correct answer requires a conditional statement A conditional statement is - Correct answer a program expression that evaluates to true or false

Which of the following sentences can be translated into a conditional statement? - Correct answer If you are a national merit finalist, you will receive a scholarship Which of the following is the relational operator meaning "not equal to" - Correct answer != Which of the following is not a relational operator - Correct answer = Which of the following Java key keywords are used for one way selection? - Correct answer if only If a program has indented program statements, what does this do to the program???? - Correct answer Absolutely nothing. Indentions do not alter program logic double bonus = 500.0; double sales = 200000.0; if (sales >= 300000.0) bonus += 250.0; System.out.println("Bonus: " + bonus); System.out.println("The End"); - Correct answer Bonus: $500. The End double bonus = 500.0; double sales = 200000.0; if (sales >= 300000.0) System.out.println("Bonus: " + bonus); bonus += 250.0; - Correct answer No output Which of the following Java keywords are used for two way selection? - Correct answer if.... else Which of the following Java keywords are used for multiple way selection? - Correct answer switch, case, break, default The 'for' loop structure uses what kind of repetition? - Correct answer fixed

The methods in the Decimal Format class are - Correct answer object methods Access to methods of the Bank class requires - Correct answer the creation of one of more Bank objects A class is - Correct answer a data type An object is - Correct answer a variable The new keyword must be used with - Correct answer the construction of each object The Random class is found inside the ________ package - Correct answer java.util Assume that rand is an object of the Random class. which of the following statements controls the generation of the random numbers, such that each execution generates the same sequence of numbers? - Correct answer rand.setSeed(3333); and Random rand= new Random(3333); Which of the following statements generates a random number in the [1- 1000] range? - Correct answer in number = rand.nextInt(1000) + 1; Which of the following statements generates a random number in the [200-600] range? - Correct answer in number = rand.nextInt(401)+200; Which of the following statements generates a random number in the [41-101] range? - Correct answer in number = rand.nextInt(61)+41; Which of the following statements generates a random number in the [- 101 to -41] range? - Correct answer in number= rand.nextInt(61)-101; in number= rand.nextInt(1201)+400; - Correct answer [400....1600] in number= rand.nextInt(72)-57; - Correct answer [57....128] in number= rand.nextInt(250)-125; - Correct answer [-124....124]

Which of the following statements generates a random character in the [A-Z] range? - Correct answer char letter= (char) rand.nextInt(26)+ The Math. Random method generates a random number x, such that - Correct answer 0 <=x< Numbers generated by a call to Math. Random() are in the same range as numbers called by - Correct answer rand.nextDouble(); The Decimal Format class is found inside the ______ package - Correct answer java. Text The Decimal Format class has the ability to - Correct answer round off decimal numbers to a specified number of digits, format numbers with leading zeroes, format numbers with trailing zeroes The kind of output created by an object of the Decimal Format class is determined by - Correct answer the type of parameter used with the construction of a new Decimal Format object The wrapper class creates objects capable of - Correct answer wrapping multiple classes inside one object Which of the following statements constructs an Integer object correctly?

  • Correct answer Integer ob. = new Integer(100); A feature in Java version 5.0 and later, which automatically handles wrapping, but is not used on the AP Computer Science Examination is called - Correct answer auto-boxing Integer.MAX_VALUE and Integer.MIN_VALUE are examples of - Correct answer constant fields or attributes What are the 3 primary colors capable of being displayed on a computer monitor? - Correct answer red, green, blue Which of the following is using an anonymous object? - Correct answer g.setColor(new Color(20,200,20));