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

bookChallenge: Table Formatter

Oppgave

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

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 2
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

close

bookChallenge: Table Formatter

Sveip for å vise menyen

Oppgave

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 desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 2
single

single

some-alt