#!/usr/bin/env ruby
=begin
Prgram : CGPA calculator
Date : May 16, 2014
Author : ManiG
License : GPL2.0
Version : 1.0
=end
sum=0.0
grade = {"S"=>10,"A"=>9,"B"=>8,"C"=>7,"D"=>6,"E"=>5,"U"=>0}
tot_credits = 0
tot_egrades = 0
print "enter no. of subjects : "
sub_count = gets().to_i
sub_count.times do |c|
print "enter subject#{c+1}'s credit : "
credit = gets().to_i
tot_credits += credit
print "enter subject#{c+1}'s earned grade :(only 'S','A','B','C','D','E','U') : "
e_grade = gets().chomp.upcase
tot_egrades += grade[e_grade]
sum += grade[e_grade]*credit
end
gpa = sum/tot_credits
puts
puts "Credits Earned #{tot_credits}"
puts "Grade points earned #{tot_egrades}"
puts "GPA #{format("%.4f",gpa)}"
puts "CGPA #{format("%.4f",gpa)}"
puts
puts "Percentage [=(cgpa*10)-7.5] #{format("%.4f",(gpa*10)-7.5)}"
உலகெங்கிலும் உள்ள தமிழ் மக்களுக்கு கணினிதொழில்நுட்பத்தை பற்றி அறிமுகம் செய்யும் கணியம் என்ற புதிய மாத மின்னிதழை வெளியிடுவதில் பெருமகிழ்ச்சி அடைகிறோம். கணினி கற்க ஆங்கிலம் தடையாக இருந்த காலம் மாறி தொழில்னுட்பங்கள் யாவும் தமிழில் பெருகும் இந்த காலத்தில் மென்பொருள் பற்றிய நுட்பங்களை தமிழில் வழங்குவதில் பெருமை கொள்கிறோம். இந்த இதழின் கட்டுரைகள் : கட்டற்ற மென்பொருள் லினக்ஸ் பயனர் குழு – ஓர் அறிமுகம் உபுண்டு நிறுவுதல்
Comments
Post a Comment