Assignment problem

im haveing a problem with a c++ assignment that i have to do, i finished reports 1 & 2 already but report 3 doesnt make much sense to i tried doin it but it doesnt do what i want to do, im stuck at report 3 can anyone help?

University of the Southern Caribbean
Department of Computer Science
CPTR125 Introduction to Computer Programming

Final Project
Deadline: April 26, 2011

Standard Stores Customer Sales Manager is currently working on the sales strategy plan for the second half of the year 2011. He believes that the strategic plan will be more effective if he has access to summarized data about the company’s current customers. He requires three reports that can be used for the strategic plan.
Report 1: A graph showing the number of items sold on hire-purchase according to category
Report 2: Total value of products sold on hire purchased based on customer gender
Report 3: Total amount of interest paid by customers over the life of their purchase according to category.
Note: Sample output of the three reports is provided at the end.

Company Database (Text file provided)
The company stores its customer records as a ‘#’delimited text file with the following format:
Customer ID, Customer Name, Gender, Payment Plan, Item Category, Cost of Purchase
CustomerID is a 6 character string – first two characters are letters (initials of customer name) and four other characters are numbers.
Customer Name – the last and first name of the customer
Gender – customer gender stored as M for male and F for female.
Payment Plan – stored as an integer that can either be 1, 2 or 3 according to the payment plan chosen by the customer. The company has three different credit plans:

Credit Plan 1:
No down payment, an interest rate of 18% per year and monthly payments of $150. The monthly payment is used to pay the interest and whatever is left is used to pay part of the remaining debt.
Credit Plan 2
Down payment of 10% of the item cost, an interest rate of 15% per year and monthly payments of $125. The monthly payment is used to pay the interest and whatever is left is used to pay part of the remaining debt.

Credit Plan 3
Down payment of 50% of the item cost, an interest rate of 10% per year and monthly payments of $100. The monthly payment is used to pay the interest and whatever is left is used to pay part of the remaining debt.

Item category – Standard categorize their inventory into five groups. The code representing the category is stored in a customer record.
A - Appliances
D - Décor
E - Entertainment Electronics
F - Furniture
L - Lighting

Program
• Write a program that will read the data from the company files and create the required reports.
• Provide a menu driven interface that allows the sales manager to choose the report to be viewed or to exit the application.
• Before exiting the application each report is to be written to a separate file with the following naming convention:
Standard Strategic Sales 2011 <Report Number>.txt

Submission for Grading – Upload the following in a zipped folder labeled as follows <YourName_FINAL>
1. Flow chart for the application
2. Well documented source code. A well thought out user interface will carry extra points.
3. Additional documentation as per discussed in class

Concepts Tested: Arrays, File (Input & Output), Selection, Loops

________________________________________


Sample Input - Record from company database
DW4632#David Wells#M#2#E#12455.00
SB2342#Sonia Bispack#F#1#D#750.00

Sample Output
Report 1
Standard Stores Report
Items sold according to Category


Number
10 |
8 |
6 | XXXX XXXX
4 | XXXX XXXX XXXX
2 | XXXX XXXX XXXX XXXX XXXX
0 |iiiiiiiii XXXX XXXX XXXX XXXX XXXX X
Appliances Décor Electronics Furniture Lighting
Category
Report 2
Standard Stores Report
Total Sales Based on Gender
-----------------------------------------------------------------------
Gender Sales Value
-----------------------------------------------------------------------
Male 122, 569.00
Female 450, 987.34
---------------------
Total 573, 556.34
----------------------

Report 3
Standard Stores Report
Interest Paid According to Category
------------------------------------------------------------------------------
Category Interest Paid
-------------------------------------------------------------------------------
A – Appliances 1, 234.00
D - Décor 1, 234.00
E - Entertainment Electronics 1, 234.00
F - Furniture 1, 234.00
L - Lighting 1, 234.00
---------------------
Total 6, 170.00
----------------------
Last edited on
i thought i knew what it was talking about until it reached "sample input"
haha. good luck figuring it out and writing it in 2 days.
i can help with the "Arrays, File (Input & Output), Selection, Loops" if you have any questions about how to do that stuff. but im not doing your homework for you =P
i wasn't asking u to do my home for me, wouldn't do that..... i just need help with the code for report three its not reading from the right and doing the calculations the way it should. should i show u my code assignment for the entire assignment?
yeah, post your code if you want. and tell me whats goin wrong that needs fixin
just remember to use the code tags so i can read it
Last edited on
This is jus part 3 because the entire code was to long, so idk how much u can get from this...


