hopeolicious 0 Light Poster

Can someone help me to make my program sort according to the average gallons used per car I keep geting 30 - 40 error when i try to compile it. Also
my files do exist.

#include <fstream>
#include <iostream>
#include <iomanip>
using namespace std;

const int MAXCARS = 12;
        float avgallons = 0;
		int numel = 0;
        float totalmiles, totalgallons;

struct Car
{
int number, miles;
float gallons;
float averagegallons;
}Cars;

Car Cars[MAXCARS];


void getdata(int, int, float);
void processdata(int, float);
void sort(float);
void putdata(int, float);

ifstream HopeData;
ofstream MikeData;

void main()
{

HopeData.open("gdata.dat");
MikeData.open("pdata");

if(HopeData.fail())
        {
        cout << "\n\nFile not successfully opened\n\n";
       }
cout << "\n\nFile successfully opened\n\n";

MikeData << "\n\n              Car Report" << endl;
MikeData << "Number       Average Per Car" << endl;
cout << setiosflags(ios::showpoint);
                cout << setiosflags(ios::fixed);
                cout << setprecision(2);

getdata(Cars.number, Cars.miles, Cars.gallons);
putdata(Cars.number, Cars.averagegallons);	

MikeData << "\n\nAverage Gallons Used by All Cars is " << avgallons << endl;
}

void getdata(int number, int miles, float gallons)
{
        while(HopeData.peek() != EOF)
        {
HopeData >> Cars.number >> Cars.miles >> Cars.gallons;
HopeData.ignore(80,'\n');

processdata(Cars.miles, Cars.gallons);
        }
}

void processdata(int miles, float gallons)
{
Cars.averagegallons = Cars.miles / Cars.gallons;
totalmiles = totalmiles + Cars.miles;
totalgallons = totalgallons + Cars.gallons;
avgallons = totalmiles / totalgallons;
numels++;
sort(Cars.averagegallons);
}

void sort(float averagegallons, int numels)
{
int i,j,min,minidx,temp,moves=0;

for(i=0;i<numels;i++)
  {
min = Cars[i];
minidx = i;
 	for(j=i+1;j<numels;j++)
  	{
		if(Cars[j].averagegallons<Cars[i].averagegallons)
		{
		min = Cars[j];
		minidx=j;
		}
		if(min<Cars[i].averagegallons)
		{
       temp=Cars[i];
       Cars[i]=min;
       Cars[minidx]=temp;
	   	}
	}
}

}

