Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CSE 2221 Midterm 2 2025: RSS and NaturalNumber Solutions, Exams of Advanced Education

A comprehensive set of questions and verified solutions for cse 2221 midterm 2 2025, covering topics related to rss feeds and the naturalnumber component family in java. It includes detailed explanations of concepts, code examples, and answers to various questions, making it a valuable resource for students preparing for the exam.

Typology: Exams

2024/2025

Available from 03/03/2025

N-U-R-S-E
N-U-R-S-E 🇺🇸

2

(2)

3.3K documents

1 / 38

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Page | 1
CSE 2221 MIDTERM 2 2025 QUESTIONS
AND VERIFIED SOLUTIONS| ABSOLUTE
SUCCESS GUARANTEED.
17. A textual format used on the web for "news feeds" or "web feeds" is... -
Correct Answer-RSS
17. Relationship of RSS to XML - Correct Answer-RSS 2.0 feed is well-
formed XML
17. What is the first line of code in every RSS feed? - Correct Answer-<rss
version="2.0">
17. There are exactly how many channel nodes? - Correct Answer-One
17. What three elements are required under channel? - Correct Answer-
title, link and description
17. Which one of the three required elements under channel, MUST have a
child? - Correct Answer-link
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26

Partial preview of the text

Download CSE 2221 Midterm 2 2025: RSS and NaturalNumber Solutions and more Exams Advanced Education in PDF only on Docsity!

CSE 2221 MIDTERM 2 2025 QUESTIONS

AND VERIFIED SOLUTIONS| ABSOLUTE

SUCCESS GUARANTEED.

  1. A textual format used on the web for "news feeds" or "web feeds" is... - Correct Answer-RSS
  2. Relationship of RSS to XML - Correct Answer-RSS 2.0 feed is well- formed XML
  3. What is the first line of code in every RSS feed? - Correct Answer-
  4. There are exactly how many channel nodes? - Correct Answer-One
  5. What three elements are required under channel? - Correct Answer- title, link and description
  6. Which one of the three required elements under channel, MUST have a child? - Correct Answer-link
  1. What can be a child of channel, apart from the three required tags? - Correct Answer-item
  2. What are the required children of every item tag? - Correct Answer-title OR description
  3. Which two children MUST have children - Correct Answer-link and pubDate
  4. What is the only child of the rss node? - Correct Answer-channel
  5. The ________ component family allows you to manipulate natural numbers - Correct Answer-NaturalNumber
  6. What is NaturalNumber's upper bound? - Correct Answer-There is no upper bound
  7. 3 methods in the Standard class - Correct Answer-clear newInstance transferFrom
  1. NaturalNumber-Kernel extends what? - Correct Answer-Standard
  2. NaturalNumber-Kernel ________ Standard - Correct Answer-extends
  3. What extends Standard - Correct Answer-NaturalNumber-Kernel
  4. Separating the ______ into their own interface means that these highly reused methods are described in exactly one place - Correct Answer- standard methods
  5. Separating the standard methods into their own interface means what?
  • Correct Answer-That these methods are described in exactly one place
  1. "Separating the standard methods into their own interface means that these highly reused methods are described in exactly one place" What is this design goal called - Correct Answer-Single point of control over change
  1. The interface ___________ has all other methods that are convenient to have in the NaturalNumber component family - Correct Answer- NaturalNumber
  2. What are the methods inside of NaturalNumber called? - Correct Answer-Secondary methods
  3. Which methods are typically more "powerful"? NaturalNumber-Kernel or NaturalNumber? - Correct Answer-NaturalNumber methods
  4. Lower bound of NaturalNumber - Correct Answer- 0
  5. What are the four constructors for each implementation class? - Correct Answer-No-argument Constructor (no parameters) Copy Constructor (NaturalNumber n) Constructor from int (int i) Constructor from String (String s)
  6. What is n? NaturalNumber n = new NaturalNumber2(); - Correct Answer-n = 0;
  1. What is the receiver in this case? n.add(seven); - Correct Answer-n
  2. What is the method name in this case? n.add(seven); - Correct Answer-add
  3. What is the argument(s) in this case? n.add(seven); - Correct Answer-seven
  4. What method do you call when you want to ensure this = #this + n - Correct Answer-add(n)
  5. What is the return type and the argument(s) in add? - Correct Answer- void add(NaturalNumber n)

m = 10 k = 7 m.add(k) What is m and k? - Correct Answer-m = 17

k = 7

  1. What method do you call when you want to ensure this = #this - n - Correct Answer-subtract(n);
  2. What is the return type and the argument(s) in subtract? - Correct Answer-void subtract(NaturalNumber n)