case 3:

system ("title Report 3");
system ("color a4");
system ("cls");

for(int i = 0;i<31; i++)
{

getline(fin,idNo[i],'#');
getline (fin,cNames[i],'#');
fin>>gender[i];
fin.ignore(1);
fin>>cPlan[i];
fin.ignore (1);
fin>>itemCat[i];
fin.ignore (1);
if (cPlan[i]==1 && itemCat [i]=='A') {
fin>>itemCost[i];
fin.ignore(5);
percentA1= interest1*itemCost[i];
mint1[i]= percentA1/12;
if (mint1[i]>mPayments1){
while(itemCost [i]>0){
remainder1[i]= mint1[i]-mPayments1;

if (remainder1[i]>0){
mint1[i]= mint1[i]+remainder1[i];
appX+= remainder1[i];
}

}//end while
cout<<remainder1 [i];


if (mint1[i]<mPayments1){

do {
remainder2= mPayments1-mint1[i];
if (remainder1[i]>0){
whatsleft= itemCost [i]- remainder2;
appZ+=remainder2;
}

}while (itemCost [i]>0);
}//end else if
app= appX+appZ;
}

}//end if


fin>>itemCost[i];
fin.ignore(5);
if (gender [i] =='M'){
genderM = genderM+1;
sumM += itemCost [i];
}//end if
else if (gender [i]=='F'){
gender2 = gender2 + 1;
sumF += itemCost[i];
}//end else if





}//end for


cout<<app<<" "<<"\n\n\n\n";


break;//end case 3
ok.. ill put it in code tags for you >_> haha..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
case 3:

system ("title Report 3");
system ("color a4");
system ("cls");

for(int i = 0;i<31; i++)
{

getline(fin,idNo[i],'#');
getline (fin,cNames[i],'#');
fin>>gender[i];
fin.ignore(1);
fin>>cPlan[i];
fin.ignore (1);
fin>>itemCat[i];
fin.ignore (1);
if (cPlan[i]==1 && itemCat [i]=='A') {
fin>>itemCost[i];
fin.ignore(5);
percentA1= interest1*itemCost[i];
mint1[i]= percentA1/12;
if (mint1[i]>mPayments1){
while(itemCost [i]>0){
remainder1[i]= mint1[i]-mPayments1;

if (remainder1[i]>0){
mint1[i]= mint1[i]+remainder1[i];
appX+= remainder1[i];
}

}//end while
cout<<remainder1 [i];


if (mint1[i]<mPayments1){

do {
remainder2= mPayments1-mint1[i];
if (remainder1[i]>0){
whatsleft= itemCost [i]- remainder2;
appZ+=remainder2;
}

}while (itemCost [i]>0);
}//end else if
app= appX+appZ;
}

}//end if


fin>>itemCost[i];
fin.ignore(5);
if (gender [i] =='M'){
genderM = genderM+1;
sumM += itemCost [i];
}//end if
else if (gender [i]=='F'){
gender2 = gender2 + 1;
sumF += itemCost[i];
}//end else if





}//end for


cout<<app<<" "<<"\n\n\n\n";


break;//end case 3
so, whats the problem?
if they are one credit plan one u have to do the calculation for credit plan 1 as in the intructions:
No down payment, an interest rate of 18% per year and monthly payments of $150. The monthly payment is used to pay the interest and whatever is left is used to pay part of the remaining debt.

basically i have to sum how much money in interest was paid until the cost of of the item is paid of. so in basic math, you have to multiple the 18% by the cost of the item divide it by 12 and minus 150 from it 12 times and if there any left and left from the 150 u can take it away from the cost of the actual item and the u repeat until the item is paid off but you must always pay the interest first. what do i do if the interest per month is more than the monthly payments?

hope u understand that...
fall into debt? get kicked off the plan? haha.. sorry.. im better at solving syntax problems and showin people ways to do certain things. this is a little more than i can wrap my head around =P
but i can ask other people to take a look at your post and see if they can be of any help.
much appreciated man, i finish the rest of the assignment just this part doesn't make much sense to me, an how do i tag the code like that? i most sound like a real nob, lol
nah, your good.

its under the Format: thing to the right when you write a post --->

button that looks like: <>

put your code inbetween the (code)(/code) tags
only instead of parenthesis, it uses brackets like this: [code]
ok thx for the help, if you any one who can help me please show them the post.
no problem, and ok.
Hi im trying to design a menu system on C++, i cant seem to build anything that works?
Topic archived. No new replies allowed.