Answered step by step
Verified Expert Solution
Question
1 Approved Answer
pg 2 using c programming language. please include comments I have already started but want to receive further clarification on my logic. Arrays & Pointers/
pg 2
using c programming language. please include comments I have already started but want to receive further clarification on my logic.
Arrays & Pointers/ Gas and Car Wash Program The program determines the charges for purchasing gasoline and a possible car wash. Our company has 4 gasoline rates, for economy, regular, mid-grade, and premium gas. The program will read data for each customer as follows Type of gas: (1- economy, 2-regular, 3-mid-grade, and 4-premium) Number of gallons of gas (eg, 1675) Response for car wash (Y-Yes, N-No) Write the following functions: displayMenu) Will display a "Welcome" message and a menu of choices for gas. getinfol Asks the user for their choice of gas, number of gallons and whether or not they want a car wash. You may not use global variables! (Hint: Use pointers to "return" the various values) getGasRate) Will accept the type of gas and the gasprices array as a pointer and return the per gallon rate. Use pointer notation. getWashRate() Will accept the type of gas and the washprices array as a pointer and return the wash rate. Use pointer notation. calcAmount0 Will accept the gas rate, gallons, wash rate and return a total amount. Give the customer a $1.00 discount on a car wash if he buys at least 10 gallons. Use the printf to print out each customer's gas and car wash charge and individual total main) You must create two parallel arrays to start, one for the gas rate and one for the car wash rate. The car wash rate is determined by the type of gas that the customer has selectedStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started