Introduction

Developers perform some tasks nearly every day. Tasks including declaring string and numeric variables, assigning and extracting values, and performing calculations are not only routine, but essential. Equally important is the task of communicating results to the application user. Mastering the ability to apply these skills to solve a given problem is something that every developer must learn to do.

Suppose you’re a teacher’s assistant at a university. You’re tasked with developing an application that helps calculate students’ grade point average. The application uses the students’ grades and credit hours taken to calculate their overall GPA. You’re also provided a required format for reporting the students’ GPA.

This module will guide you through the steps required to develop your GPA Calculator application. Your code will declare and assign values to variables based on course information, perform various numeric calculations, and format and display the results. Calculations include determining the sum of the grade points earned and total credit hours. To display the results in the required format, you’ll need to manipulate a decimal value to display a total of three digits. You’ll also use Console.WriteLine() methods as well character escape sequences that help to format your results.

By the end of this module, you’ll be able to write code that uses various variable types, performs numeric calculations, and displays formatted data for the user.

Learning objectives

In this module, you’ll practice how to:

  • Work with variables to store and retrieve data
  • Perform basic math operations
  • Format strings to present results

Prerequisites

  • Beginner level experience with a .NET editor
  • Beginner level experience with basic C# syntax rules
  • Beginner level experience with performing math operations on variables
  • Beginner level experience with creating literal values and declare variables of basic data types like stringint, and decimal
  • Beginner level experience with string concatenation and string interpolation

contact

Leave a Reply

Your email address will not be published. Required fields are marked *