Monday, February 21, 2011

OOPS Student's Progress Sheet

Student progress and marks breakup sheet is published as under:

Progress Sheet 

Marks Breakup:
Assignments      26
Mid-Term            7
Presentation        7
Lab Exam           20
Attendance        10
Final Exam          30
==================
Total                 100

Assignment # 3

Create class Player with following attributes:
string Name
// Below are skills for a cricket player valid range for a skill is 1 to 10
int Batting
int Bowling
int Fielding
int Running
// Valid range 0.00 to 100.00
double RunningAverage
// Valid range 2.00 to 10.00
double BowlingAverage
//Valid range is from 0 to 15
static int playerNumber=0;

Provided Behaviors are:
private int RandomNumber(int min, int max)
        {
            Random random = new Random();
            return random.Next(min, max);
        }
        private double RandomNumber()
        {
            Random random = new Random();
            return random.NextDouble();
        }


1.       Create a null parameter(default) constructor to that sets player name to as “Player”+PlayerNumber and increments playerNumber static attribute, it also sets player skills attributes to random values.
2.       Create a constructor that takes player’s name as parameter and fill reset of the values randomly.
3.       create a constructor that takes all player’s name and batting skills as parameters and fills rest of the attributes randomly
4.       Create a constructor  that takes player’s  name and bowling skills as parameters and fills rest randomly
5.       Create a behavior / method displaySmary() that display player’s Name and summary of his skills
6.       Create several players by using different constructors you have created and call displaySummary() method.

Assignment # 4

Create a class Team with following attributes:
string TeamName
player [] players;
static int players;
int Win
int Lose
int Draw

1.       Create a constructor that accepts an array of Players, team Name.
2.       Create a constructor that takes all attributes a parameters except player array.
3.       Create a method to add player in team addPlayer(Player objPlayer)
4.        Create a method to remove a player from team if it already added in array of players removePlayer(Player objPlayer)
5.       Create a method to display team summary displayTeamSummary()
6.       Create a program and demonstrate your constrictors and methods

Sunday, February 13, 2011

Assigment # 2 Classes, objects and methods/functions


Objective: 
Create a program that takes input of  Student registration, courses and their scores, the produce Marks-Sheet, this program should never exit until user input "exit" in any of field, once it produces the Mark-Sheet it asks for exit or continue with new Mark-Sheet

Details:
Create a class “Student” that keeps infgormation about student and it’s course scores

Name
Father Name
Class
CourseOneName
CourseOneScore
CourseTwoName
CourseTowScore
CourseThreeName
CourseThreeScore
CourseFourName
CourseFourScore
CourseFiveName
CourseFiveScore

Create Following Functrions/Methods
int calculateTotalScore()
calculates toltal of student’
Double calculatePercentage{}
This function will use calculateTotalScore() fucntion to get total score and calulate percentage
void displayMarksSheet() {}
User ASCII characters and Tabs to produce marksheet  on screen.
This method should use calculatePercentage() and calculateTotalScore() functions to produce Mark-Sheet

Assigment # 1 Loops in C#

Create a program to create pyramid of strikes "*" by taking input of number of rows in the pyramid
2 rows pyramid looks like

 *   
**

3 rows pyramid looks like

     *
   ***
  ****

Create similar program by using

For loop
While Loop
Do While loop