answersLogoWhite

0


Best Answer

#include minfee = 2; int main() { int car1,car2,car3,hour,hour2,hour3,charge1,charge2,charge3, totalhour,totalcharge,minfee; printf("Enter car number\n"); scanf("%d", &car1); printf("How many hour did the car park\n"); scanf("%d", &hour); if (hour>=3) { charge1 = (minfee+hour*0.50); } else { charge1 = 2.00; } printf("Enter car number\n"); scanf("%d", &car2); printf("How many hour did the car park\n"); scanf("%d", &hour2); if (hour>=3) { charge2 = (minfee+hour*.50); } else { charge2 = 2.00; } printf("Enter car number\n"); scanf("%d", &car3); printf("How many hour did the car park\n"); scanf("%d", &hour3); if(hour>=3) { charge3 = (minfee+hour*0.50); } else { charge3 = 2.00; } totalhour=(hour+hour2+hour3); printf("%d", totalhour); totalcharge=(charge1+charge2+charge3); printf("%d", totalcharge); return 0; }

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a C program that calculates parking charges for a given day?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a program that calculates the sum of the matrix elements given numbers?

ring me and ill explain - 086 22222222222222227 ring me


Which function calculates the averages of a given set of numbers in excel?

Surprisingly, it is =AVERAGE(number1, number2,...)


How much space is given when parallel parking in MD?

25feet


What is a rate at which charges pass a given point?

Current


What are the benefits of echelon parking?

The benefits of echelon parking is that it allows one to park quicker and more easily than parking in a straight line. By parking at this angle it allows a greater number of cars to be parked in any given space.


Write a C program to extract a given word from a file?

program to extract a given word from a file


Algorithms to the given c plus plus programs?

The question is impossible to answer. You cannot determine an algorithm from a given program if the program is not actually given in the question. Please place the program in the discussion section.


In which sets are the charges given correctly for all the ions?

meth


What is a purchases budget?

A purchases budget represents what a business plans to buy. It also calculates how much inventory it will hold over a given period of time.


Which of these methods calculates the market value of all final goods and services produced within a country's borders in a given year?

Gross Domestic Product


What is Purchasing budget?

A purchases budget represents what a business plans to buy. It also calculates how much inventory it will hold over a given period of time.


How many parking spaces in a given area?

That kind of depends on the space given but genrally guessing about 100 to 150 spaces.