Im trying to grasp c++ but i cant.

I have a overdue assignment of
//The Yuba College Library would like a
program to calculate patron fines for overdue books. Fines are determined as follows:
Paperbacks Regular $.20 / day with a maximum
fine of $ 8.00 Best-Sellers $.50 / day with a maximum fine of $15.00 Magazines $.25 / day with a maximum fine of $ 5.00 Hardcover Books $.30 / day with a maximum fine of $23.00
The program must prompt the user to enter the following information at the keyboard. Data entry MUST be validated as required. Fines must also be calculated using a function(s). A class object should contain the methods (functions) to determine library fine. Provide a UML and description of disign.

tbh i dont know how to start like the design can someone help me
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
int days=0; //number of days
int paper=0; //number of paperbacks
int best=0;
int hard=0;
int mag=0;//you get the idea by now

double pfine=0.0; //paperback fine. Have a fine variable for each type of book
double tfine=0.0;//total fine. 

cout<<"Enter how many of (paper, best, hard or mag) books you have overdue. ";
cin>>paper; //or best or hard or mag

cout<<"Enter the days you have this overdue. "<<endl;
cin>>days;

pfine=days*.20;
pfine=pfine*paper;

if(pfine>8)
pfine=8

//Rinse and repeat, organize into void functions. ez. add all into tfine when they have run their course. Validating data should not be an issue, this should demonstrate the core concept, I hope. 

Last edited on
Topic archived. No new replies allowed.