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
DaniilM [7]
3 years ago
7

HW3_P1 - Student list using array

Computers and Technology
1 answer:
Greeley [361]3 years ago
3 0

Answer:

#include<iostream>

#include<cstring>

#include <algorithm>

using namespace std;

class Student{

public:

string name;

int rollNo;

Student(){

}

Student(string n, int r){

name = n;

rollNo = r;

}

};

class ClassRoom{

public:

Student stud[10];

int count;

ClassRoom(){

count = 0;

}

void addStudent(string str,int roll){

Student s(str,roll);

stud[count++] = s;

}

Student * getAllStudents(){

return stud;

}

};

int main()

{

string name;

char temp[20];

int rollNo, N, i;

Student * students;

ClassRoom classRoom;

i=0;

while(getline(cin, name) && cin.getline(temp,20)&&i<10){

rollNo = atoi(temp);

classRoom.addStudent(name, rollNo);

i++;

}

N = i;

students = classRoom.getAllStudents();

for(int i=0 ; i < N; i++){

cout << (students+i)->rollNo << " - " << (students+i)->name;

if(i<N-1)

cout<<endl;

}

return 0;

}

Explanation:

  • In the addStudent method, increment the counter and as the value of variable s to the the stud array.
  • In the getAllStudents method, return all the students.
  • Finally in the main method, display the name and roll no. of students.
You might be interested in
A license may limit the use of a software application to a specific device. Group of answer choices True False
BigorU [14]

Answer:

true

Explanation:

8 0
2 years ago
When constructing policies regarding data _______________, it is important that these policies offer particular guidance on sepa
Rama09 [41]

Answer:

access

Explanation:

Managing users' access rights to digital resources within the organization's environment is a fundamental SoD control. As more services are requested by users, utilizing the built-in panels to check compliance with internal controls might become excessive. Companies require a comprehensive Identity Governance and Administration plan to monitor these user access and offer an authoritative source of identity definitions in order to ensure  SoD compliance.

6 0
2 years ago
Where should you look to find contact information about a company? I. on the company website II. at your local library III. in t
bixtya [17]

You should look on the company website in order to find contact information about a company,

The company website should contain the crucial Business Information, logical roadmap, contact information, easy navigation... The contact information should include number, email, address and a contact form. They should be easily accessible and visible.

4 0
3 years ago
Read 2 more answers
How to resize an image in photoshop without losing quality.
castortr0y [4]

Answer:

Explanation:

Make sure resample is turned on

Turn on the chain link if you want the width and height to change together. If not, turn off the chain so that you can set your own width and height.

Choose your new size (you can choose to choose different measurement units by clicking on “inches”)

press ok

i hoped this helped!!!!!!!!

8 0
2 years ago
Synthesizing information can be done by creating
Maurinko [17]

Answer:

D

Explanation:

because you use all of those

4 0
3 years ago
Read 2 more answers
Other questions:
  • How many times do you usually use npm?<br> Put your answer in the box.
    6·1 answer
  • Kuta software infinite pre- algebra multiplying polynomial and a monomial find product answer key
    14·1 answer
  • Complex communication skills will probably never be outsourced to a computer because they require the human touch.
    8·1 answer
  • In Microsoft Word you can access the _______ command from the "Mini toolbar." 
    9·1 answer
  • What is the first step to apply the line and page breaks options to groups of paragraphs in a Word document?
    10·2 answers
  • You are implementing a new application control solution. Prior to enforcing your application whitelist, you want to monitor user
    5·1 answer
  • What is the alogarithm for solving the perimeter of a triangle
    11·1 answer
  • Which type of attack can be addressed using a switched ethernet gateway and software on every host on your network that makes su
    7·1 answer
  • Difine the term pigment​
    14·3 answers
  • Consider a game that is searched using random restart hill climbing strategy. Assume that the success rate for the game is 25%.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!