I don't want to create another vector.. I want to use the one I already created (header file), inside the main file in the function "double Grade::gpa() const".
Although my code works, obviously...
Type: Posts; User: xforevertink
I don't want to create another vector.. I want to use the one I already created (header file), inside the main file in the function "double Grade::gpa() const".
Although my code works, obviously...
Why is it in a form of a question? I was asking how I call the vector (in header file) inside the class Course, in the main function.
Are you trying to say that I should create a string variable with the course name?
Note. I'm not asking you guys to do the assignment for me. I'm just stuck in a wall right now and would appreciate how to get out of it. Thanks!
Assignment: implement a 3 different classes [student, course, grade] and have the code calculate the total number of units the student is taking and calculate the gpa.
So far, my code is...
Yeah. I actually tried changing the line
int num = 1;
with....
string num = 1;
But instead I got an error, which I don't understand. I thought strings could read numbers as well?
Can you explain the two character replace? I'm new to c++ programming. I don't understand what you mean by that.
If I replace num with '1', then I would have to type out all 26 numbers. I just wanted a quicker way to replace the whole phrase by incrementing num as it encounters all the letters, since I'm...
Well, the program prompts the user to enter a phrase. And I just want to convert all the letters into numbers starting from 1. So that 'A' would equal 1. 'B' would equal 2, and so on.
And in the...
I'm trying to convert the letters into numbers. But I keep coming into errors in the if loop of the statement. Particularly, in the....
phrase.replace(i,1, 'num');
Right now, I'm getting a...
I'm trying to return the partial sum that the text below in the main function is asking for.
#include<iostream>
#include<vector>
#include<exception>
#include<stdexcept>
#include<string>
Sorry, the code is a bit messy. :[
I'm trying to only change the code within the function "partial_sum". but it doesn't seem to return the total. What am i doing wrong? :(
#include<iostream>
#include<vector>...