void putdata(int number, float averagegallons)
{
        while(HopeData.peek() != EOF) …
hopeolicious 0 Light Poster

Can someone help me to figure his out. I have to read in a file that contains employee names, numbers, payrates, and hours. Then I have to calculate the gross andsend everything to an output file. I keep getting this error message

"employee.cpp" 69 lines, 1471 characters
$ c++ employee.cpp
Undefined first referenced
symbol in file
putdata(char *, int, float) /var/tmp/cckpUsol.o
getdata(char *, int, float, int) /var/tmp/cckpUsol.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
$

this is my program

#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;

const int MAXNAME = 20;
const int NUMRECS = 12;
int i=0;

struct employees
{
int number, hours;
float rate, gross;
char name[MAXNAME];
}employee;

int employees[NUMRECS];

void getdata(char [], int, float, int);
void processdata(float, int);
void putdata(char [], int, float);

ifstream HopeData;
ofstream MikeData;

void main()
{


HopeData.open("personel.dat");
MikeData.open("putdata");

if(HopeData.fail())
{
	cout << "\n\nFile not successfully opened\n\n";
}
cout << "\n\nFile successfully opened\n\n";

getdata(employee.name, employee.number, employee.rate, employee.hours);

putdata(employee.name, employee.number, employee.gross); 

HopeData.close();
MikeData.close();
}

void getdata(int name[], int number, float rate, int hours)
{
		while(i < NUMRECS)
		{

HopeData >> employee.name, employee.number, employee.rate, employee.hours;
		}
processdata(employee.rate, employee.hours);
}

void processdata(float rate, int hours)
{
employee.grossddd = employee.rate * employee.hours;
}

void putdata(char name, int number, float gross)
{
cout << "\n\n              Payroll  Report" << endl;
cout << "        Name        Number        Gross Pay" << endl;    
		cout << setiosflags(ios::showpoint);
		cout << setiosflags(ios::fixed);
		cout << setprecision(2); …
hopeolicious 0 Light Poster

i decared it as a float and now i want to get the average of gallons per mile for all the 5 cars

#include <iostream>
#include <iomanip>
using namespace std;

struct Car
{
int number, miles;
int gallons;
float averagegallons;
};


int main()
{
        const int NUMCAR = 5;
        int i;
        Car Cars[NUMCAR];
        for(i=0;i<NUMCAR;i++)
        {

cout << "\nPlease enter car number: ";
cin >> Cars[i].number;

cout << "\nPlease enter car miles driven: ";
cin >> Cars[i].miles;

cout << "\nPlease enter car gallons: ";
cin >> Cars[i].gallons;
cin.get();

Cars[i].averagegallons = Cars[i].miles / Cars[i].gallons;
        }

cout << "\n\n              Car Report" << endl;
cout << "        Number        Miles Driven        Gallons Used         Average Per Car" << endl;
        for(i=0;i<NUMCAR;i++)
        {
                cout << setiosflags(ios::showpoint);
                cout << setprecision(2);
                cout << Cars[i].number << "\t" << Cars[i].miles << "\t" << Cars[i].gallons << "\t" << Cars[i].averagegallons
<< endl;
hopeolicious 0 Light Poster

how do I get my calculations like ex. I want to add up the average gallons used per mile for a car if the car went like 1450 miles and used 62 gallons of gas

I dont want it to be a whole number i want it to be like 23.38 instead of 23.00

hopeolicious 0 Light Poster

does anyone know the function that will take an array of text and cut it up into words and also cout different words;

ex. I prompt the user to input some text and the i send that text to a function that couts each different word on a new line

hopeolicious 0 Light Poster

how can you reorder numbers that are user input using selection sort in a 1 dimension array and output each element

hopeolicious 0 Light Poster

can someone help me to get my program to sort i have the logic but this is my first time doing a sort program and i cant get it to work can some tell me what i'm doing wrong

#include <iostream>
#include <iomanip>
using namespace std;

void sort();

const int LIMIT = 50; 
int MYARRAY[LIMIT];
    int value,i;
    int x = 0;
    int print = 0;
	int j,temp,min,minx;

int main()
{
    
    bool exit = false;

    
    while(!exit && x < LIMIT)
    {
        cout<<"Enter a number or 999 to quit ";
        cin>>value;
                
        if(value != 999)
        {
            MYARRAY[x] = value;
            x++;
        }
        else
        {
            exit = true;//if value equals 999 exit the loop
        }
       while(print < x)
    {
        cout<<MYARRAY[print]<<endl;//print out the number as long as it is less than i
        print++;
	   }
	}  
sort();  
return 0;    
}

void sort()
{
	
	min=MYARRAY[x];
	minx=i;
	for(j=i+1;j<x;j++)
		if(MYARRAY[j]<min)
		{
			min=MYARRAY[j];
			minx=j;
		}
		if(min<MYARRAY[x])
		{
			MYARRAY[x]=min;
			MYARRAY[minx]=temp;
		}
for(int a=0;a<x;a++)
cout <<setw(4) << MYARRAY[x]<< endl;

}
hopeolicious 0 Light Poster

Can someone help me to output each array element

#include <iostream.h>

void array();

const int LIMIT = 50;
float MYARRAY[LIMIT];
float value = 0;
int x;


void main()
{
	
for(x=0;x<LIMIT;x++)
{
	while(value < 999)
	{ 
		cout << "\n\nPlease enter a number: ";
		cin >> MYARRAY[x];
		value = value + MYARRAY[x];
	}
}
}
hopeolicious 0 Light Poster

Can someone help me to output the numbers in the array that are user inputted and sort them in ascending order please this is the code i've come up with

so far it .... prompts the user no less then 50 elements and a value no more than 999

it doesnt.... output the elements and sorts them

#include <iostream.h>
#include <iomanip.h>

int sort(int [], int);
 const int LIMIT = 50;
    int MYARRAY[LIMIT];
int x,i,j,min,minx,temp,moves=0;
int value;
		
int main()
{
	for(x=0;x<LIMIT;x++)
{
	for(x=0;x<LIMIT;x++)
	{
	while(value < 999)
	{ 
		cout << "\n\nPlease enter a number: ";
		cin >> MYARRAY[x];
		value = value + MYARRAY[x];
		moves = sort(MYARRAY, LIMIT);
	}
	cout << MYARRAY[LIMIT];
	}

	cout << "\n\nThe sorted list, in ascending order, is:\n";
	cout << setw(4) << MYARRAY[LIMIT];
	cout << endl << moves << " moves were made to sort this list\n";
}
	return 0;
}

int sort(int a[], int n)
{

for(x=0;x<(LIMIT-1);x++)
	{
		min = MYARRAY[x];
		minx = x;
		for(j=x+1;j<i; j++)
		{
			if(MYARRAY[j] < min)
			{
				min = MYARRAY[j];
				minx = j;
			}
		}
		if (min < MYARRAY[x])
		{
			temp = MYARRAY[x];
			MYARRAY[x] = min;
			MYARRAY[minx]=temp;
			moves++;
		}
	}
return moves;
}
hopeolicious 0 Light Poster

this is my new code but i keep getting errors in the purchase() and sell() i can input what i need but it doesnt do like the others and keep going until i quit the program

#include <iostream.h>
#include <stdlib.h>

int coke = 0, pepsi = 0, dry = 0, hires = 0, brand, squantity, x, y, quantity, totalcoke, totalpepsi, totaldry, totalhires, soldcoke, soldpepsi, solddry, soldhires, pcoke = 0, ppepsi = 0, pdry = 0, phires = 0, addcoke ,addpepsi, adddry, addhires, coke_add, pepsi_add, dry_add, hires_add;

void initialize();
void instructions();
void sale_type(char option);
void inventory(), purchased(),sell(), display_inventory(), quit();

void main()
{
     initialize();
     instructions();//call instructions function, say goodbye to main forever
}//end function

void initialize()
{
cout << "\n\n Please enter the amount of Coke cases: ";
cin.clear();
cin >> coke_add;
coke = coke_add;

cout << " Please enter the amount of Pepsi cases: ";
cin.clear();
cin >> pepsi_add;
pepsi = pepsi_add;

cout << " Please enter the amount of Canada Dry cases: ";
cin.clear();
cin >> dry_add;
dry = dry_add;

cout << " Please enter the amount of Hires cases: ";
cin.clear();
cin >> hires_add;
hires = hires_add;
}

void instructions()
{
     char option;//declare option variable, this will be used OVER AND OVER
     do
     {
          cout << "\n\nWhat would you like to do?\n";
          cout << " (E)nter Inventory\n";
          cout << " (P)urchase Soda\n";
          cout << " (S)old Soda\n";
          cout << " (D)isplay Inventory\n";
          cout << " (Q)uit\n";//print us some options
               cin  >> option;
               cin.ignore(80,'\n'); //take in an answer
          sale_type(option);//send …
hopeolicious 0 Light Poster
[#include <iostream.h>

void initialize(int& coke, int& pepsi, int& dry, int& hires);
void sales_type(char& sale_type, int& brand, int& quantity, int& coke, int& pepsi, int& dry, int& hires);
//void clearline();
void purchased(int& brand, int& quantity, int& coke, int& pepsi, int& dry, int& hires);
void sell(int& brand, int& quantity, int& coke, int& pepsi, int& dry, int& hires); 
void display_inventory(int& coke, int& pepsi, int& dry, int& hires);


int get_total_coke(int& coke, int& coke_add);
int get_total_pepsi(int& _pepsi, int& pepsi_add);
int get_total_dry(int& dry, int& dry_add);
int get_total_hires(int& hires, int& hires_add);

void main()
{
	       int coke = 0;
	       int pepsi = 0;
           	       int dry = 0;
	       int hires = 0;
	       int brand;
	       int quantity;	
	       char sale_type;

initalize(coke, pepsi, dry, hires);
sales_type(s_type, brand, quantity, coke, pepsi, dry, hires);
purchase(brand, quanitity, coke, pepsi, dry, hires);
sell(brand, quantity, coke, pepsi, dry, hires);
display_inventory(coke, pepsi, dry, hires);
//clearline();
}

void initialize(int& coke, int& pepsi, int& dry, int& hires)
{
       int coke_add;
       int pepsi_add;
       int dry_add;
       int hires_add;

cout << "Please enter the inventory for each item "<< endl;
cout << "Enter the number of Coca-Cola cases: ";
cin >> coke_add;

while (cin.fail())
  {
cin.clear();
        cin.ignore(cin.fail());
        cout << "Invalid input...please re-enter"<< endl;
        cout << "\nEnter the number of Coca-Cola cases: ";
              cin >> coke_add;
   }
coke+= get_total_coke(coke, coke_add);

cout << "\nEnter the number of Pepsi cases: ";
cin >> pepsi_add;

while (cin.fail())
  {
        cin.clear();
        cin.ignore();
        cout << "Invalid input...please re-enter" << endl;
        cout << "\nEnter the number of Pepsi cases: " << endl;
        cin >> pepsi_add;
    }
pepsi+= get_total_pepsi( pepsi, pepsi_add);

cout …
hopeolicious 0 Light Poster

I know everything that i want to do but i never did a menu before so i dont know how to go about doing so if at all possible can someone post a sample program that uses a menu-selection with subprograms for each. This here is something like what i want my program to do


I have a soft drink distrubutorship company that sells coca-cola(id number 1), pepsi(id number 2), sprite(id number 3), and root-beer(id number 4) by the case.

The menu will do the following:

(e) enter invetory
(p) purchase sode
(s) sold soda
(d) display inventory
(q) quit

I will promt the user to enter the inventory for each brand at the start of the week and then process all weekly sales and purchase records for each brand.

Each transaction will consist of 2 data items which are 1) brand identification number and 2) the amount purchased (a positive interger) or the amount sold (a negative integer). It is already assumed that i have sufficient foresight to prevent depletion of my inventory for all the brands. Also the the display of my weekly inventory will contain the brand's name.

everything is inputted from the keyboard.

hopeolicious 0 Light Poster

This is the code that is suppose to compute the class's average and standard diviation from a file which contains a collection of student ids and corresponding scores from my computer class and assign each student a letter grade. the class can have no less than 7 students and no more than 25 student

I need help with aeraging the grades

#include <fstream.h>
#include <iostream.h>
#include <stdlib.h>
#include <iomanip.h>

struct mike
{
int id;
float average = 0;
char lettergrade[1];
int numgrade;
int total = 0;
}hope;

void main()
{
ifstream MyData;
MyData.open("getdata.dat");
ofstream PutData;
PutData.open("putdata");

if(MyData.fail())
 {
        cout << "\n\nFile not successfully opened\n\n";
 }
cout << "\n\nFile Successfully opened\n\n";

int i=0;

do{
MyData >> hope.id >> hope.numgrade;

cout << hope.id << "\t" << hope.numgrade << "\t" << hope.lettergrade << "\t" << hope.average;

hope.total = hope.total + hope.numgrade;
hope.average = hope.average/hope.total;

if (hope.numgrade >= 90) strcpy(hope.lettergrade,"A");
else if (hope.numgrade >= 80) strcpy(hope.lettergrade,"B");
else if (hope.numgrade >= 70) strcpy(hope.lettergrade,"C");
else if (hope.numgrade >= 60) strcpy(hope.lettergrade,"D");
else strcpy(hope.lettergrade,"F");


PutData << "\n\n\n    Class Grades";
PutData << "\n";
PutData << "               Student ID: " << hope.id << endl;
PutData << "      Student Numbergrade: " << hope.numgrade << endl;
PutData << "      Student Lettergrade: " << hope.lettergrade << endl;
PutData << setiosflags(ios::fixed)
        << setiosflags(ios::showpoint)
        << setprecision(2);
PutData << "            Class Average: " << hope.average << endl;
}while(i>7 && i<25);

MyData.close();
PutData.close();
}
hopeolicious 0 Light Poster

I have to write a program to compute the class's average and standard deviation from a file which contains a collection of student idds and corresponding scores for my computer class. I am to assign each stedent a letter grade as follows:

100-90 = A
89-80 = B
79-70 = C
69-60= D
BELOW 60 = F

I am to have no less than 7 students and no more than 25 and i have to save the average

This is what i have come up with so far but I've never did a file and stuff before
can someone help me to make this correct please

This is my file containing the ids and scores
student.dat

#include <fstream.h>
#include <stdlib.h>

int main()
{
const int MAXID =  4;
const MAXNUMGRADE = 3;
ofstream out;
int i = 0, id[MAXID], numgrade[MAXNUMGRADE];

out.open("student.dat");
if(out.fail())
  {
	cout << "The output file was not successfully opened" << endl;
	exit(1);
  }
do{
cout << "\nEnter Student ID: ";
cin >> id;

cout << "Enter student number grade: ";
cin >> numgrade;
}whle(i>7 || i<25); // get and write records while greater than 7 and less than 25

// write the file
out << id << "          " << numgrade << endl;

out.close();
cout << "\n\nEnd of data input.";
cout << "\nThe file has been written.\n";

return 0;
}

and this is the program that reads student.dat

students.cpp

#include <fstream.h>
#include <stdlib.h>

int …
hopeolicious 0 Light Poster

How would I find the highest salary salesperson of a list of salespersons

hopeolicious 0 Light Poster

I want to create a program and send the information i come up with to a data file which already has something in it for Ex. in my data file I have student names and other stuff and in my program i'll find the letter grade of the numeric score and average of everyone's grades and send that infor mation to the data file

Can someone give me an example

hopeolicious 0 Light Poster

I downloaded borland compiler but I dont know how to use it can someone help me

hopeolicious 0 Light Poster

Lol I was just looking at that when I was going over it looking for my errors and I was going to change it but I guess you got to it befor me here is my corrected program

#include<iostream.h>
#include<stdlib.h>
#include<math.h>

int x[25];
int y[25];
int z[25];
int n[25];
int p;
int sum;

void getdata();
void square();

void main()
{
getdata();
square();
}

void getdata()
{
	for(p=0;p<25;++p)
	{
cout << "Please enter some numbers: ";
cin >> n[p];

x[p] = n[p];
y[p] = n[p];
z[p] = x[p] * y[p];
  }
}

void square()
{
	sum = 0;

for(p=0;p<25;++p)
   {
sum = z[p] + x[p] + y[p];
double result = sqrt(sum);
    }
}
hopeolicious 0 Light Poster

This is the code that I have come up with

#include<iostream.h>
#include<stdlib.h>


int x[25];
int y[25];
int z[25];
int n[25];
int p;
int sum;

void getdata();
void square();

main()
{
getdata();
square()
}

void getdata()
{
cout >> "please enter some numbers: ";
cin << n;

 for(p=0;p<25;++p)
  { 
x[p] = n[p];
y[p] = n[p];
z[p]= x[p] * y[p];
  }
}

void square()
{
for(p=0;p,25;++p)
   {
sum= z[p] + x[p] + y[p];
sqrt(sum);
    }
}
hopeolicious 0 Light Poster

I'm confused on how to put n into two arrays x and y prompting the user to only input n less than 25times

hopeolicious 0 Light Poster

Thanx and to let you know getting codes together to complete the assignment wasnt the case the case was I didnt understand fully how to set up the beginning of the code because i didnt fully understand what was meant and i didnt want to go about it the wrong way :cheesy:

hopeolicious 0 Light Poster

I have to write a program to read N data items into two arrays, X and Y, of size 25. Calculate and store the products of corresponding pairs of elements of X and Y in a third array, Z, also of size 25. Also, compute and print the square root of the sum of the items of the three arrays. Prompt the user for input with N less then 25.

I'm not sure how to start it because my mind is so confused at how its worded I dont know what to do first this is only one of three that i have to do before friday so please can you help me please I'm only asking for a start.

hopeolicious 0 Light Poster

It is error free but it just doesnt cout for the user to continue or discontinue and it does now stop

#include <iostream.h>
#include <stdlib.h>
#include "simmons.h"
#include <fstream.h>

const int MAXCHARS = 500;
char st_line[MAXCHARS];
char ch_option;
int i_va;
int i_ve;
int i_vi;
int i_vo;
int i_vu;
int i_letters = 0;
int i_count = 1;
int x = 0;
int i_vowel = 0;
char ch_char;

void hope();
void vowels();
void letter();
void mike();

void main()
{
ifstream HopeData;
HopeData.open("getdata");
ofstream MikeData;
MikeData.open("putdata");

if(HopeData.fail())
   {
        cout << "\n\nFile not successfully opened\n\n";
   }
else
   {
        cout << "\n\nFile successfully opened\n\n";
   }

hope();
while(st_line[x] != '\0');
        HopeData >> st_line;
        cin.get();
do{
vowels();
letter();
}while(ch_option != 'y');
mike();


cout << "\n\nDo you want to continue(Y/N)? ";
        cin.get(ch_option);

        MikeData << "\nInputted String";
        MikeData << "\n\n************************************\n\n" << st_line;
        MikeData << "\n\nNumber of a's: " << i_va;
        MikeData << "\nNumber of e's: " << i_ve;
        MikeData << "\nNumber of i's: " << i_vi;
        MikeData << "\nNumber of o's: " << i_vo;
        MikeData << "\nNumber of u's: " << i_vu;
        MikeData << "\nTotal Vowels: " << i_vowel;
        MikeData << "\n\nNumber of Letters: " << i_letters;

 cout << "                   End of Program";

        HopeData.close();
        MikeData.close();
}

void vowels()
{
while((ch_char = st_line[x++]) != '\0')
switch(ch_char)
  {
        case 'a': case 'A':
          i_va++;
        break;
        case 'e': case 'E':
          i_ve++;
        break;
        case 'i': case 'I':
          i_vi++;
        break;
        case 'o': case 'O':
          i_vo++;
        break;
        case 'u': case 'U':
          i_vu++;
        break;
  }
        i_vowel = i_va + i_ve + i_vi + i_vo + i_vu; …
hopeolicious 0 Light Poster

I compile with soloris and my problem with undertermined character constant in in my function void letter but i dont see why because when i didnt have it in data files or whatever its called my program ran fine

hopeolicious 0 Light Poster
#include<iostream.h>
#include<stdlib.h>
#include "simmons.h"


const int MAXCHARS = 500;
char st_line[MAXCHARS];
char ch_option;
int i_va;
int i_ve;
int i_vi;
int i_vo;
int i_vu;
int i_letters = 0;
int i_count = 1;
int i_number = 0;
int i_vowel = 0;
char ch_char;


void hope();
void vowels();
void letter();
void mike();


void main()
{
ifstream HopeData;
HopeData.open("getdata");
ofstream MikeData;


for(x=0;x<500;x++)
if(st_line[i_letters] == ' ' || st_line[i_letters] == '\0')
i_count--;
while(st_line[i_letters] != '\0')
{
if(st_line[i_letters + 1] != ' ' && (st_line[i_letters + 1] != ' ' && st_line[i_letters + 1] !=
'\0'))
i_count++;
i_letters++;
}
}


MikeData << "\nInputted String";
MikeData << "\n\n*******************************";
MikeData << "\n\n " << st_line;
MikeData << "\n\nNumber of a's: " << i_va;
MikeData << "\nNumber of e's: " << i_ve;
MikeData << "\nNumber of i's: " << i_vi;
MikeData << "\nNumber of o's: " << i_vo;
MikeData << "\nNumber of u's: " << i_vu;
MikeData << "\nTotal Vowels: "<< i_vowel;
MikeData << "\n\nNumber of Letters: " << i_letters;
cout << "\n\n\nDo you want to exit (Y/N)? ";
cin.get(ch_option);


void close()
{
HopeData.close();
MikeData.close();
}

this is what it said when I tried to compile it

count.cpp:94: unterminated character constant
$

hopeolicious 0 Light Poster
Wrong program this is the one that runs but it doesnt loop when i want it to and I wanna know how can I make it count the number of words that the user inputs


#include<iostream.h>
#include<stdlib.h>

const int MAXCHARS = 500;
char st_line[MAXCHARS];
char ch_option;
int i_va;
int i_ve;
int i_vi;
int i_vo;
int i_vu;
int i_number = 0;
int i_vowel = 0;
char ch_char;


void getdata();
void vowels();
void putdata();

void main()
{
while(ch_option != 'n')
   {
getdata();
vowels();
putdata();
   }
}

void getdata()
{
        cout << "\nPlease enter line of text:\n";
        cin.getline(st_line,MAXCHARS);
}

void vowels()
{
while((ch_char = st_line[i_number++]) != '\0')
switch(ch_char)
  {
        case 'a': case 'A':
          i_va++;
        break;
        case 'e': case 'E':
          i_ve++;
        break;
        case 'i': case 'I':
          i_vi++;
        break;
        case 'o': case 'O':
          i_vo++;
        break;
        case 'u': case 'U':
          i_vu++;
        break;
  }
        i_vowel = i_va + i_ve + i_vi + i_vo + i_vu;
}


void putdata()
{
        cout << "\nInputted String";
        cout << "\n\n*******************************";
        cout << "\n\n " << st_line;
        cout << "\n\nNumber of a's: " << i_va;
        cout << "\nNumber of e's: " << i_ve;
        cout << "\nNumber of i's: " << i_vi;
        cout << "\nNumber of o's: " << i_vo;
        cout << "\nNumber of u's: " << i_vu;
        cout << "\nTotal Vowels: "<< i_vowel;
        cout << "\n\nNumber of Words: ";
        cout << "\n\n\nDo you want to exit (Y/N)? ";
        cin.get(ch_option);
}
hopeolicious 0 Light Poster
#include<iostream.h>
#include<stdlib.h>

const int MAXCHARS = 500;
char st_line[MAXCHARS];
char ch_option;
int i_va;
int i_ve;
int i_vi;
int i_vo;
int i_vu;
int i_word;
int i_count = 1;
int i_number = 0;
int i_vowel = 0;
char ch_char;


void getdata();
void vowels();
void words();
void putdata();

int main()
{
do{
getdata();
vowels();
words();
putdata();
}while(ch_option != 'y');
}

void getdata()
{
cout << "\nPlease enter line of text:\n";
cin.getline(st_line,MAXCHARS);
vowels();
}

void vowels()
{

while((ch_char = st_line[i_number++]) != '\0')
switch(ch_char)
{
case 'a': case 'A':
ch_char = i_va;
case 'e': case 'E':
ch_char = i_ve;
case 'i': case 'I':
ch_char = i_vi;
case 'o': case 'O':
ch_char = i_vo;
case 'u': case 'U':
ch_char = i_vu;
i_vowel++;
}
return;
}

void words()
{

if(st_line[i_word] == ' ' || st_line[i_word] == '\0')
i_count--;
while(st_line[i_word] != '\0')
{
if(st_line[i_word] == ' ' && (st_line[i_word + 1] != ' ' && st_line[i_word + 1
] != '\0'))
i_count++;
i_word++;
}
return;
}


void putdata()
{
cout << "\nInputted String";
cout << "\n\n*******************************";
cout << "\n\n " << st_line;
cout << "\n\nNumber of a's: " << i_va;
cout << "\nNumber of e's: " << i_ve;
cout << "\nNumber of i's: " << i_vi;
cout << "\nNumber of o's: " << i_vo;
cout << "\nNumber of u's: " << i_vu;
cout << "\nTotal Vowels: "<< i_vowel;
cout << "\n\nNumber of Words: " << i_word;
cout << "\n\n\nDo you want to exit (Y/N)? ";
cin.get(ch_option);
}
hopeolicious 0 Light Poster

ok this is syntax prrof but it is logically wrong
1. my do while statement doesnt work it keeps outputting my output
2. andit counts my vowels and wrods wrong

can someone please help me

#include<iostream.h>
#include<stdlib.h>

const int MAXCHARS = 500;
char st_line[MAXCHARS];
char ch_option;
int i_va;
int i_ve;
int i_vi;
int i_vo;
int i_vu;
int i_word;
int i_count = 1;
int i_number = 0;
int i_vowel = 0;
char ch_char;


void getdata();
void vowels();
void words();
void putdata();

int main()
{
do{
getdata();
vowels();
words();
putdata();
}while(ch_option != 'y');
}

void getdata()
{
        cout << "\nPlease enter line of text:\n";
        cin.getline(st_line,MAXCHARS);
        vowels();
}

void vowels()
{

while((ch_char = st_line[i_number++]) != '\0')
switch(ch_char)
  {
        case 'a': case 'A':
          ch_char = i_va;
        case 'e': case 'E':
          ch_char = i_ve;
        case 'i': case 'I':
          ch_char = i_vi;
        case 'o': case 'O':
          ch_char = i_vo;
        case 'u': case 'U':
          ch_char = i_vu;
        i_vowel++;
  }
        return;
}

void words()
{

if(st_line[i_word] == ' ' || st_line[i_word] == '\0')
        i_count--;
while(st_line[i_word] != '\0')
 {
  if(st_line[i_word] == ' ' && (st_line[i_word + 1] != ' ' && st_line[i_word + 1
] != '\0'))
        i_count++;
        i_word++;
  }
        return;
}


void putdata()
{
        cout << "\nInputted String";
        cout << "\n\n*******************************";
        cout << "\n\n " << st_line;
        cout << "\n\nNumber of a's: " << i_va;
        cout << "\nNumber of e's: " << i_ve;
        cout << "\nNumber of i's: " << i_vi;
        cout << "\nNumber of o's: " << i_vo;
        cout << "\nNumber of u's: " …
hopeolicious 0 Light Poster

This is what i have but it is like so wrong when I compiled it but I said I was going to post what I had so Imma finish this up and make my corrections and post what I come up with on tomorrow

#include<iostream.h>

char ch_option;
const int MAXCHARS = 500;
char st_line[MAXCHARS];
static const int i_number = 0;
static const int i_vowel = 0;
char ch_char;
int i_count;
int i_word;
int i_va;
int i_ve;
int i_vi;
int i_vo;
int i_vu;


void getdata();
void vowels(char []);
void words();
void putdata();


int main()
{
do{
getdata();
vowels(char []);
words();
putdata();
}while(ch_option != 'Y');
        return 0;
}

void getdata()
{
        cout << "\nPlease enter line of text:\n\n";
        cin.getline(st_line,MAXCHARS);
        vowels(st_line);
        cin.get();
}

void vowels(char [])
{
while((ch_char = st_line[i_number] != '\0');
switch(ch_char)
{
        case 'a': case 'A':
        i_va = ch_char;
        case 'e': case 'E':
        i_ve = ch_char;
        case 'i': case 'I':
        i_vi = ch_char;
        case 'o': case 'O':
        i_vo = ch_char;
        case 'u': case 'U':
        i_vu = ch_char;
        i_vowel++;
}
        return;
}

void words()
{
if(st_line[i_word} == ' ' || st_line[i_word] == '\0')
        count--;
while(st_line[i_word] != '\0')
{
if(st_line[i_word] == ' ' && (st_line[i_word + 1] != ' ' && st_line[i_word = 1}
!= '\0'))
        i_count++;
        i_word++;
}
        return;
}

void putdata()
{
        cout << "\nInputted String";
        cout << "\n\n*******************************";
        cout << "\n\n " << st_line;
        cout << "\n\nNumber of a's: " << i_va;
        cout << "\nNumber of e's: " << i_ve;
        cout << "\nNumber of i's: " << i_vi;
        cout …
hopeolicious 0 Light Poster

Ok I kind of wrote a program of how I think that it goes but i'll have to post it on tomorrow around 1pm I have it wrote in my tablet but its like this

you have to set the message to an array of only 500. In the line of text inputted from the user the program have to count the amount of upper and lowercase letter vowels and then output the # of each vowel seperately example:

switch(char)
{
case 'a': case 'A':
amount of a's = whatever;
case 'e': case 'E':
amount of e's = whatever;
i
o
u
}

and so on, then it should output the # of each and the total number of all
and after that it has to total the # of words in the text.

I have a sense of how the program is I wrote it down in my tablet but i never put it into the computer to compile it but i'm doing that tomorrow after class so i'll post what I have and we can go from there but I think I got it.

Thanx everyone

hopeolicious 0 Light Poster

like I dont know how this program is suppose to go I had an idea for the case statement but the calclating of the upper and lower and vowels I do not have the slightest clue to how to do any of it

hopeolicious 0 Light Poster

Can someone give me a start of my program

I have to write a program usig functions that will read in an array of text and using the case statement determine the number of capital and lowercase letters(a, e, i, o, and u's) found in a string of text with the array 500 and calculate the total number of vowels found in the text. The program shouls allow a user to input a string of text calculate the number of each vowels found in thee text. Then prompt to continue or discontue the process. In the output I have to also promt the user to see if they would like to continue with another input process.

Can someone walk me through the process(something like tutor me) of this because I am so confused I dont know where to start or how to start. we can walk through it on here or we can walk through email but please someone help me with this.

Dave Sinkula commented: "I have no idea where to begin" is very lame. That is page 1 in any C book. And email requests are also in poor taste. +0
hopeolicious 0 Light Poster

I dont know what they mean by undetermined character constant

#include <iostream.h>
#include <stdlib.h>

class student
{
char st_name[25];
char st_major[25];
int i_test1;
int i_test2;
int i_test3;
int i_average;
char ch_grade;
char ch_option;
public:
void getdata();
void processdata();
void putdata();
};

int main()
{
do{
student.getdata();
student.processdata();
student.putdata();
cout << "\n\nDo you want to continue(Y/N)?
cin.get(ch_option);
cin.get();
}while(student.ch_option != 'N');
}

void student::getdata()
{
        cout << "\n\nPlease enter Student's Name: ";
        cin.getline(st_name,25);

        cout << "\n\nPlease enter Student's Major: ";
        cin.getline(st_major,25);

        cout << "\n\nPlease enter Test Score 1: ";
        cin >> i_test1;

        cout << "\n\nPlease enter Test Score 2: ";
        cin >> i_test2;

        cout << "\n\nPlease enter Test Score 3: ";
        cin >> i_test3;
}

void student::processdata()
{
        i_average = (i_test1 + i_test2 + i_test3) / 3;

switch(i_average)
{
        case 9:
                ch_grade = 'A';
        break;

        case 8:
                ch_grade = 'B';
        break;

        case 7:
                ch_grade = 'C';
        break;

        case 6:
                ch_grade = 'D';
        break;

        default:
                ch_grade = 'F';
}
}

void student::putdata()
{
        cout << "Student Average";
        cout << "\n\n**********************************";
        cout << "\n\nStudent Name: " << st_name;
        cout << "\nStudent Major: " << st_major;
        cout << "\nTest Score 1: " << i_test1;
        cout << "\nTest Score 2: " << i_test2;
        cout << "\nTest Score 3: " << i_test3;
        cout << "\n\nAverage: " << i_average;
        cout << "\nGrade: " << ch_grade;
        cout << "\n\n\nDo you want to exit(Y/N)? " << ch_option;
}
hopeolicious 0 Light Poster

when I compiled it it didnt do anything I didnt get any errors or anything like that it just dont do anything. It is suppose to run the getdata(), processdata(), and the putdata()

hopeolicious 0 Light Poster
#include <iostream.h>
#include <string.h>
#include <stdlib.h>
#include <iomanip.h>

class hope
{
char st_title[25];
char st_website[35];
char st_star[25];
char st_maker[25];
char st_rating[5];
int i_minutes;
int i_year;
float f_cost;
int i_age;
char st_status[6];
char st_response[20];
char ch_option;
void getdata();
void processdata();
void putdata();

public:
void run();
}dvd;

void main()
{
char ch_option;
do{
        void run();
}while(ch_option != 'n');
}

void hope::run()
{

dvd.getdata();
dvd.processdata();
dvd.putdata();

}

void hope::getdata()
{
        cout << "\n\nPlease enter title of DVD: ";
        cin.getline(st_title,25);

        cout << "\n\nPlease enter cost of DVD: ";
        cin >> f_cost;

        cin.get();

        cout << "\n\nPlease enter web site: ";
        cin.getline(st_website,35);

        cout << "\n\nPlease enter rating: ";
        cin.getline(st_rating,5);

        cout << "\n\nPlease enter number of minutes: ";
        cin >> i_minutes;

        cin.get();

        cout << "\n\nPlease enter star of movie: ";
        cin.getline(st_star,25);

        cout << "\n\nPlease enter year of copyright: ";
        cin >> i_year;

        cin.get();

        cout << "\n\nPlease enter maker of movie: ";
        cin.getline(st_maker,25);

        cout << "\n\nPlease enter customer age: ";
        cin >> i_age;

}

void hope::processdata()
{
if(i_age < 18 || st_rating == "G")
 {
        strcpy(st_status,"Child");
        strcpy(st_response,"Purchase Authorized");
  }

if(i_age >= 18 || st_rating != "G")
  {
        strcpy(st_status,"Adult");
        strcpy(st_response,"Purchase Authorized");
  }
if(i_age < 18 && st_rating != "G")
  {
        strcpy(st_status,"Child");
        strcpy(st_response,"Cannot Purchase");
  }
if(i_age >= 18)
  {
        strcpy(st_status,"Adult");
        strcpy(st_response,"Purchase Authorized");
  }
}

void hope::putdata()
{
        cout << "\n\nDVD Purchase";
        cout << "\n\n\nTitle: " << st_title;
        cout << "\nWeb Site: " << st_website;
        cout << "\nStar: " << st_star;
        cout << "\nMaker of Film: " << st_maker;
        cout << "\nRating: " << st_rating;
        cout << "\nNumber of Minutes: …
hopeolicious 0 Light Poster

I've replaced the ugly text in this post with something most everybody likes... a kitty:

[img]http://www.cs.fiu.edu/~flynnj/cats/ksw-june99-kitten.jpg[/img]

alc6379

hopeolicious 0 Light Poster

It took me about 2 days but I got it lets see if you can do it. Challenge ends on October 27 the program will then be posted for you viewing

The program is designed to write a three-structured program in structure form with data members and member functions. In addition, it will be using the DO WHILE loop that will loop as many times as the user desires. It will be called from the main function, 1) a function collecting the data, 2) a function processing the data, and 3) a function printing out the data. The program is to assign a status of either Child or Adult, depending on the rating of the DVD. If customer age less than 18 and status is adult, response should be Cannot Purchase otherwise response should be Purchase Authorized. It should be inputted in the following manner:

Title of Dvd
Cost of DVD
Web Site
Rating
Number of Minutes
Star of Movie
Year of Copyright
Maker of Movie
Age of Customer

And should be outputted in the following manner:

DVD Purchase

Title: XXXXXXXXXXXXXXXXXXXXXXXXX
Web Site: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Star: XXXXXXXXXXXXXXXXXXXXXXXXX
Maker of Film: XXXXXXXXXXXXXXXXXXXXXXXXX
Rating: XXX
Number of Minutes: 999
Year of Copyright: 9999
Cost: $999.99
Customer Age: 99
Status: XXXXXX
Response: XXXXXXXXXXXXXXXXXXXX

Do you want to continue(y/n)?

hopeolicious 0 Light Poster

This is my program but that I have to put it into structure form but without using member functions but i dont see how I can make it run

#include <iostream.h>
#include <string.h>
#include <stdlib.h>
#include <iomanip.h>

struct hope()
{
int x;
char st_name[25];
char st_address[75];
char st_color[25];
float f_ccost;
float f_acost;
}
void main()
{
        getdata();
        processdata();
        putdata();
}

void getdata()
{
   cout << "\n\nPlease enter your name: ";
   cin.getline(st_name,25);

   cout << "\n\nPlease enter your address: ";
   cin.getline(st_address,75);

   cout << "\n\nPlease enter the amount you paid for your car: ";
   cin >> f_acost;

   cin.get();

   cout << "\n\nPlease enter your car color: ";
   cin.getline(st_color,25);
}
void processdata()
{
   cout << "\n\nCalculated amount of your car is: ";

if(f_acost < 1200)
  {
   if(strcmp(st_color,"blue")==0)
      {
        f_ccost = f_acost + f_acost*10/100;
        cout << f_ccost;
      }
    else
      {
        cout << f_acost;
      }
  }
else if(f_acost > 1000 && f_acost < 1500)
  {
   if(strcmp(st_color,"black")==0)
      {
        f_ccost = f_acost + f_acost*20/100;
        cout << f_ccost;
      }
     else
      {
      f_ccost = f_acost;
         cout << f_ccost;
      }
  }
else if(f_acost <= 2000)
  {
   if(strcmp(st_color,"white")==0)
    {
      f_ccost = f_acost - 500;
      cout << f_ccost;
      }
      else
      {
      f_ccost = f_acost;
      cout << f_ccost;
     }
  }
else
  {
   f_ccost = f_acost;
   cout << f_ccost;
  }

}
void putdata()
{
   cout << "\nPerson Name: " << st_name;
   cout << "\nAddress: " << st_address;

   cout << setiosflags(ios::fixed)
        << setiosflags(ios::showpoint)
        << setprecision(2);
   cout << "\nActual Cost of Car: $ " << f_acost;
   cout << "\nCalculated Cost of Car: $ " << f_ccost;
   cout …
hopeolicious 0 Light Poster

This is my new code to my program

#include <iostream.h>
#include <string.h>
#include <stdlib.h>
#include <iomanip.h>

int x;
char st_name[25];
char st_address[75];
char st_color[25];
float f_ccost;
float f_acost;


void getdata();
void processdata();
void putdata();


int main()
{
while(x = 0 && x < 3)
 {
        getdata();
        processdata();
        putdata();
  }
}
void getdata()
{
   cout << "\n\nPlease enter your name: ";
   cin.getline(st_name,25);

   cout << "\n\nPlease enter your address: ";
   cin.getline(st_address,75);

   cout << "\n\nPlease enter the amount you paid for your car: ";
   cin >> f_acost;

   cin.get();

   cout << "\n\nPlease enter your car color: ";
   cin.getline(st_color,25);
}
void processdata()
{
   cout << "\n\nCalculated amount of your car is: ";

if(f_acost < 1200)
  {
   if(strcmp(st_color,"blue")==0)
      {
        f_ccost = f_acost + f_acost*10/100;
        cout << f_ccost;
      }
    else
      {
        cout << f_acost;
      }
  }
else if(f_acost > 1000 && f_acost < 1500)
  {
   if(strcmp(st_color,"black")==0)
      {
        f_ccost = f_acost + f_acost*20/100;
        cout << f_ccost;
      }
     else
      {
      f_ccost = f_acost;
         cout << f_ccost;
      }
  }
else if(f_acost <= 2000)
  {
   if(strcmp(st_color,"white")==0)
    {
      f_ccost = f_acost - 500;
      cout << f_ccost;
      }
      else
      {
      f_ccost = f_acost;
      cout << f_ccost;
     }
  }
else
  {
   f_ccost = f_acost;
   cout << f_ccost;
  }

}
void putdata()
{
   cout << "\nPerson Name: " << st_name;
   cout << "\nAddress: " << st_address;

   cout << setiosflags(ios::fixed)
        << setiosflags(ios::showpoint)
        << setprecision(2);
   cout << "\nActual Cost of Car: $ " << f_acost;
   cout << "\nCalculated Cost of Car: $ " << f_ccost;
   cout << "\nColor of Car: " << st_color;


}
hopeolicious 0 Light Poster

I have to use a while loop to display everything 3 times and then i have to use a do while loop to do the same thing
when i added my while and do while loop it keeps on repeating like a millions times and i cant stop it can someone please help me


// Description: Display person name, address, calculated and
// actual cost of car and color of car

#include <iostream.h>
#include <string.h>
#include <stdlib.h>
#include <iomanip.h>


int x;
char st_name[25];
char st_address[75];
char st_color[25];
float f_ccost;
float f_acost;


void getdata();
void processdata();
void putdata();


int main()
{
for(x=1;x<=3;x++)
{
getdata();
processdata();
putdata();
}
}
void getdata()
{
cout << "\n\nPlease enter your name: ";
cin.getline(st_name,25);

cout << "\n\nPlease enter your address: ";
cin.getline(st_address,75);

cout << "\n\nPlease enter the amount you paid for your car: ";
cin >> f_acost;

cin.get();

cout << "\n\nPlease enter your car color: ";
cin.getline(st_color,25);
}
void processdata()
{
cout << "\n\nCalculated amount of your car is: ";

if(f_acost < 1200)
{
if(strcmp(st_color,"blue")==0)
{
f_ccost = f_acost + 10.0/100;
cout << f_ccost;
}
else
{
cout << f_acost;
}
}
else if(f_acost > …

hopeolicious 0 Light Poster

This is my program but i cant get it to calculate my cost
These are my calculations:
1) if the color of the car is blue and the cost of the car is less than 1200 add 10% of the cost of the car to the cost of the car

2) If the color of the car is black and the cost of the car is greater than 100 but less than 1500 add 20% of the cost of the car to the cost of the car

3) If the color of the car is white and cost is less than or equal to 2000 then subtract 500 from the cost of the car

// Description: Display person name, address, calculated and
// actual cost of car and color of car

#include <iostream.h>
#include <string.h>
#include <stdlib.h>
#include <iomanip.h>


int x;
char st_name[25];
char st_address[75];
char st_color[25];
float f_ccost;
float f_acost;


void getdata();
void processdata();
void putdata();


int main()
{
for(x=1;x<=3;x++)
  {
        getdata();
        processdata();
        putdata();
  }
}
void getdata()
{
   cout << "\n\nPlease enter your name: ";
   cin.getline(st_name,25);

   cout << "\n\nPlease enter your address: ";
   cin.getline(st_address,75);

   cout << "\n\nPlease enter the amount you paid for your car: ";
   cin >> f_acost;

   cin.get();

   cout << "\n\nPlease enter your car color: ";
   cin.getline(st_color,25);
}
void processdata()
{
   cout << "\n\nCalculated amount of your car is: ";

if(f_acost < 1200)
  {
   if(strcmp(st_color,"blue")==0)
      {
        f_ccost = f_acost + 10.0/100;
        cout << f_ccost;
      }
    else
      {
        cout << f_acost;
      }
  }
else …
hopeolicious 0 Light Poster

This is my new program and it is like so killing me I dont understand all those errors I keep getting

// Description: This is program 1 of 3 
// Display person name, address, calculated and
// actual cost of car and color of car 3x. 1 using the For Loop, 1
// using While Loop, and 1 using Do While Loop


#include <iostream.h>
#include <string.h>
#include <stdlib.h>


int x;
char st_name;
char st_address;
char st_color;
float f_ccost;
float f_acost;


void getdata();
void processdata();
void putdata();

void main()
{
for(x=0;x<=2;x++)
  {
        getdata();
        processdata();
        putdata();
  }
}
void getdata()
{
   cout << "Please enter your name: ";
   cin >> st_name;

   cout << "\n\nPlease enter your address: ";
   cin >> st_address;

   cout << "\n\nPlease enter the amount you paid for your car: ";
   cin >> f_acost;

   cout << "\n\nPlease enter your car color: ";
   cin >> st_color;
}
void processdata()
{
   cout << "\n\nCalculated amount of your car is: ";

if(f_acost < 1200)
  {
   else if(strcmp(st_color,"blue")==0)
      {
        f_ccost = f_acost * 1.0 +10/100;
        cout << f_ccost;
      }
    else
      {
        cout << f_acost;
      }
else
    {
      if(f_acost > 1000 && f_acost < 1500)
       {
      else if(strcmp(st_color,"black")==0)
           {
            f_ccost = f_acost * 1.0 + 20/100;
            cout << f_ccost;
           }
         else
           {
            cout << f_acost;
     }
else
     {
       if(f_acost <= 2000)
        {
         if(strcmp(st_color,"white")==0)
            {
             f_accost = f_acost - 500.00;
             cout << f_ccost;
            }
          else
            {
             cout << f_acost;
            }
      }
}
void putdata()
{
   cout << "Person Name: " << st_name;
   cout << "\n\nAddress: …
hopeolicious 0 Light Poster

I have to display this prrogram 3 different times using a FOR LOOP but he never showed us how it goes or where it goes I read it in my book and try many different things but nothing works its like it has to display three different people's name and everything using using the FOR LOOP. I am bugging out staying up all night tring to figure this out PLEASE HELP ME PLEASSSSSE!!
I did this program by myself adding the if statement and cin.get but he got me on the rest

// description: display student name, major, status, gpa, and tuition


#include <iostream.h>
#include <iomanip.h>
#include <string.h>
#include <stdlib.h>

void getdata();
void processdata();
void putdata();

char st_name[25];
char st_major[25],c;
char st_status[9];
float f_gpa;
int i_tuition1;


void main()
{
        getdata();
        processdata();
        putdata();
}
void getdata()
{
        cout << "\n\nPlease enter student name: ";
        cin.getline(st_name,25);

        cout << "\n\nPlease enter student gpa: ";
        cin >> f_gpa;

        cout << "\n\nPlease enter student major: ";
        cin.getline(st_major,25);

        int i=0;
        while((c = cin.get()) != '\n')
{
        st_major[i] = c;
        i++;
}
        st_major[i] = '\0';

        cout << "\n\nPlease enter student status as"
             << " 'I' for instate or 'O' for outstate: ";
        cin.getline(st_status,9);

        cout << "\n\nPlease enter student tuition: ";
        cin >> i_tuition1;
}
void processdata()
{
        if(strcmp(st_status,"outstate")==0)
                i_tuition1= i_tuition1 + 1500;
        if(strcmp(st_status,"instate")==0)
                i_tuition1= i_tuition1 + 0;
}
void putdata()
{
        cout << "\n\nName: " << st_name;
        cout << "\n\nMajor: " << st_major;

        cout << setiosflags(ios::fixed)
             << setiosflags(ios::showpoint)
             << setprecision(2);

        cout << "\n\nGPA: " << …