1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Veseljchak [2.6K]
3 years ago
9

Write a Student class in Java which has a name, id_number, year (e.g. 2) and

Computers and Technology
1 answer:
Fittoniya [83]3 years ago
8 0

Answer:

Following are the code in java

public class Student

{

// member variables

String name;

String id_number;

int year ;

String programme_code ;

// default constructor

public student()  //default constructor

{

name="san";

id_number="12";

year =2010;

programme_code="ECE";

}  

 // method to display the member variables of the Student

 public void display() // dispaly the value

{

System.out.println("Name is  : "+name);

System.out.println("ID is  : "+id_number);

System.out.println("Year is  : "+year);

System.out.println("Programme code is : "+programme_code);

  }

public static void main (String[] args) // Main method

{

 Student ob=new Student();

 ob.display(); // calling the method display  

}  

}

Explanation:

In this we create a class "student "  name,id_number, year and  programme_code are the variable after that create a default constructor and initialize the variable and finally display the variable .In the main method we create a object of student class i.e ob ,and call display method  with object ob.

Output:

Name is  :san

ID is  : 12

Year is  :2010

Programme code is : ECE

You might be interested in
Priortization is an example of a skill that helps you reach long term goals because
Brrunno [24]

Answer:

Prioritization is an example of a skill that helps you reach long term goals because

it helps you stay organized and determined. It's scientifically proven that we can't multitask, effectively at the very least. So when you really consider what is most important to you at any given moment, it will help you succeed because chances are if you like what you are doing you are more likely to do well at it.

3 0
3 years ago
The cost to ship a package is a flat fee of 75 cents plus 25 cents per pound. 1. Declare a const named CENTS_PER_POUND and initi
viva [34]

Answer:

Replace /* Your solution goes here */

with

<em>const int CENTS_PER_POUND = 25; </em>

<em> cout << "Weight(lb): "; </em>

<em>cin >> shipWeightPounds; </em>

<em>shipCostCents = FLAT_FEE_CENTS + CENTS_PER_POUND * shipWeightPounds; </em>

<em />

Explanation:

This line declares and initializes CENTS_PER_POUND as constant integer to 25

const int CENTS_PER_POUND = 25;

This line prompts user for weight of shipment

cout << "Weight(lb): ";

This line gets weight from the user

cin >> shipWeightPounds;

This line calculates the cost of shipment

shipCostCents = FLAT_FEE_CENTS + CENTS_PER_POUND * shipWeightPounds;

4 0
3 years ago
CODE EXAMPLE 3-1 SELECT vendorName, invoiceNumber, invoiceDate, invoiceTotal FROM vendors INNER JOIN invoices ON vendors .vendor
Nataliya [291]

Answer:

The correct answer for the given question is 4

Explanation:

In the given code it select the vendorName, invoiceNumber, invoiceDate, invoiceTotal from vendors ,invoices table. when required condition is fullfill i.e vendors .vendorID = invoices.vendorID and invoiceTotal >= 500 .

So their are 4 column in the result set i.e vendorName, invoiceNumber, invoiceDate, invoiceTotal .

8 0
3 years ago
......... mi2hej<br><br>ejid8eo19o1b2bxhxjxjdnneejk2929nr
Mila [183]

Answer:

hi  thsu si s5

Explanation:

brace use

5 0
3 years ago
Read 2 more answers
An argument does not always have to be made in words. A piece of music
mixas84 [53]

Answer:

B. emotional

Explanation:

An emotional argument. An argument does not always have to be made in words.

4 0
3 years ago
Other questions:
  • The term integration refers to the ability to
    6·1 answer
  • What are the advantages of upgrading computer hardware?
    13·2 answers
  • Nina aspires to be a digital media specialist. What should Nana be familiar with in order to pursue this career?
    9·2 answers
  • Insurance can help you:
    12·1 answer
  • An Einstein Analytics team wants to create a dashboard that displays values from an external, on-premise Oracle Database. What a
    7·1 answer
  • You want the user to enter the length, width, and height from the keyboard. Which cin statement is correctly written?
    10·1 answer
  • In batch operating system three job J1 J2 and J3 are submitted for execution each job involes an I/O activity a CPU time and ano
    13·1 answer
  • What is adobe photoshop?
    10·2 answers
  • How did imperialism lead to WWI? A The debate of the morality of imperialism created tensions around Europe b Native people were
    12·1 answer
  • Tasha grew up helping her uncle work on cars in his auto repair shop and developed into an excellent auto technician. Because of
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!