4 Replies - 755 Views - Last Post: 11 February 2014 - 06:49 PM Rate Topic: -----

#1 ashafie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 05-February 14

car-pool saving calculator using c++ application,

Posted 11 February 2014 - 12:11 PM

the application should in put the following:
1total miles driven per day;
2.cost per gallon of gasoline;
3.average miles per gallon
4.parking fees per day
5. tolls per day

Using c++ application create a program that calculate daily driven cost, so that you estimate the how much money could be by car pooling, which also other advantages such as reducing carbone emmisions and reducing traffick


Here is what I was able to do.
1. // application to calculate pool savings
2 #include <iostream>
3. using namespace std;
4
5. int main()
6{
7double miles, gas, average, parking, tolls, total;
8cout miles;
9cout gas;
10. cout average;
11. cout parking;
12. cout tolls;
13
14 total=(miles*gas)/ (average+parking+tolls)
15. cout

This post has been edited by modi123_1: 11 February 2014 - 12:17 PM
Reason for edit:: please use code tags


Is This A Good Question/Topic? 0
  • +

Replies To: car-pool saving calculator using c++ application,

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9073
  • View blog
  • Posts: 34,115
  • Joined: 12-June 08

Re: car-pool saving calculator using c++ application,

Posted 11 February 2014 - 12:15 PM

Quote

Here is what I was able to do.

Okay, and what's the question?
Was This Post Helpful? 0
  • +
  • -

#3 Black_Epiphany  Icon User is offline

  • D.I.C Head

Reputation: 9
  • View blog
  • Posts: 64
  • Joined: 02-February 14

Re: car-pool saving calculator using c++ application,

Posted 11 February 2014 - 02:12 PM

Read this http://www.cplusplus...orial/basic_io/

You'll want to ask the user for information and collect it.


cout << "Input total miles driven per day: ";
cin >> miles;

//get the user to input values for your variables and then do some math to calculate whatever it is you need


This post has been edited by Black_Epiphany: 11 February 2014 - 02:16 PM

Was This Post Helpful? 0
  • +
  • -

#4 tarmizi_adam2005  Icon User is offline

  • جوروترا

Reputation: 228
  • View blog
  • Posts: 818
  • Joined: 18-April 09

Re: car-pool saving calculator using c++ application,

Posted 11 February 2014 - 06:05 PM

Quote

Here is what I was able to do.


Are you joking ? the code does not even compile. I believe you could do more unless you've been skipping your C/C++ class at school. Post some serious compile able code with the errors/problems you're facing and we would be glad to help out.

regards,
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9073
  • View blog
  • Posts: 34,115
  • Joined: 12-June 08

Re: car-pool saving calculator using c++ application,

Posted 11 February 2014 - 06:49 PM

Ease up there tarmizi.. ease up there.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1