100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
AP Computer Science Semester 1 Final Exam with correct Answers $10.49   Add to cart

Exam (elaborations)

AP Computer Science Semester 1 Final Exam with correct Answers

 8 views  0 purchase
  • Course
  • AP Computer Science
  • Institution
  • AP Computer Science

AP Computer Science Semester 1 Final Exam

Preview 2 out of 10  pages

  • July 30, 2024
  • 10
  • 2023/2024
  • Exam (elaborations)
  • Questions & answers
  • AP Computer Science
  • AP Computer Science
avatar-seller
millyphilip
AP Computer Science Semester 1 Final Exam
Which is the hexadecimal representation of the binary number 0010 110 1011 1111? - Answer -2CBF
Each 4 digit binary number translates to a single hexadecimal digit. Any value higher than 9 will result in an uppercase letter starting from A.
What are the binary numbers up to the 8th place value? - Answer -128 64 32 16 8 4 2 1
You can solve this for any amount of place values by using the equation 2^n, where n is
the place value. You start with 0 and work your way up to the last place value. This works for other bases such as base 4 as well, just replace the 2 with the new base number.
What is the output of the following program statement?
System.out.println("Total: " + 8 + 3); - Answer -Total: 83
Because the statement starts with a String, the numbers are simply concatenated, not added together.
How many different values can be represented in 7 bits? - Answer -128
You can figure this out for any amount of bits by the equations 2^n, where n is the number of bits.
What is the decimal (base 10) value of the base 4 number 123? - Answer -27
Base 4 place values can be found similarly to binary, where you use 4^n and then solve the number, which would be 1**16 + 2**4 + 3**1 = 27.
Java is platform independent because of the... - Answer -JVM.
What is a JVM? - Answer -A Java Virtual Machine. Each platform has its own JVM that translates bytecode for that platform.
What kind error occurs when you use the wrong formula to calculate the area of a circle? - Answer -Logic error. This is because the machine compiles and has a valid value, but the answer is not correct because of the equation in the program. What kind of error occurs when you misspell a Java keyword or forget a semicolon? - Answer -Compiler error. This is because there is an error in syntax.
What kind of error occurs when you try to send a Bug outside of a grid in GridWorld? - Answer -Runtime error. A program has to do 2 things when it is run by the user, compile
and run. When moving the bug, it gives a value and passes through the compiler. The value is technically valid because it is a coordinate, so that means the compiler can let it
pass through. This can happen when you put in a correct value, but it is out of the range
of possible values. Imagine going to the grocery store and you want to go to aisle 6, but there are only 5 aisles. You can head towards "aisle 6" thinking it exists, but once you get there you realize it's not a valid value. Basically, it is a logical value, but is it not possible to get to.
When you compile your Java program, what is produced besides the output? - Answer -
A bytecode file. The *.class file is bytecode. It is not directly executable. It is translated by the JVM at runtime.
What are some examples of primary memory? - Answer -RAM (Random Access Memory). It is volatile, so if the power shuts off, the memory stored within it is not saved.
What are some examples of secondary memory? - Answer -Hard drive, CD-ROM, Flash
drive, etc. These do not need power in order to continue to store memory.
What are some examples of high-level languages? - Answer -Java, Pascal, C++, COBOL, Fortran, etc.
What are some examples of low-level languages? - Answer -Assembly language, machine code
What is the numeric value of the following expression?
Math.min(Math,pow(2,3),7) - Answer -7
First, it will call Math.pow, which values to 2^3 which values to 8. 8 is bigger than 7, so 7
is the min.
Operators
What is stored in result after the following statement?
double result = 35 % 40; - Answer -35.0
% is modulus, which means the answer is the remainder if the two numbers were divided. Because 35 is less than 40, the remainder is 35. It is also stored as a double, so you need to include the decimal point.
What is stored in result after the following statement?
double results = ; - Answer -6.0

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller millyphilip. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $10.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

73314 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$10.49
  • (0)
  Add to cart