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
Why is Brainly always deleting either my answers or my questions? I am putting nothing inappropriate in them. Can someone answer
Artist 52 [7]

Answer:

hey i do not know

Explanation:

3 0
3 years ago
Read 2 more answers
Search engines enable you to:A. talk to people via the computer.B. locate Web pages related to a specific subject.C. connect to
GalinKa [24]
The correct answer is B. locate Web pages related to a specific subject.

An example of a search engine is Google: it helps you find Websites with the content you're looking for.
3 0
2 years ago
Describe at least three things you could do to prepare for giving an effective and engaging business presentation. (1-3 sentence
puteri [66]
To prepare for giving an effective and engaging business presentation;
1. Know your subject and be able to answer questions.
2. Practice your presentation until you are confident in your delivery
3. Get plenty of sleep the night before and have a light breakfast the day of.
4 0
3 years ago
Read 2 more answers
A developer needs to create a visualforce page that displays case data. The page will be used by both support reps and support m
shutvik [7]

Answer:

B. Use a new support manager permission sets

Explanation:

According to the requirements, field level security is required so, 1st options is not suitable because it may reduce the maintenance cost but increase the risk of security.

By creating a separate page for each of the two, it will leads to increase in the maintenance cost of the system. So <u>Option C</u> is also not suitable.

Option B is more Suitable as compared to others, that <em>Create a new support manager permission set</em>, with the help of this, both of Support rep and Support manager can visualize their required information with the help of support manager permission. This solution will not compromise the security and not increase the maintenance cost.

7 0
3 years ago
Successful implementation of an effective MRP system depends upon (1) the recognition of the difference between independent and
MakcuM [25]

Answer:

c. inventory control systems

Explanation:

During implementation of MRP system we have to consider <em>inventory control systems</em> because these systems track inventory levels, orders, sales, and deliveries. Therefore they must be considered.

5 0
3 years ago
Other questions:
  • Henry has to create software that manages a database of all his clients of his firm. He wishes to run software on another comput
    10·2 answers
  • A supplier certification program: Group of answer choices
    9·1 answer
  • You work as an IT Technician for uCertify Inc. David, a user, has recently purchased a laptop computer. He is now complaining th
    14·1 answer
  • Implement a function getContent() that takes as input a URL (as a string) and prints only the text data content of the associate
    6·1 answer
  • Write a programme with C++ language wich print the biggest number in between three numbers , whith INT
    14·1 answer
  • Which is the correct option?
    6·1 answer
  • Just help :(((((((((((((((((((((((((((((((((((
    14·1 answer
  • According to the video, which tasks do Police Patrol Officers perform? Select all that apply.
    15·2 answers
  • Does C supports STRINGS as a data type?
    14·1 answer
  • The ______ process retains copies of data over extended periods of time in order to meet legal and operational requirements.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!