For my C++ class we are trying to create a grade projector but the part I am stuck on is the entering of the Assignment score part and project part, which are just adding funtions that then are suppose to display all 12 answers as a point total. (10 are Assignment and 2 are Project)when i add in the decimal to a assignment answer, the decimal then scrambles the code and stops the executable.
// Grade Projector.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
There is nothing wrong with your loops. The only issue here is that everytime you do cin>> a or cin>>b you overwrite the last input. The way you are doing it will have sum of last a and last b in c.
You need to keep adding the input everytime like JLBorges is doing
total_score += assignment_score
.
Just initialize c=0 than do c=c+ a or c= c+b after every input and remove c= a+b. That will solve the issue