BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

Register FAQ Community Calendar New Posts Navbar Right Corner
HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Institute of Computing > Bachelor of Science in Computer Science > BsCS 6th Semester > Visual Programming


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 17-06-2011, 09:53 PM
thecool's Avatar
Senior Member


 
Join Date: Apr 2009
Location: Multan
Posts: 1,163
Contact Number: Push me a PM if you really need
Program / Discipline: Alumni
Class Roll Number: ---
thecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond repute
Smartass How to write C# student program using grade code

Student program | using grade code

Code:
using System;
using System.Collections.Generic;
using System.Text;

namespace result
{
class stud
{
public int roll, total, avg, dbms, c, cpp, vb;
string name, grade;

public void getdata()
{
Console.WriteLine("Enter roll no.:");
roll = int.Parse(Console.ReadLine());

Console.WriteLine("Enter name:");
name = Console.ReadLine();

Console.WriteLine("Enter marks in DBMS:");
dbms = int.Parse(Console.ReadLine());

Console.WriteLine("Enter marks in C:");
c = int.Parse(Console.ReadLine());

Console.WriteLine("Enter marks in CPP:");
cpp = int.Parse(Console.ReadLine());

Console.WriteLine("Enter marks in VB:");
vb = int.Parse(Console.ReadLine());
}

public void putdata()
{
total = (dbms + c + cpp + vb);
avg = total / 4;

if (avg >= 70)
grade = "distinction";
else if (avg >= 60)
grade = "first class";
else if (avg >= 50)
grade = "second class";
else if (avg >= 40)
grade = "Pass class";
else
grade = "Fail";

Console.WriteLine("Roll No: " + roll);
Console.WriteLine("Name: " + name);
Console.WriteLine("Marks in DBMS: " + dbms);
Console.WriteLine("Marks in C: " + c);
Console.WriteLine("Marks in CPP: " + cpp);
Console.WriteLine("Marks in VB: " + vb);
Console.WriteLine("Total: " + total);
Console.WriteLine("Average: " + avg);
Console.WriteLine("Grade: " + grade);
}

static void Main(string[] args)
{
stud ob = new stud();
ob.getdata();
ob.putdata();
console.readline();
}
}
}

Reply With Quote
Reply

Tags
code, grade, program, student, write


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Program to enter a character and output its ASCII code bonfire Object Oriented Programming 0 09-03-2011 12:14 AM
Program to write in different fonts on the screen bonfire Object Oriented Programming 0 01-03-2011 03:02 PM
Program to enter your age and print if you should be in grade 10 bonfire Object Oriented Programming 0 01-03-2011 02:25 PM
Program for Linear Search in an Array VB Code (By Sheraz) .BZU. Visual Programming 0 15-12-2009 11:06 PM
write a program to input visiting and perment employee record by insertion extertion arslanbadar BsCS 3rd Semester 0 06-11-2008 07:25 PM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 06:35 PM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.