Code Monkey home page Code Monkey logo

students-exercice's Introduction

๐Ÿ”ท Student Management Application ๐Ÿ”ท

Welcome to the Student Management Application! This project provides a platform to manage student information effectively.

Table of Contents

Description ๐Ÿ“

The Student Management Application simplifies the process of managing student records, including ID, name, and specialty. It includes meticulously crafted classes to handle various aspects of student information, ensuring seamless creation, modification, and visualization.

Features โœจ

  • Create Students: Add students to the system with customizable attributes.
  • Flexible Constructors: Utilize constructors with different parameters to accommodate various student data scenarios.
  • Attribute Modification: Modify student attributes such as name, ID, and specialty as needed.
  • Efficient Data Management: Streamline student data management with intuitive methods and classes.

Exercises ๐Ÿ‹๏ธโ€โ™‚๏ธ


Exercise 1

Description ๐Ÿ“

Write the Java code that defines a Student class. Assume that a student is described by their ID (int), name (String), and specialty (String). The class must have:

  • a constructor with two parameters m and n to initialize the ID and name.
  • a constructor with three parameters m, n, and s to initialize the three attributes.

Write the following code and explain the result obtained by its execution (and the cause of the error if applicable)

public class TestStudent {
    public static void main(String[] arg) {
        Student student1 = new Student("Ahmed"); // (1)
        Student student2 = new Student(); // (2)
        Student student3 = new Student(299, "Ahmed"); // (3)
        student1.specialty = "Computer Science";
        Student student4 = new Student(288, "Ali", "Math"); // (4)
        student4.specialty = student1.specialty;
        System.out.println(student1.name + " " + student1.specialty); // (5)
        System.out.println(student2.name + " " + student2.specialty); // (6)
        student1 = student2;
        student2.name = "Amel";
        System.out.println(student1.name + " " + student1.specialty); // (7)
    }
}

Classes ๐Ÿ“š

Student.java ๐ŸŽ“

  • Represents a student with attributes such as ID, name, and specialty.
  • Provides constructors to create student objects with different parameters.
  • Includes methods for attribute modification and data retrieval.

TestStudent.java ๐Ÿงช

  • Main program to test the functionality of the Student class.
  • Creates instances of the Student class and demonstrates various constructor usages and attribute assignments.

Usage ๐Ÿš€

  1. Clone the Repository: Clone this repository to your local machine using git clone.
  2. Navigate to the Project Directory: Open a terminal and move into the project directory.
  3. Navigate to the Source Directory: Change directory to the src folder.
  4. Compile and Run: Compile and run the TestStudent.java file.
    • Compile: javac *.java
    • Run: java TestStudent
  5. Interact with the Application: Follow the on-screen instructions to manage student data effectively.

Tools and Languages ๐Ÿ”ง

  • Java: Primary programming language.
  • IntelliJ IDEA: Integrated Development Environment (IDE).

Execution ๐Ÿ’ป

Sample Output:

students-exercice's People

Contributors

kaoutherbo avatar

Stargazers

Keqing avatar Meriem SOUBIH avatar  avatar ikram kawthar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.