subject

HW3_P1 - Student list using array

Given a Student class, create a class with following characteristics:

The class name should be ClassRoom.

Private variable students array to maintain the list of Student objects.

Function addStudent with input parameter name (string) and rollNo(int) adds a new student in "students" list.

Method getAllStudents should return all the students in ClassRoom.

Input
Jack

1

Jones

2

Marry

3

where,

First & Second line represent a student’s name and roll number. And so on.

Output

1 - Jack

2 - Jones

3 - Marry

Assume that,

Maximum "students" count can be 10.

*Driver Class*

*Solution class*

import java. util.*;

class Student {
private String name;
private int rollNo;

public String getName() {}
public void setName(String name) {}
public int getRollNo() {}
public void setRollNo(int rollNo) {}
};

class ClassRoom {

private int i;
private Student[] students;

public void addStudent(String name, int rollNo) {}
public Student[] getAllStudents() {}
};

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
You are almost finished updating a web site. as part of the update, you have converted all pages from html 4.0 to html5. the project is currently on schedule. however, your project manager has been asked by the marketing team manager to justify a day of time spent validating the site's html5 pages. the marketing team manager does not have technical knowledge of the internet or the web. which is the most appropriate explanation to provide to the marketing team manager?
Answers: 1
question
Computers and Technology, 22.06.2019 19:00
Stacy works as blank. the most important soft skill she needs for this role is blank.
Answers: 3
question
Computers and Technology, 23.06.2019 02:30
Which component acts as a platform on which application software runs
Answers: 2
question
Computers and Technology, 24.06.2019 13:10
Write a program that has a conversation with the user. the program must ask for both strings and numbers as input. the program must ask for at least 4 different inputs from the user. the program must reuse at least 3 inputs in what it displays on the screen. the program must perform some form of arithmetic operation on the numbers the user inputs. turn in your .py file as well as a screenshot of your program's output. include comments in your code to explain how it works an example program run might look like (have fun with this and be creative): ‘what is your name? ’ “josh” ‘, josh. what is your favorite color? ’ “green” ‘mine too. do you also like ice cream? ’ “no” ‘josh, how old are you? ’ “40” ‘ and how many siblings do you have? ’’ “3” ‘that means you are one of 4 kid(s). is green the favorite color of anyone else in your house? ’
Answers: 3
You know the right answer?
HW3_P1 - Student list using array

Given a Student class, create a class with following c...
Questions
question
Mathematics, 02.03.2021 03:00
question
Mathematics, 02.03.2021 03:00
question
History, 02.03.2021 03:00
question
Mathematics, 02.03.2021 03:00
Questions on the website: 13722367