Previous Next
0 / 15
Module DEMO-33-69DEMO-OOP-33

Course Grade Object

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create two Java files: Main.java and CourseGrade.java.

Read the required values, construct a CourseGrade object, and print a multiline report.

The report must contain these lines in this order:

  1. Course
  2. Average
  3. Result

Use a constructor and keep the object-oriented structure clear.

Input Format

Input is provided as separate whitespace-separated tokens in the same order described in the problem statement.

Output Format

Print the exact multiline report required by the question.

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
CS1
70
80
90
Course: CS1
Average: 79.00
Result: PASS
Input: course code = "CS1", midterm mark = 70, final exam mark = 80, project mark = 90.
Key calculation(s): "Course: " + "CS1" = "Course: CS1" | "Average: " + String.format("%.2f", (70 * 0.3) + (80 * 0.5) + (90 * 0.2)) = "Average: 79.00".
Output:
Course: CS1
Average: 79.00
Result: PASS
Sample #2
Public sample
MTH
40
45
50
Course: MTH
Average: 44.50
Result: FAIL
Input: course code = "MTH", midterm mark = 40, final exam mark = 45, project mark = 50.
Key calculation(s): "Course: " + "MTH" = "Course: MTH" | "Average: " + String.format("%.2f", (40 * 0.3) + (45 * 0.5) + (50 * 0.2)) = "Average: 44.50".
Output:
Course: MTH
Average: 44.50
Result: FAIL

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings