Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge: Table Formatter | Text Formatting & Manual Parsing
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C# Strings & Text Processing

bookChallenge: Table Formatter

Uppgift

Swipe to start coding

Write a method that displays a table of product names and prices in neatly aligned columns, using composite formatting or string interpolation.

  • The table must display a header row with "Product" and "Price" column names.
  • Each product name must be left-aligned in its column, and each price must be right-aligned and formatted as currency with two decimal places.
  • The width of the product column must be wide enough to fit the longest product name, plus extra padding for readability.
  • The table must display a separator line under the header.
  • Each product and price pair must appear on its own row.

Lösning

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 2. Kapitel 2
single

single

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

bookChallenge: Table Formatter

Svep för att visa menyn

Uppgift

Swipe to start coding

Write a method that displays a table of product names and prices in neatly aligned columns, using composite formatting or string interpolation.

  • The table must display a header row with "Product" and "Price" column names.
  • Each product name must be left-aligned in its column, and each price must be right-aligned and formatted as currency with two decimal places.
  • The width of the product column must be wide enough to fit the longest product name, plus extra padding for readability.
  • The table must display a separator line under the header.
  • Each product and price pair must appear on its own row.

Lösning

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 2. Kapitel 2
single

single

some-alt