Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication2
- {
- class Program
- {
- static void Main(string[] args)
- {
- string grade;
- int totalGrade = 0, i = 0;
- float average = 0;
- for ( ;i < 5; )
- {
- Console.Write("Enter grade #{0}: ", i += 1);
- grade = Console.ReadLine();
- totalGrade += Convert.ToInt32(grade);
- }
- average = totalGrade / 5.0f;
- if(average < 75)
- Console.WriteLine("\nTotal average is: "+ average +"\t\t\tRemarks: Failed");
- else
- Console.WriteLine("\nTotal average is: {0}\t\t\tRemarks: Passed", average);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement