What is the productive programming cycle?
A reliable cycle is to understand the problem, plan an algorithm, implement it, test it, debug and improve it, and explain why it works.
Study Java Foundations and Program Design with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is the productive programming cycle?
A reliable cycle is to understand the problem, plan an algorithm, implement it, test it, debug and improve it, and explain why it works.
Where does a Java application begin execution?
Execution begins in the `main` method: `public static void main(String[] args)` in a Java application.
How should a public Java class be named on disk?
Normally, a public class named `Greeting` must be saved in a file named `Greeting.java`.
What is the difference between declaration and assignment?
A declaration gives a variable its type and name; an assignment stores a value in it. For example, `int score;` declares, while `score = 95;` assigns.
Which Java types fit whole numbers, decimals, logic, characters, and text?
Use `int` for whole numbers, `double` for decimals, `boolean` for logical values, `char` for one character, and `String` for text.
What value does `8 + 4 * 2` produce?
`16`. Multiplication is evaluated before addition, so `4 * 2` is calculated before `8 + 8`.
How do integer division and remainder differ in Java?
With two `int` operands, `/` performs integer division and discards the fractional part; `%` returns the remainder. Thus, `7 / 2` is `3` and `7 % 2` is `1`.
What is `(int) 9.99`?
`9`. Casting `9.99` to `int` removes the fractional portion; it does not round the value.
What does `"Average: " + (5 + 10) / 2.0` produce?
`Average: 7.5`. Parentheses make Java add `5 + 10` before dividing by `2.0`, then concatenate the result with the label.
How do `print` and `println` differ?
`print` displays text without moving to a new line; `println` displays text and then moves to the next line.
Why can `nextInt()` followed by `nextLine()` be surprising?
`nextInt()` reads an integer token, while `nextLine()` reads the rest of the current line. After `nextInt()`, an extra `nextLine()` may be needed to consume the remaining line break.
What are the three stages of a basic Java program?
Read the data, process it with expressions and assignments, then display the result. This is the input–process–output pattern.
A progressive guide to how computing reshapes culture, economic life, public institutions, and individual opportunities, with frameworks for evaluating digital equity, bias, cybersecurity, encryption, and collective participation.
A medium-difficulty assessment of programming fundamentals, algorithmic problem solving, control flow, data structures, testing, debugging, complexity, and decidability. Questions progress from foundational understanding to applied reasoning.
A 14-question quiz on the social, economic, privacy, informational, health, and environmental risks of computing innovations, including strategies for responsible design and oversight.
A practical guide to recognizing cybersecurity threats, protecting accounts and devices, and responding safely when information or systems may be compromised.
A guided introduction to how encryption, authentication, hashing, secure protocols, and key management establish confidentiality, integrity, privacy, and trust while creating practical and legal trade-offs.
A focused review of propositional logic, quantifiers, sets, relations, functions, and foundational proof methods in discrete mathematics for computer science.
A practical guide to evaluating computing innovations by examining their benefits, risks, equity, security, participation, and long-term effects on people and communities.
A medium-difficulty quiz on integrating problem definition, representation, algorithms, complexity analysis, testing, correctness, ethical evaluation, and documentation in a computer science capstone.
A progressive guide to designing, operating, and testing systems that continue useful service despite component faults, overload, data loss, and recovery challenges.
A medium-difficulty quiz on how independently operated networks, protocols, addresses, naming systems, transport services, and routing mechanisms work together to form the Internet.
A progressive guide to how packet-switched networks encapsulate data, move it across links, and manage delay, throughput, queues, and congestion.
A structured guide to designing parallel and distributed systems through decomposition, communication, coordination, state management, scalability, and fault tolerance.