Introduction
The “My Personal Info & Stats Display App” is a beginner friendly C# console project designed to strengthen my understanding of fundamental programming concepts such as data types, literals, and output formatting using Console.WriteLine(). In this project, I explored how to represent different types of data including strings, characters, integers, decimals, and booleans, and how each plays a unique role in programming. By combining these elements, the project displays basic personal details and computed values, helping me understand how C# handles and presents data in real world applications.
Project Description
Create a C# console program that:
- Displays your personal information (using string and char)
- Shows your academic or skill statistics (using int and decimal)
- Indicates if you’ve completed a task or goal (using bool)
- Prints everything neatly formatted in the console window
Step 1: Create Your Project
- In Visual Studio Code, go to the menu bar and select Terminal, then choose New Terminal from the drop-down menu.
-In your terminal type the command and type the** Enter key** on your keyboard
dotnet new console -n MyInfoApp
Explanation:
- dotnet new: tells the .NET SDK to create a new project.
- console: specifies the type of project (a console app that runs in the terminal).
- -n MyInfoApp: sets the name of the project to MyInfoApp.
Result:
- A new folder called MyInfoApp is created, containing files like:
- Program.cs (your main C# file)
- MyInfoApp.csproj (your project configuration file)
- Type the command and press Enter key on your keyboard.
cd MyInfoApp
Explanation:
- cd means “change directory.”
- This moves you into the newly created project folder so you can start working on your code. Result:
- You are now inside the MyInfoApp folder in your terminal.
- Type the command and press Enter key on your keyboard. code .
Explanation:
- code opens Visual Studio Code.
- The . means “open the current folder” (in this case, MyInfoApp).
- Result:
- VS Code opens your project folder, ready for editing and running your app.
Step 2: Type the code to pratice use of string literals and click the play button to run the program.
Line-by-line Explanation
Console.WriteLine("=====================================");
- This prints a line of equal signs on the console — it’s just decoration.
- You can think of it like drawing a border or header line.
Console.WriteLine(" My Personal Info Display App");
- This prints your app title with a few spaces before it.
- The spaces (" ") make the title appear centered visually
Console.WriteLine("=====================================\n");
- This prints another line of equal signs (bottom border),
- and the \n at the end means go to a new line (line break).
- So, it adds one blank line after the header.
string fullName = "Subair Nurudeen Adewale";
string course = "C# Fundamentals at Skill.sch";
string hobby = "Coding and Cloud Projects";
- These create 3 string variables and store text in them:
- fullName holds your name
- course holds your course name
- hobby holds your hobby
- A string is just text inside double quotes " ".
- Console.WriteLine($"Name: {fullName}");
- The $ allows string interpolation, meaning you can insert variable values inside a text using {}.
- So here, {fullName} will be replaced by your actual name.
Console.WriteLine($"Course: {course}");
- Same idea - prints the text and your course variable.
Console.WriteLine($"Hobby: {hobby}\n");
- Prints your hobby, then adds a blank line after it (\n).
Output
Step 3: Type the code to pratice use of **char literals **and click the play button to run the program.
Explanation Step-by-Step
Console.WriteLine("\n======= My Academic Grade ===============\n");
Console.WriteLine() - prints a line to the screen.
- The \n at the start and end means “new line” (a blank line).
- One before: leaves a space above the header.
Creating grade variables
char Mathgrade = 'A';
Char Enggrade = 'B';
char Chemgrade = 'C';
char Phygrade = 'B';
char Biograde = 'C';
char Econgrade = 'A';
char Comgrade = 'A';
- Each line declares a variable that stores a single character (a letter grade).
- char is short for character — it stores exactly one letter, number, or symbol. You must use single quotes ' ' for characters (not double quotes " "). Example:
'A' - valid
"A" - invalid (that’s a string, not a char)
Here, each subject has its own variable:
Variable Subject Value
Mathgrade General Mathematics 'A'
Enggrade English Language 'B'
Chemgrade Chemistry 'C'
Phygrade Physics 'B'
Biograde Biology 'C'
Econgrade Economics 'A'
Comgrade Commerce 'A'
Displaying each subject and its grade
Console.WriteLine($"General Mathematics: {Mathgrade}");
- Uses string interpolation (the $ symbol) so you can mix text with variables.
- The {Mathgrade} is replaced by the value 'A'.
Each following line does the same for other subjects:
- Console.WriteLine($"English Language: {Enggrade}");
- Console.WriteLine($"Chemistry: {Chemgrade}");
- Console.WriteLine($"Physics: {Phygrade}");
- Console.WriteLine($"Biology: {Biograde}");
- Console.WriteLine($"Economics: {Econgrade}");
- Console.WriteLine($"Commerce: {Comgrade}");
Step 4: Type the code to pratice use of **int literals and click the play button to run the program.**
Explanation Step-by-Step
Comment Line
// --- Step 3: Use int literal ---
- Anything that starts with // is a comment — it’s ignored by the compiler.
- It’s used only for notes or explanations to make your code readable.
- This line tells you that this section is demonstrating how to use integer literals.
Integer Variables
int completedProjects = 5;
int xpPoints = 100;
- int (short for integer) is a data type used to store whole numbers — no decimal points.
- Here you are creating two integer variables:
- completedProjects → stores the number 5
- xpPoints → stores the number 100
- “Literals” just means fixed values written directly into the code (e.g. 5 and 100 are int literals because they are constant numbers).
Display Values
Console.WriteLine($"Projects Completed: {completedProjects}");
Console.WriteLine($"XP Earned: {xpPoints}");
Explanation:
- $ → enables string interpolation (mixing text with variable values).
- {completedProjects} and {xpPoints} are replaced by the actual values stored in the variables.
- \n adds a blank line after printing, for cleaner spacing
Output
Step 4: Type the code to pratice use of **decimal and float literals and click the play button to run the program.**
Line-by-Line Explanation
Comment Line
// --- Step 4: Use decimal and float literals ---
- This is a comment (ignored by the computer).
- It tells you this section shows how to use decimal and float values — numbers with decimal points.
Decimal Variable
decimal successRate = 95.8m;
- decimal is a high-precision number type, used when you need very accurate decimal values (like money, percentages, or scientific data).
- The letter m at the end tells C# that 95.8 is a decimal literal.
- Without it, C# would think it’s a double and show an error.
- Think of decimal as a super accurate number type.
Float Variable
float weeklyProgress = 0.85F;
- float is another data type for decimal numbers - less precise but uses less memory.
- The letter F tells C# that this is a float literal.
- The value 0.85 represents 85% progress (written in decimal form).
- Floats are useful when you don’t need extreme accuracy - like averages or progress values.
Displaying the Decimal Value
Console.WriteLine($"Success Rate: {successRate}%");
- $ allows you to combine text with the variable value.
- {successRate} is replaced by 95.8.
- It prints:
- Success Rate: 95.8%
Displaying the Float Value (with a Calculation)
Console.WriteLine($"Weekly Progress: {weeklyProgress}%");
Explanation
- $ - String Interpolation
- The $ before the string means you’re using string interpolation.
- It allows you to insert variable values directly into a string.
Step 4: Type the code to pratice use of **decimal and float literals and click the play button to run the program.**
Line-by-line Explanation
bool taskCompleted = true;
bool is short for Boolean, a data type that holds only two possible values:
true or false.
Here, taskCompleted is a variable that stores whether your exercise is finished or not.
bool taskCompleted = true;
This means:
- The task is done (true).
- If it were false, that would mean the task isn’t done.
Console.WriteLine($"Exercise Completed: {taskCompleted}");
- This line prints a message to the console.
- The $ allows string interpolation, which lets you embed variables inside strings using {}.
- {taskCompleted} will be replaced by the value stored in taskCompleted (in this case, true).
Console.WriteLine("\n=====================================");
- The \n means new line — it moves the cursor to the next line before printing the equals signs.
- It prints a decorative separator line to make your output look nice.
Console.WriteLine(" Thank you for viewing my profile!");
This prints a simple closing message for your program.
Console.WriteLine("=====================================");
Prints another separator line to complete the section visually.
Conclusion
This project gave me hands on experience with one of the most important building blocks of C# which is data types. Through creating and displaying literal values, I learned how precision, syntax, and data representation affect program output. It was a great step in developing problem solving skills, logical thinking, and code structure understanding. The Personal Info & Stats Display App marks the beginning of my C# learning journey, setting the foundation for more complex applications such as data driven programs and user interactive systems in the future.
Top comments (1)
The
#c
tag is exclusively for C, not C#. Please stop tagging C# content with the#c
tag.