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 << "\nColor of Car: " << st_color;
}