3
Answers

Problem with Iteration on Service Charge

Have a problem with a question with Service Charge for Charging a customer for house cleaning (for instance). If the charge is $80 for the first 5 hours, and $5 for every other hour. 
 
While I know how to make the first charge, what is the syntax for getting additional hours. 
 
I will also need to add tax to the total charge.
 
Thanks 
Answers (3)
0
Jeremiah Clement

Jeremiah Clement

NA 8 140 7y
Code helped.
 
I have the background result, the charge and Tax are calculated. now I want to achieve the following;
 
Program features:
  1. The program will prompt the user to enter: the customer's name, the house addresses, and the number of hours the house was cleaned this week.
  2. The program will display customer name, house name, and the service charge and tax for each customer.
  3. A method named CalculateCharges to determine the charge for each customer
  4. A decision structure
  5. A looping structure
  6. An array structure that contains the house address for each customer
0
Jeremiah Clement

Jeremiah Clement

NA 8 140 7y
Laxmidar,
 
Thank you for this input, I will add it to my code and see how it works out.
 
Will update you.
 
Thanks alot 
0
Laxmidhar Sahoo

Laxmidhar Sahoo

NA 2.3k 1.4k 7y
create a function
 
  1. public decimal gettotalcharcge(int hour)  
  2. {  
  3. decimal chrges =0.0;   
  4. if(hour <= 5)  
  5.  chrges = 80*hours  
  6. else   
  7.  chrges = (80 * 5) + ( (hours - 5) * 5);  
  8.    
  9. return chrges ;   
  10. }