in C++
#include<iostream>
#include <list>
#include <vector>
#include <set>
#include<string.h>
#include <stack>
#include <unordered_map>
using namespace std;
class student
{
private:
char name[30];
float gpa;
int
studentDebt;
public:
void input(char name[], float gpa,
int studentDebt) {
strcpy(this->name,name);
this->gpa=gpa;
this->studentDebt=studentDebt;
}
void display()
{
cout<<"Name : "<<name<<" "<<"GPA :
"<<gpa<<" "<<"StudentDebt :
"<<studentDebt<<endl;
}
};
int main()
{
// list stl
list <int> numbers;
for (int i = 0; i < 10; ++i) {
numbers.push_back(i);
}
student s1[5]; // array containing student
object.
s1[0].input("Joey", 3.54, 25000);
s1[1].input("Chandler", 4.3, 15425);
s1[2].input("Rachel", 3.9, 21000);
s1[3].input("Ross", 4.5, 8500);
s1[4].input("Monica", 3.8, 12000);
vector<student> student_vector; //vector with
student objects.
for(int i=0; i<5; i++) {
student_vector.push_back(s1[i]);
}
stack <student> student_stack; //Stack with student
objects.
for(int i=0;i<5;i++) {
student_stack.push(s1[i]);
}
set<int>set_int; //Set with integer values.
for(int i=0; i<5; i++) {
set_int.insert(i);
}
unordered_map<string, int> movies; //unordered
map of string to int.
movies["HARRY_POTTER"] = 2001;
movies["LORD_OF_THE_RINGS"] = 2000;
movies["MISSION_IMPOSSIBLE"] = 1996;
return 0;
}
in C++ Make a Student class that has Name, GPA, and StudentDebt as properties In main,...
Define a class called Student with ID (string), name (string), units (int) and gpa (double). Define a constructor with default values to initialize strings to NULL, unit to 0 and gpa to 0.0. Define a copy constructor to initialize class members to those of another Student passed to it as parameters. Overload the assignment operator (=) to assign one Student to another. Define a member function called read() for reading Student data from the user and a function called print()...
Please help, provide source code in c++(photos attached)
develop a class called Student with the following protected
data:
name (string), id (string), units (int), gpa (double).
Public functions include:
default constructor, copy constructor, overloaded = operator,
destructor, read() to read data into it, print() to print its data,
get_name() which returns name and get_gpa() which returns the
gpa.
Derive a class called StuWorker (for student worker) from
Student with the following added data:
hours (int for hours assigned per week),...
C++ There is a class called Person which has name and age as private variables. Another class called Student, which is derived from person with gpa and id as variables. name is a string, age and id are integers and gpa is a double... All of them are private variables. age, gpa and id should be generated randomly when the object is created with the following ranges: age 20 to 32 gpa 0.0 to 4.0 // this one is tricky...
Use C++! This program uses the class myStack to determine the highest GPA from a list of students with their GPA.The program also outputs the names of the students who received the highest GPA. Redo this program so that it uses the STL list and STL queue! Thank you! HighestGPAData.txt* 3.4 Randy 3.2 Kathy 2.5 Colt 3.4 Tom 3.8 Ron 3.8 Mickey 3.6 Peter 3.5 Donald 3.8 Cindy 3.7 Dome 3.9 Andy 3.8 Fox 3.9 Minnie 2.7 Gilda 3.9 Vinay...
Write the following program in C++. Review structures, pointers and dynamic memory allocation from CSIT 839. Also, review pointers and dynamic memory allocation posted here under Pages. For sorting, you can refer to the textbook for Co Sci 839 or google "C++ sort functions". I've also included under files, a sample C++ source file named sort_binsearch.cpp which gives an example of both sorting and binary search. The Bubble sort is the simplest. For binary search too, you can refer to...
in c++ please include all of the following " template class, template function, singly linked list, the ADT stack, copy constructor, operator overloading, "try catch"and pointers Modify the code named "Stack using a Singly Linked List" to make the ADT Stack that is a template class has the code of the destructor in which each node is directly deleted without using any member function. As each node is deleted, the destructor displays the address of the node that is being...
Assignment Write a menu-driven C++ program to manage a class roster of student names that can grow and shrink dynamically. It should work something like this (user input highlighted in blue): Array size: 0, capacity: 2 MENU A Add a student D Delete a student L List all students Q Quit ...your choice: a[ENTER] Enter the student name to add: Jonas-Gunnar Iversen[ENTER] Array size: 1, capacity: 2 MENU A Add a student D Delete a student L List all students...
Write a menu-driven C++ program to manage a class roster of student names that can grow and shrink dynamically. It should work something like this (user input highlighted in blue): Array size: 0, capacity: 2 MENU A Add a student D Delete a student L List all students Q Quit ...your choice: a[ENTER] Enter the student name to add: Jonas-Gunnar Iversen[ENTER] Array size: 1, capacity: 2 MENU A Add a student D Delete a student L List all students Q...
Problem Specification:Write a C++ program to calculate student’s GPA for the semester in your class. For each student,the program should accept a student’s name, ID number and the number of courses he/she istaking, then for each course the following data is needed the course number a string e.g. BU 101 course credits “an integer” grade received for the course “a character”.The program should display each student’s information and their courses information. It shouldalso display the GPA for the semester. The...
How to solve this Problem in C++
. The Problem Write program that uses a class template to create a set of items. The program should: 1. add items to the set (there shouldn't be any duplicates) Example: if your codes is adding three integers, 10, 5, 10, then your program will add only two values 10 and 5 Hint: Use vectors and vector functions to store the set of items 2. Get the number of items in the set...