I could really use some C++ help.
10 19 Apr 2017 10:52 by u/Rainy-Day-Dream
I have [this asignment]( due today and I really just don't get how to do this at all I've been studying while loops but I'm really struggling here, please help.
Project 4 Objective: The purpose of this lab project is to expose you to Loops, enforce functions, proper use of by-value/by reference, and to expand your skills in writing larger/more sophisticated programs.
Problem Specification:
The Passaic County Contracting Company, PCCC, negotiates building projects/job contracts. For each contract, the company have to subcontract an electrician to do the electrical, a plumber to do the pluming, a roofer to do the roofing, and a landscaper to do the landscaping. All other work is done internally by their employees. For each project they assign a minimum of 5 employees who are paid salary that varies from employee to employee. The company orders and pays for material which consists of wood, concrete, windows, doors, sheetrock and spackle.
As the programmer for PCCC, they assigned you the task of writing a C++ program to accept the number of the projects/jobs that PCCC has won. For each job, the program should accept: The amount of the contract The amount they paid each subcontractor. For internal work: The salary for each of the employees working on the project, is entered as input until the sentinel 0 is entered (the number of employees is unknown but a minimum of 5). The cost of the material for each of the items listed above. For each contract the program should output to a file, the amount of the contract, the cost of the contract, and the profit/loss from the contract. At the end, the program will output, to the same file: the total electrical cost, total plumbing cost, total roofing cost, total landscaping cost, total cost for material and total cost for salaries for all contracts it then outputs to the same file, the total of all contracts, the cost for all contracts, and the profit/loss for all contracts.
Requirements: Comment as needed. All functions have specifications. All data is passed by value / by reference as appropriate. Main is the driver function, hardly any statements other than function calls, may appear in main. Calculate all totals as requested. Write the report to a file with proper headings, identifications … etc.
Hints: Be sure to initialize your totals and grand totals appropriately. Keep running totals and grand totals between different contracts.
Grading criteria:
1. 5 points
Documentation, every function has a detailed specification.
2. 5 points
Proper spacing, comments, use of variables, general program appearance.
3. 5 points
Functions are self-contained, and accomplishes their tasks
4. 5 points
main() is used as driver, contains no statements, just function calls.
5. 8 points
A loop is used to run as many times as the number of contracts
6. 7 points
A sentinel loop to enter employees' salaries is used correctly.
7. 5 points
Appropriate pass by value and pass by reference.
8. 5 points
Only needed variables are passed between functions, otherwise they are local.
9. 5 points
Accumulators and counters are initialized appropriately
10. 5 points
A flowchart of the function main is handed-in and is correct.
11. 5 points
Hierarchical chart showing all functions and relationships is included and is correct.
12. 10 points
All specified totals are calculated and printed clearly.
13. 15 points
Program runs correctly and produces the intended results.
14. 5 points
Input data is submitted.
15. 5 points
Report is neat, clear, and wit appropriate titles.
16. 5 points
Output file is printed and handed in.
Submission Details: Submit a print-out of: The source file Flowchart (for main() only) Hierarchical chart A copy of your input data A copy of the output file.
*** Due On: 04/19/2017 ***
47 comments
8 u/spookybm 19 Apr 2017 11:05
include iostream.h
include fstream.h
include stdlib.h
include contractor.h
include contractor.c
That is all the hint I will give you.
-1 u/Rainy-Day-Dream [OP] 19 Apr 2017 11:07
can you explain that I bit more, I get that I need to do it myself but I'm really struggling with this, and my grades haven't been so good lately
7 u/spookybm 19 Apr 2017 11:33
iostream for in/out streams
fstream for creating/saving files
contractor.h/c is what you create to make the object of each contractor so that you don't have to heavily rely on functions.
so in the object you state:
class Contractor{
public:
[put accessible parameters here]
private:
[put fixed parameters here]
public:
[insert ALL prototypes for parameters]
}
then in your C file make the functions for the public parameters.
Now you made the object you can use them as "regular" namespaces
For example:
class SexObject{ public: void Vagina( int cocks);
private: float brain[]; }
in the C file
void SexObject::Vagina( int cocks){ if(cocks)
{ Other::Woman = Shut_down(); }
In the main file
int cocks = 1;
SexObject.Vagina(cocks); //Is she quiet?
if(woman==shut_down){ cout<<"All is good"<<endl;
else cout<<"Cock required"<<endl;
get.man();
0 u/Rainy-Day-Dream [OP] 19 Apr 2017 11:40
that's a good idea actually, thanks
0 u/spookybm 19 Apr 2017 11:51
I haven't used C++ recently, so I'm really rusty with it...
Most recent language was embedded C, which is more indepth into microcontrollers than software.
0 u/Plant_Boy 19 Apr 2017 15:11
I like your writing style!
0 u/roznak 19 Apr 2017 20:44
You sir are evil. You did not provide a solution that he can copy and paste from.
0 u/spookybm 20 Apr 2017 01:33
I tell you what.
I had 3 arabs copy my code by photo'ing with their phones without even a courtesy of asking.
I was not surprised to know that they literally failed the course because they didn't bother asking me to explain my code.
0 u/Death2Autism 20 Apr 2017 02:05
University c++ tutor here. Some kids copy their entire homework files and don't bother to change the name of the person they copied from on the source code.
Imo Arabs and fresh off the boat Africans cheat the most. Indians too, but they cheat to learn believe it or not.
0 u/spookybm 20 Apr 2017 02:25
Arabs don't.
2 u/SaveTheChildren 19 Apr 2017 13:25
Maybe if you didn't wait until the day your shit was due before asking for help... now you want random internet people to do your homework for you. Fuck off.
4 u/Mechanicalmechanic 19 Apr 2017 11:23
I don't program in C++ but it appears that you may have a decent idea.
Is it just me or does OP appear to be fishing for someone to do his work for him?
1 u/Rainy-Day-Dream [OP] 19 Apr 2017 11:50
I'm just struggling to do it on my own, you're confusing stupidity with being conniving
3 u/Kael_thas_Sunstrider 19 Apr 2017 11:33
Here is a true student!
Also, can't help you understand logic
-2 u/Rainy-Day-Dream [OP] 19 Apr 2017 11:35
but could you maybe help me understand C++?
1 u/Kael_thas_Sunstrider 19 Apr 2017 11:39
If you just did your courses you would know how to do this. I simply do not have the time to teach you all this in a day.
0 u/SaveTheChildren 19 Apr 2017 13:29
You need to get your shit together and rethink your life. C++ is just the top of the iceberg.
3 u/dottel 19 Apr 2017 11:51
So you are asking for help the day the assignment is due? Lame. laaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaame
-1 u/Rainy-Day-Dream [OP] 19 Apr 2017 11:54
I deserved that
1 u/dottel 19 Apr 2017 11:58
If you had asked for help a week out I would make a legitimate go at helping you and writing code. However, I don't have the time to do this today. I have my own homework to do, and get in on time ... before the day it is due. >:|
-1 u/Rainy-Day-Dream [OP] 19 Apr 2017 12:00
I'm probably going to ask for an extension but I should at least try to do this now
3 u/TheCompanionCube 19 Apr 2017 12:51
I coded up a draft that hits most of the requirements in this assignment. Check out the pastebin:
https://pastebin.com/uEq4VSi8
Fyi be careful copying this. The prof will notice if my code uses techniques that you have not learned yet. There are many ways to do the input for this project as well. I assume you have only learned cin / cout, but you may want to refactoring using an input file or argv. Hopefully this provides a good starting point.
0 u/Rainy-Day-Dream [OP] 19 Apr 2017 12:53
I'll use this as reference but I should really do it myself, thanks for putting this much work in to help me tho
1 u/TheCompanionCube 19 Apr 2017 12:55
Np, this stuff is fun for me. GL
-1 u/SaveTheChildren 19 Apr 2017 13:26
Doing others work for them so they don't have to learn is fun for you?
-1 u/slevin_kelevra 19 Apr 2017 15:13
Dude go "save the children"
1 u/SaveTheChildren 19 Apr 2017 15:33
doing it by telling this faggot kid to do their own homeowrk.
You're not helping anyone
2 u/Tancred 19 Apr 2017 10:57
We're not gonna open a docx.
2 u/Rainy-Day-Dream [OP] 19 Apr 2017 11:01
here it's an image now can you please help me
7 u/ohnoitsaninja 19 Apr 2017 11:24
Here is the deal. This is VERY, VERY basic. It isn't going to get any easier. It's going to get much harder, soon. Buck up or become the 2/3rds college statistic. Stop slacking off, learn the shit, do the work, this plea for help is an embarrassment and could get you in deep trouble with your school if you continue, I would highly suggest you delete all traces of this and put your head down in your notes.
-Sincerely, a fellow college drop out
FYI I would have helped you if you had posted good code of a solid attempt but couldn't get it working.
As a starting point, rewrite this gibberish assignment into terms and math that are clear to understand, then put that math into code. That is the biggest thing stopping anyone from helping you more, it's just tedious and you need to do it.
-1 u/Rainy-Day-Dream [OP] 19 Apr 2017 11:26
I know, and I've been keeping up until now on my own through my own effort but I didn't do so well on the last assignment and I just wanna get through the semester
1 u/ohnoitsaninja 19 Apr 2017 11:38
get off voat and begin translating this bullshit assignment into clear understandable math ASAP. Eat your pent up procrastination and just start doing it.
0 u/Rainy-Day-Dream [OP] 19 Apr 2017 11:41
I am, but I'm stuggling, people gave me some good advie here already but obviously I still need to do the work
1 u/ohnoitsaninja 19 Apr 2017 11:48
Someone here told you about classes via sex references. Someone else told you about includes. You should ignore both of these people.
The first line of the assignment indicates to me you are not really expected to be doing this with classes, but rather loops and functions.
Make a list of all the functions you think you'll need to do this, and start fleshing them out. You could of course do it all in one function, they are just to help you organize. You'll want a function for saving the file, collecting the order information, calculating it, displaying the results, etc.
0 u/Rainy-Day-Dream [OP] 19 Apr 2017 11:51
that's true, I shouldn't bother with classes
2 u/SaveTheChildren 19 Apr 2017 13:28
Just fuck off and do the work nigger.
1 u/Antiracist10 19 Apr 2017 13:18
You are gay.
@SarMegahhikkitha @bojangles @eagleshigh @cancel-cat-facts
0 u/Atarian 19 Apr 2017 12:24
Do your own homework.
0 u/NeoGoat 19 Apr 2017 16:12
Can you get an extension? As a heads up: pogramming courses are generally very time consuming, at least they were when I was in school. You get faster with time, but being at the start of the learning curve is not fun. I don't have the time to do more today. Good luck.
0 u/LordRygon 20 Apr 2017 01:18
Coding isn't your issue here. You need help with problem solving skills. Mainly, taking a big problem and breaking into manageable pieces, tackling those pieces, and putting it all together. Problem solving is the real skill that you need to get through engineering or compsci degrees Most people fail because they are bad at solving complex problems, not because they can't grasp the underlying mathematics.
0 u/Rainy-Day-Dream [OP] 20 Apr 2017 01:25
mostly I just need to stop being retarded, study more, and get started on these projects earlier, luckily I go to community college at the moment and my peers are even more retarded than me so I have until monday to do this, but I got it mostly done today
0 u/Death2Autism 20 Apr 2017 02:09
You could pay an Indian to do it for you, but being a tutor, I'm 99% sure you're going to fail the class anyway.
-2 u/SaveTheChildren 19 Apr 2017 13:31
" hey voat, I'm a cunt who can't do the simplest of programming work without being spoon fed, please do this hw for me because I'm a tard. PS it's due today! Thanks! "
How about you go fuck yourself?