For this assignment, you need to write a program using loops, vectors and error checking. This program will be used by politicians and their staff to record donations to their political campaigns.
Write a c++ program that meets these requirements:
Data: Your program will gather (using cin) and store in a vector the dollar amount of individual donations made to a presidential candidate (you need to store the dollar amounts only). The user will decide when to stop entering donations, so provide a way for the user to stop (eg. "Enter | to stop" or "Enter -1 when finished", etc).
Error Checking: Since there is an upper limit of $2,500 for an individual donation, display a refund notice for any amount over that limit (and your program should not store that over-the-limit donation).
Output: The program should display the refund amount for each donation that is too large, the total of all refunds, the total of all donations and the average donation amount.
Structure: Your program must include the following: 1. A class with at least one private data member and two public functions 2. A vector 3. A main function
Fuck off, do your own homework, later you will see that the students who actually do these kinds of assignments instead of copying them get ahead really quickly.
Carson Davis
Figured. Can't blame a guy for trying. I fucking missed all the classes that cover vectors, loops, and error checking. Can I get any help?
Ian Wood
Install gentoo
Michael Gutierrez
can you point me to some useful resources then? the lecture videos my instructor made are asinine
Juan Carter
#include
int main(){ gentoo.install() return 0 }
James Morris
All the information and practical examples is readily available in the internet, fuck off kid.
Isaiah Hill
/wsr/
Brayden Smith
cplusplus is generally a good resource
or any good c++ textbook. stuff like accelerated c++
Christopher Hall
See
Adrian Robinson
Thank you for the helpful response. I just needed to know a good resource
Evan Price
>C++ EWW Keep that stinky pile of shit away!
Lucas Clark
Why the fuck would this need a class, let alone one with two member functions?
Juan Garcia
Go back to India you cheating mother fucker. And wipe your ass after you are gone, not before.
Noah Johnson
Presumably they want a "donation" class with a member variable for the donation amount, a function to get donation amount and a function to get the refund amount. I'd just do a vector of ints though. no need to pollute the call stack like that.
Isaac Peterson
You could just ask for help instead of making this shitty thread you curry nigger.
Oliver Harris
test
Jason Sanchez
Here you go. Not checked for correctness. #include #include #include #include
class OP { public: OP() : cocksSucked(std::numeric_limits::max()) {} bool is_a_faggot() const { return true; }
I messed up, that private member should be a double.
Does the constructor count as a public function? I think it does.
Noah Torres
It doesn't matter, the entire thing could be done using a running total with no class or vector, the fact that the assignment wants you to use a class is the giveaway that it's some kid's homework. No sane programmer would ever write their own class for a job that simple
Noah Myers
Why is Microsoft shilling C++ so badly?
Jaxson Gomez
EWW wtf
>C++ Makes sense
Levi Young
Fucking retard. You shouldn't even need to attend a class to figure out how to use std::vector.