Build a “Point of Sales” C program for BIGSALES mall that fulfil the below requirements:
1. Print a unique greeting message and logo for your point of sales program. And, prompt the user to enter the year of birth.
2. After that, the program should allow user to choose from the 4 options below:
Option 1: Enter products purchased
Option 2: Enter parking hours
Option 3: Calculate and print the total bill
Option 4: Exit
Option 1 requirements:
The program should read in an indefinite series of products (product code and quantity) purchased by customer. Same product code can be entered more than once.
Given that the retail prices of the products sold by BIGSALES mall are limited to four codes and as listed below:
Option 2 requirements:
The program should read in the customer’s total parking hours. The hours can be in fraction (e.g. 3.15 hours).
Given the calculation of parking fee as below:
Parking fees calculation
RM2.00 minimum fee to park for up to three hours and an additional RM0.50 per hour for each hour or part thereof over three hours. The maximum charge for any given 24-hour period is RM10.00. No car parks for longer than 24 hours should be calculated.
Tips: You can use the C standard function ceil(x) in the math.h library to round up the hours.
Option 3 requirements:
Your program should calculate and display the total bill in a neat format by listing out:
• The total bill and quantity sold for each product code
• The subtotal of the bill
• The 6% government tax of the subtotal
• The total parking hours and parking fees
• The grand total. If the customer is a senior citizen (60 years old and above), he/she shall be given a 10% discount on the grand total. (Assume the current year is 2013).
Note: Your program should use a switch statement to determine the option chosen by the user. Your program should not exit if user does not choose option 4.
You are encouraged to improve your code structure by using any additional controls, validations, or messages which you think are appropriate.
You are allowed to have variances of display design, arrangement or format, as long as it fulfilled the requirement stated above.
~ END OF PAPER ~
**********************************************************
This is my code but I got an error can anyone help me to check ? tq
#include <stdio.h>
int main( void )
{
float parkinghours;
float parkingcharge;
printf( "Enter total parking hours!\n" );
scanf( "%f", &parkinghours );
if(parkinghours <=3){
parkingcharge = 2.00;
}
elseif(parkinghours >=3){
parkingcharge = 2.00 + 0.50* //This is just left open and is going to cause an error
}//You also need to add a closing brace here.
printf ( "Total parking hour is %.2f\n", parkinghours);
return 0;
}