logo

Crowdly

Browser

Додати до Chrome

PROGRAMMING 731(2025S1PRO731D)

Шукаєте відповіді та рішення тестів для PROGRAMMING 731(2025S1PRO731D)? Перегляньте нашу велику колекцію перевірених відповідей для PROGRAMMING 731(2025S1PRO731D) в learning.richfield.ac.za.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

2.2 Write a Java program that:

  • Creates an ArrayList<String> to store names of five programming languages.
  • Adds the following languages to the list: "Java", "Python", "C++", "JavaScript", "Ruby".
  • Replaces "C++" with "C#" in the list.
  • Displays all the elements of the updated list
  • Displays the total number of elements in the list.

(15 marks)

Переглянути це питання

2.1 Study the code below. Identify all lines that contain errors. For each error, provide the line number and provide corrected code.

(15 marks)

Переглянути це питання

3.2

    

6.      Given the code above, implement the abstract methods in the Novel class as follows:

          a)            calculateRentalFee()

·         Base fee is $3.50

·         If the book is less than 5 years old, add $2.00

·         If the book is between 5 and 10 years old, add $1.00

·         Add $0.50 for every 100 pages (round up to the next 100)

·         If the genre is "Bestseller" or "New Release", add a 20% premium to the total fee

·         Return the final fee rounded to two decimal places

 getBookInfo()

·         Format book details as "Novel: [Title] by [Author] (Year), Genre: [Genre], [Pages] pages"

c)      Given the following main method create test objects and demonstrate your implementation

 

·         Create at least two Novel objects with different properties

·         Print their information using getBookInfo()

·         Display the rental fees

(25 marks)

Переглянути це питання

3.1 Write a Java program that:

  1. Creates a 2D array of integers with 3 rows and 4 columns.
  2. Initializes the array with the following values, where each row represents a student’s marks and each column represents a specific module:

  1. Calculates and prints the total marks for each row (for each student).
  2. Displays the result in the following format:

(25 marks)

Переглянути це питання

1.4 Describe the concept of encapsulation in Object-Oriented Programming (5 marks)

Переглянути це питання

1.3 Define method overriding and explain its relationship with polymorphism (5 marks)

Переглянути це питання

1.2 Differentiate between Arrays and ArrayLists (5 marks)

Переглянути це питання

1.1 Define Exception Handling and explain why it is necessary (5 marks)

Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на learning.richfield.ac.za?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome