Can someone help me to complete these C programming language questions
1. In an Internet Café customers are charged as follows for browsing:
a) First hour or part of an hour – 40 Rupees
b) For each hour after that – 20 Rupees per hour or part of an hour
Write a C program such that when the user enters the number of hours of Internet Connection, the program displays the amount to charge from the customer.
Example: If a user browsed the Internet 3 hours and 15 minutes,
Charge = 40 Rs for the 1st hr+20*3 Rs for the next 2 hr and 15 min
2. As an Engineering student you are asked to write a program for a PIC microcontroller where given a certain amount of money it will display the minimum number of 1000/=, 500/=, 200/=, 100/=, 50/=, 20/=, 10/=, 5/=, 2/=, 1/= notes and coins needed.
e.g. Amount = 3677
Your program should print
1000 Notes – 3
500 Notes - 1
200 Notes - 0
100 Notes - 1
50 Notes - 1
20 Notes - 1
10 Notes - 0
05 Notes - 1
02 Notes - 2
01 Notes - 0
Hint :
1000 Rupee Notes = 2754 / 1000 = 2
Remaining Amount = 2754 % 1000 = 754
You need to use suitable variables.
3. You are required to program a PIC16F877A microcontroller, where a user is required to choose a color between RED=1 ,GREEN=2 & BLUE=3 and has to insert the chosen color number to the system. By checking the user input the program gives out the results as,
If the number is equal to 1 -> You chose RED color!
If the number is equal to 2 -> You chose GREEN color!
If the number is equal to 3 -> You chose BLUE color!
If the number is not equal to either of the values -> You did not choose any color!