myweb

public interface Department{ myweb links: mylink
Hobbies: Sketches The Girl... Small Unwonderful Story Programming Languages: C++ JAVA HTML Something: Sybsc computer science: sem 4, Questions paper some c programs file handling in c File Handling simple concept & programs microcontroller programs (electronics) Raspberry pi & Arduino programs Data Structure in c: Linear data structure SEARCHING AND SORTING Link List Opearations STACK & QUEUE NON-linear Data Structure: - BINARY SEARCH TREE - Implement Graph as Adjacency matrix and Adjacency list - BINARY SEARCH TREE ASSIGNMENT 1 - BINARY SEARCH TREE ASSIGNMENT 2 - HASH TABLE - GRAPH TRAVERSAL : BFS & DFS - INDEGREE OUTDEGREE & TOTAL DEGREE OF VERTEX IN GRAPH - Graph-Adjacency list - DIJKSTRA SHORTEST PATH ALGORITHM:
Learnworld

Just Like Profile

INFORMATION

first name:

last name:

password:

your fav. movie:

your fav. song:

your hobbies:

select gender : male female other

Do you like my web:Yes No


  public void getDetpName();
  public void getDetpHead();
 }
 class Hostel{
  protected String hname,hlocation;
  int noofroom;
  void getHostelName(){
   System.out.println("Name Of the Hostel : " + hname);
  }
  void getHostelLocation(){
   System.out.println("Hostel Location : " + hlocation);
  }
  void getNoOfRoom(){
   System.out.println("Total Room : " + noofroom);
  }
 }
 import java.util.*;
 class Student extends Hostel implements Department
 {
  String sname,regno,elesub;
  String deptName,deptHead;
  int avgMarks;
  void getStudentName(){
   System.out.println("Student : " + sname);
  }
  String getStudentRegNo(){
   return regno;
  }
  void getElectiveSubject(){
   System.out.println("Elective Subject : " + elesub);
  }
  void getAvgMarks(){
   System.out.println("Average Marks : " + avgMarks);
  }
  public void getDetpName(){
   System.out.println("Department Name : " + deptName);
  }
  public void getDetpHead(){
   System.out.println("Department Head : " + deptHead);
  }
  void addStudent(){
   Scanner sc=new Scanner(System.in);
   System.out.print("Enter Student name : ");
   sname=sc.nextLine();
   System.out.print("Enter Registration Number : ");
   regno=sc.nextLine();
   System.out.print("Enter Elective Subject : ");
   elesub=sc.nextLine();
   System.out.print("Enter Hostel Name : ");
   hname=sc.nextLine();
   System.out.print("Enter Hostel Location : ");
   hlocation=sc.nextLine();
   System.out.print("Enter Department Name : ");
   deptName=sc.nextLine();
   System.out.print("Enter Department Head : ");
   deptHead=sc.nextLine();
   System.out.print("Enter No of room : ");
   noofroom=sc.nextInt();
   System.out.print("Enter Avg Marks : ");
   avgMarks=sc.nextInt();
  }
  
  void migrate(){
   Scanner sc=new Scanner(System.in);
   System.out.print("Enter new Department Name : ");
   deptName=sc.nextLine();
   System.out.print("Enter new Department Head : ");
   deptHead=sc.nextLine();
  }
  void display(){
   getStudentName();
   System.out.println(" Student Registration No is : " + getStudentRegNo());
   getElectiveSubject();
   getAvgMarks();
   getDetpName();
   getDetpHead();
  }
 }
 import java.util.*;
 class StudentMaster{
  public static void main(String []args){
   Scanner sc=new Scanner(System.in);
   Student []st=new Student[100];
   int sno=0;
   String rno;
   int ch;
   boolean b;
   while(true){
    System.out.println("\n 1. Admit a student");
    System.out.println(" 2. Migrate a student");
    System.out.println(" 3. Display");
    System.out.println(" 4. Exit");
    System.out.println(" 5. Enter Your Choice");
    ch=sc.nextInt();
    switch(ch){
     case 1:
      st[sno]=new Student();
      st[sno++].addStudent();
      break;
     case 2:
      System.out.println("Enter Registration no : ");
      rno=sc.next();
      b=false;
      for(int i=0;i<sno;i++){
       if(st[i].getStudentRegNo().equals(rno)){
        b=true;
        st[0].migrate();
        break;
       }
      }
      if(b==false)
      {
       System.out.println("Student Not Found");
      }
      break;
     case 3:
      System.out.println("Enter Registration no : ");
      rno=sc.next();
      b=false;
      for(int i=0;i<sno;i++){
       if(st[i].getStudentRegNo().equals(rno)){
       b=true;
       st[0].display();
       break;
       }
      }
      if(b==false){
       System.out.println("Student Not Found");
      }
      break;
     case 4:
      System.exit(0);
     default:
      System.out.println("--Invalid Entry--");
    }
   }
  }
 }

Comments

  1. learnwithnil.blogspot.com

    ReplyDelete
  2. The Large Strig is:$large";
    echo "
    The Small String is:$small";
    echo "
    The length is:$length";

    $pos = strpos($large,$small);
    if($pos === 0)
    echo "
    small string :'$small' present at the start of Large string:'$large'.
    ";
    else
    echo "
    small string '$small' Not present at the start of large string:'$large'.
    ";


    echo "
    The position of small string appear in large string is: $pos";

    $ans = strncasecmp($large, $small, $length);
    if($ans === 0)
    echo "
    The first $length character are equal";
    else
    echo "
    The first $length character are not equal";



    ?>

    ReplyDelete
  3. /*
    Write a program to accept ‘n’ name of cities from the user and sort
    them in ascending order
    */

    /*

    import java.util.Scanner;
    public class SortCity {
    String cname;
    SortCity(String cname)
    {
    this.cname = cname;
    }

    static void sort(SortCity city[] , int n)
    {
    for(int i=0; i<n; i++ )
    {
    for(int j=i+1; j<n; j++)
    {
    if((city[i].compareTo(city[j])) < 0 )
    {
    SortCity temp = city[i];
    city[i] = city[j];
    city[j] = temp;
    }
    }
    }
    }


    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    System.out.println("Enter no of cities:");
    int n = sc.nextInt();

    SortCity city[] = new SortCity[n];
    for(int i=0; i<n; i++)
    {
    System.out.println("Enter the name of City :"+(i+1));
    String cname = sc.next();

    city[i] = new SortCity(cname);
    }
    SortCity.sort(city,n);

    System.out.println("Displaying cities After sorting :");
    for(int i=0; i<n; i++)
    {
    System.out.println(city[i]);
    }

    }
    }

    */

    ReplyDelete

Post a Comment

hey

Popular posts from this blog

Practical slips programs : Machine Learning

Full Stack Developement Practical Slips Programs

Android App Developement Practicals Programs