I am trying to create a type of calculator in my webpage that is sort of like a GPA calculator but a bit different. I am not sure how exactly to explain it but I do have a formula in excel which is how it works. I am wondering if there is anywhere to transfer the formula and the way it works from excel into my code so I can have it on my webpage. If anyone knows how to do this or if it is possible please let me know. Thanks!
yea so basically how it works in excel its 's the first column of numbers is the percentage the assignment is worth out of 100
the second column of numbers is what you got
the third column of numbers is what you got * (the amount it’s worth/100)
then you get the sum of the third column and that’s your grade in the class
so the formula has like 2 inputs so its like the sum of (each component*(percentage the component is worth/100))
it’s dependent on how many components there are and how much it’s worth
So i am trying to make that into a webpage thats like easy to use for this school thing I'm doing.
that'll depend on what container you decide to store the scores in: Using C-style (dynamic) array
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
int main()
{
std::cout << "How many components does the assignment have? \n";
size_t num{};
std::cin >> num;//input validation techniques: http://www.cplusplus.com/forum/beginner/206234/int* scores = newint[num];//allocate memory for dynamic array to hold scores
int sum{};
for (size_t i = 0; i < num; ++i)
{
std::cout << "Enter the score for component " << i + 1 << " of " << num << "\n";
std::cin >> scores[i];
sum += scores[i];
}
std::cout << "Total score out of 100: " << sum << "\n";
delete [] scores;//release the allocated memmory
}
Okay sweet alright. I am trying to use that but I'm running into trouble because I tried putting it in the style sheet but there are a lot of different containers and they all have different numbers on them so I am not sure which one to put it in. Does it go in the Java Script or just into the index instead maybe?