Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created July 30, 2020 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/d6c9360c7b90575d2381d13206cde032 to your computer and use it in GitHub Desktop.
Save codecademydev/d6c9360c7b90575d2381d13206cde032 to your computer and use it in GitHub Desktop.
Codecademy export
@page
@model IndexModel
@{
ViewData["Title"] = "Home page";
string grade = "A";
}
<div class="text-center">
<h1 class="display-5">Let's work with conditionals!</h1>
<hr>
<h3>Exam results:</h3>
<br>
@switch (grade)
{
case "A": <h4>Excellent job!</h4>
break;
case "B": <h4>Well done!</h4>
break;
case "C": <h4>Needs some work!</h4>
break;
case "D": <h4>You Passed</h4>
break;
case "F": <h4>You failed, better try next time</h4>
break;
default: <h4>Invalid Grade!</h4>
break;
};
<h4>Your grade is, @grade</h4>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment