AP Computer Science - Java Programming CH 7 Quiz and Solutions

in #tutorials7 years ago

APCSLogo.png

Java Programming CH 7 Quiz

True/False:

____ 1. To initialize a new array we can use: int[] list = new int[4];
____ 2. A single array variable can reference a large set of data.
____ 3. int[] list = new int[4] has elements list[1], list[2], list[3], list[4].
____ 4. Double [] myList = {2.0, 4.5, -6.3}; myList.add(3.5,2); // New array {2.0, 4.5, 3.5, -6.3}
____ 5. myList[i] - -; is equivalent to myList[i] = myList[i] – 1;
____ 6. You can print a list using System.out.print(myList);
____ 7. char[][] charArray = new char[3][5] makes an array with 3 columns and 5 rows.
____ 8. A for loop can contain a colon in it (:) to loop through rows.
____ 9. In the array below mat[2] = {1, 6, 3, 4}
1 7 -8 9
1 6 3 4
3 -5 7 2
____ 10. String[][] strs = new String[2][5] could look like this:
“Hello” “Nope” “Hello” “Nope” “Goodbye”
“Goodbye” “Nope” “Hello” “Goodbye” “Hansen”

Short Answer

Short Answer:

  1. What does this section of code do?
  2. If I were to enter the numbers 4 3 2.5 -6, what would the code above print?

Solutions

  1. True
  2. True
  3. False
  4. False
  5. True
  6. False
  7. False
  8. True
  9. False
  10. True

  1. It takes an array of length 4 from the user and prints it.
  2. 4.0 3.0 2.5 -6.0 // They all have a decimal point because they are doubles (Rational numbers).
    BAR.png

All SteemitEducation Posts

Physics

Kinematics Video, Circular Motion Video, Forces in 1 & 2 Dimensions Videos, Kinematics Full Lesson, Circular Motion and Gravitation Full Lesson, Kinematics and Forces Quiz, Forces in 1-Dimension, Forces in 2-Dimensions, Basic Physics, Kinematics, and Forces Review, AP Physics Midterm Exam, AP Physics Midterm Exam Solutions

Computer Science

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17

SAT

Asymptotes, Composite Functions, Contest 1 - Area, Contest 1 – Winners and Solution, PEMDAS, Systems of Equations, Functions, Exponents, Contest 2 - More Functions, Contest 2 – Winners and Solution, Percents, The Interest Equation, All About Division, Contest 3 - Factoring, Contest 3 – Winners and Solution, Fractional and Negative Exponents, Basic Trig, Contest 4 - Math Vocab, Contest - 5, Contest 5 – Winners and Solution, Contest 6, Contest 6 – Winners and Solution

General Math

Basics of Algebra, Trigonometry Video, Proof of Quadratic Formula, Factoring Video, Unions and Intersections, Surface Area of a Cylinder, Substitution Video, Combinatorics Basics

Graphing from Algebra to Calculus

Algebra 1, Algebra 2, Pre-Calculus, Calculus

Piloting Airplanes

Introduction, Preflight, Requirements, Instruments, Take-Offs and Landings, Why a Plane Can Fly, Reading the Runway, Maneuvers

Other

Engineering (Isometric) Drawing, Pressure & SCUBA Diving

BAR.png

Learn much my friends! Best wishes to the fellow Steemers!

STMEdu.gif

CloudLogo.gif

Sort:  

Thank you for posting @hansenator.

Appreciate your commitment to bringing these tutorials to Steemit.

All the best. Cheers.

NB Thank you very much for the reSteem.

Thank you bleujay. Any time on the re-steem! My class will be moving into electricity soon, which is a lot of fun for me. Educate the world, we must do! See you soon!

thanks for sharing with us :)

Glad to see you again Claira!

awesome hekpful post dear friend @hansenator

More to come khurshid! See you again soon!

thnx for appreciate word dear friend @hansenator

This post has received 50% upvote from @minnowspower thanks to: @theguruasia

MinnowsPower is not a bot, I am a Crowdfunding Hybrid

thanks for your solution friend @hansenator

Thank you rey! Next up is Oscillation and Pendulums!