m = 10 k = 7 m.subtract(k); What are m and k now? - Correct Answer-m = 3 k = 7

  1. What method do you call when you want to ensure this = #this * n? - Correct Answer-multiply(n);
  2. What is the return type and the argument(s) inside of multiply()? - Correct Answer-void multiply(NaturalNumber n)

What method do you call when you want to ensure this = #this ^ (p) - Correct Answer-power(p)

  1. What is the return type and the argument(s) of power()? - Correct Answer-void power(int p)
  2. What is required by the power function? - Correct Answer-p >= 0

m = 10 k = 7 m.power(k) What are m and k? - Correct Answer-m = 10^ k = 7

  1. What method do you use when you want to ensure this ^ (r) <= #this < (this + 1) ^ (r)? - Correct Answer-root(r)
  2. What is the return type and the argument(s) of root()? - Correct Answer-void root (int r)

m = 24 k = 2 m.root(k); What are m and k? - Correct Answer-m = 4 k = 2

m = 25 k = 2 m.root(k) What are m and k? - Correct Answer-m = 5 k = 2

  1. What method do you call when you want to ensure this = n? - Correct Answer-copyFrom(n)
  2. What is the return type and the argument(s) of copyFrom? - Correct Answer-void copyFrom(NaturalNumber n)

m = 10 k = 10 int i = m.compareTo(k); Is i positive, negative or zero? - Correct Answer-zero

  1. What method would you call if you wanted to ensure this = 10 * #this + k? - Correct Answer-multiplyBy10(k)
  2. What is the return type and the argument(s) of multiplyBy10()? - Correct Answer-void multiplyBy10(int i)

m = 10 k = 7 m.multiplyBy10(k) What are m and k? - Correct Answer-m = 107 k = 7

  1. What does #this represent? - Correct Answer-this BEFORE the method was called
  1. What method do you call if you want to ensure #this = 10 * this + [return] AND 0 <= [return] < 10 - Correct Answer- divideBy10()
  2. What is the return type and the argument(s) for divideBy10()? - Correct Answer-int divideBy10() m = 107 int k = m.divideBy10() What are m and k? - Correct Answer-m = 10 k = 7
  3. What method do you call if you want to ensure [return] = (this = 0)? - Correct Answer-isZero()
  4. What is the return type and the argument(s) of isZero()? - Correct Answer-boolean isZero() m = 10

m = 10 NaturalNumber k = m.newInstance(); What are m and k? - Correct Answer-m = 10 k = 0

  1. What method do you call when you want to ensure this = #n n = 0 - Correct Answer-transferFrom(n) m = 10 k = 7 m.transferFrom(k) What are m and k? - Correct Answer-m = 7 k = 0
  2. What method do you call when you want to ensure [return] = [the string representation of this] - Correct Answer-toString()
  3. What is the return type and the argument(s) of toString()? - Correct Answer-String toString()
  1. m = 10 String k = m.toString() What are k and m equal to? - Correct Answer-m = 10 k = "10"
  2. Java types are divided into two different categories - Correct Answer- Primitive types and reference types
  3. Define primitive types - Correct Answer-Built-in types
  4. Define reference types - Correct Answer-Types that were not built in
  5. How do primitive variables and reference variables differ? - Correct Answer-Primitive variables are simply just its value. Reference variables are a reference to an object that contains the value.
  6. What is the reference value? - Correct Answer-the memory address at which the object is stored
  1. Why have mutable types? - Correct Answer-Efficiency purposes
  2. How to check equality for reference types? - Correct Answer-.equals
  3. How to check equality for primitive types? - Correct Answer-== 25.1 A _______ is a group of similar variables, all of the same type and with systematically related names that involve special syntax using [...] - Correct Answer-array 25.1 What is an array? - Correct Answer-a group of similar variables, all of the same type, and with systematically related names that involve special syntax using [...] 25.1 What is an array element? - Correct Answer-A value that acts as a single variable of the type used in the declaration of the array e.g. a[0], a[1] 25.1 How to determine how many array elements are inside of an array? - Correct Answer-a.length

25.1 Are arrays primitive types or reference types? - Correct Answer- reference types 25.1 What happens when you compare two arrays using .equals()? - Correct Answer-It acts as == instead of .equals() 25.1 How should your compare two arrays to determine if they are equal? - Correct Answer-Utilizing the package java.util, use the static method, Arrays.deepEquals() 25.1 Determine if array a[] is equal to array b[] - Correct Answer- Arrays.deepEquals(a,b); returns true is they are equal 25.1 A recommended alternative to arrays - Correct Answer-java.util.List interface with ArrayList implementation 25.2 What are the two important features for the contracts in the APIs for OSU CSE components? - Correct Answer-Parameter modes Two stipulations (flashcard for that elsewhere)