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
lesantik [10]
2 years ago
8

Write java code to create a new class called "student". an object of the student class has attributes like student id, name and

address. instantiate an object of this class, with these attributes. thereafter, display these attributes to a user.
Computers and Technology
1 answer:
Fiesta28 [93]2 years ago
8 0
Here you go. I added a constructor and a toString overload to make the object creation and printing as easy as possible.

public class student {
    private String _id;
    private String _name;
    private String _address;

    public student(String id, String name, String address) {
        _id = id;
        _name = name;
        _address = address;
    }

    public String toString() {
        return "Id: " + _id + "\nName: " + _name + "\nAddress: "+ _address;
    }

    public static void main(String[] args) {
        student s1 = new student("S12345", "John Doe", "Some street");
        System.out.println(s1);
    }
}

You might be interested in
A diagram of a ten-node network that uses ten routers
tiny-mole [99]

The diagram of the of a ten-node network that uses ten routers is given in the image attached.

<h3>What is a node in a network?</h3>

A network node is known to be be seen as the kind of connection point that is seen amidst some network devices such as routers, printers, etc.

Note that they are known to often receive and send data from one network or endpoint to another.

Therefore, The diagram of the of a ten-node network that uses ten routers is given in the image attached.

Learn more about routers from

brainly.com/question/24812743

#SPJ1

3 0
1 year ago
Given two objects represented by the tuples (22, 1, 42, 10) and (20, 0, 36, 8):
Rudik [331]

Answer:

Given,

P = (22, 1, 42, 10)

Q = (20, 0, 36, 8)

a. Formula for Euclidean Distance :

distance = ((p1-q1)^2 + (p2-q2)^2 + ... + (pn-qn)^2)^(1/2)

Now,

distance = ( (22-20)^2 + (1-0)^2 + (42 - 36)^2 + (10-8)^2) ) ^(1/2)

=( (2)^2 + (1)^2 + (6)^2 + (2)^2 ) ) ^(1/2)

=(4+1+36+4)^(1/2)

=45^(1/2)

Distance = 6.7082

b.Manhattan distance :

d = |x1 - x2| + |y1 - y2|

d = |22- 20| + |1 - 0|

d = |2| + |1|

Explanation:

4 0
2 years ago
in c Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the li
Fiesta28 [93]

Answer:

see explaination

Explanation:

//Include required header file.

#include <stdio.h>

//Define the function isWordContainChar() having the

//required parameters.

int isWordContainChar(char* req_word, char search_char)

{

//Declare required variable.

int i;

//Start a for loop to traverse the string given in

//the function parameter.

for(i = 0; req_word[i] != '\0' ; i++)

{

//If the current character in the gievn word is

//matched with the character which needs to be

//found in the word, then return 1.

if(req_word[i] == search_char)

{

return 1;

}

}

//Otherwise, return 0.

return 0;

}

//Start the execution of the main() method.

int main(void)

{

//Declare the required variables.

int num_words, index, word_index;

char str_word[20][10];

char searchCharacter;

//Prompt the user to enter the number of words.

scanf("%d", &num_words);

//Prompt the user to enter the required words using a

//for loop and store them into an array.

for(index = 0; index < num_words; index++)

{

scanf("%s", str_word[index]);

}

//Prompt the user to enter a required character which

//needs to be found in a word.

scanf(" %c", &searchCharacter);

//Traverse the words stored in the array using a for

//loop.

for(index = 0; index < num_words; index++)

{

//Call the function isWordContainChar() with

//required arguments in rach iteration and if the

//value returned by this function is not 0, then

//display the current string in the array.

if(isWordContainChar(str_word[index],

searchCharacter) != 0)

{

printf("%s\n", str_word[index]);

}

}

return 0;

}

3 0
2 years ago
The main trade-off that all investors must consider is
Talja [164]
<span>The main trade-off that all investors must consider is Risk vs Return
In the end, all the techniques that implemented in investing process is aimed for nothing other than profit.
Current market trend dictates that potential return tend to be higher the riskier the investment is and vice versa.
</span>
3 0
3 years ago
Read 2 more answers
Mr. Stevens is the principal of a high school. Why might he want to export data from a database of students’ exam scores?
Anna007 [38]

I am not sure but I think that it is either the First option or the Third option but you would probably need more information.

7 0
2 years ago
Read 2 more answers
Other questions:
  • "Dean wants a quick way to look up staff members by their Staff ID. In cell Q3, nest the existing VLOOKUP function in an IFERROR
    10·1 answer
  • Survey Q. Non-scoring: What role is played in the team? (1 correct answer)
    14·1 answer
  • What are the two types of digital water marking?
    5·1 answer
  • Which of the following operating systems is able to join a domain a) Microsoft office pro b) Microsoft surface R.T. c) google an
    9·2 answers
  • When searching the web software programs called fetch a few web pages and then they follow the links on those pages and fetch th
    9·2 answers
  • In Java; Given numRows and numColumns, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or
    10·1 answer
  • PLEASE HELP!!! THIS IS DUE TODAY! WILL MARK BRAINLIEST!
    5·1 answer
  • . In this project, how many times will the [Drive] block be repeated?
    15·1 answer
  • Which of the following are drivers of machine learning growth?
    15·1 answer
  • I am making a project i have to advertise a product i picked a futureistic car
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!