From: gisan <gi...@li...> - 2001-05-07 09:51:41
|
#include <iomanip.h> #include <iostream.h> #include <stdlib.h> const int removal= 500; const int trimming= 80; int main() { int r; int g; int t; float cost; char choice= 'y'; char more_grinding; float total; do { cout<< "please enter the width of tree"; cin>> g ; if(g <=10) { cost = 25; cout << cost; } else if(g >10) { cost = (g - 10) * 2 + 25; cout<< cost; } cout << "anymore grinding...? <y> or <n>"; cin >> choice; } while (choice == 'y'); total= cost + cost+ cost +cost +cost+cost; cout<< "total is...."; cout<< total; system ("pause"); return 0; } please, please please, could some genius help me with this pathetic problem, how cn i modify this code so that when i compute the total cost the subtotal will take into account the number of times the loop has been entered(remebering the cost) and adding each cost, ie) i want to compute a subtotal how can i write code to the following given x amount of integers print the largest how can i use char (n) to write a test program that allows me to see the characters contained within my characterset in my computer from a confused programmer, thanx for your precious time and patience in advance. lostboyz |