THINK FIRST·CODE LATER

← All labs

Your course card: println, print and escape sequences

Problem

Write a class CourseCard that prints exactly this card:

+----------------------------+
| CPS 1231  "Java Programming" |
| Room:	GEH-A205             |
| Path:	C:\cps1231\labs      |
+----------------------------+
Think first. Code later.
Hours per week: 5
Hours per week: 32
  • The quotes, the backslashes and the tab after Room: and Path: must be produced with escape sequences (\", \\, \t).
  • Print Think first. and Code later. with two print statements on the same line, then end the line.
  • The last two lines both start from "Hours per week: " followed by 3 and 2: one prints 5, the other prints 32. Explain why.

Write it here or in your IDE, then paste it. Compile and test it yourself before comparing. Your code stays in your browser — it is never sent to or stored on the server.