0
0
C Sharp (C#)programming~15 mins

Naming conventions in C# - Mini Project: Build & Apply

Choose your learning style9 modes available
Naming conventions in C#
📖 Scenario: You are creating a simple program to store information about a book in a library system. To keep your code clear and easy to read, you will use proper naming conventions in C#.
🎯 Goal: Learn how to name variables, constants, and methods in C# using the correct naming conventions.
📋 What You'll Learn
Create variables with camelCase naming
Create constants with PascalCase naming
Create a method with PascalCase naming
Use meaningful names following C# conventions
💡 Why This Matters
🌍 Real World
Naming conventions help developers read and understand code quickly, especially in team projects or large codebases.
💼 Career
Following naming conventions is a basic skill expected in software development jobs to write clean, professional code.
Progress0 / 4 steps
1
Create variables with camelCase naming
Create three variables named bookTitle, authorName, and numberOfPages with these exact values: "The Great Gatsby", "F. Scott Fitzgerald", and 180 respectively.
C Sharp (C#)
Need a hint?

Remember, variables in C# use camelCase, starting with a lowercase letter.

2
Create constants with PascalCase naming
Add two constants named MaxBooksAllowed and LibraryName with values 5 and "City Library" respectively. Use the const keyword.
C Sharp (C#)
Need a hint?

Constants use PascalCase and the const keyword.

3
Create a method with PascalCase naming
Create a method named DisplayBookInfo that takes no parameters and returns void. Inside the method, write code to print the bookTitle and authorName variables using Console.WriteLine.
C Sharp (C#)
Need a hint?

Methods use PascalCase and start with a capital letter.

4
Call the method and display output
Call the DisplayBookInfo method to print the book information.
C Sharp (C#)
Need a hint?

Just write DisplayBookInfo(); to call the method.