i cant get it to run..help please..i'm a newbie hereCode:#include <stdio.h>
#include <conio.h>
#include <string.h>
int menu();
char get_item(int choice);
float get_price(int choice);
float get_pay(int qty,float price);
void display(char , char , float, int, float);
int main()
{
char name;
int item,choice,qty;
float price,payment;
menu();
display(name,item ,price,qty,payment);
item=get_item(choice);
price=get_price(choice);
payment=get_pay(qty,price);
getche();
}
int menu()
{
char name[20];
int item,choice,qty;
float payment,price;
printf("\n----------------------------------------------------");
printf("\n- WELCOME TO MYCAR ACCESORIES -");
printf("\n----------------------------------------------------");
printf("\n1. Pioneer MP3 Player [ $ 350.00 ]");
printf("\n2. MOMO Sports Steering [ $ 770.00 ]");
printf("\n3. MOMO Gear Knob [ $ 150.00 ]");
printf("\nEnter name : ");
gets(name);
printf("Enter choice : ");
scanf("%d", &choice);
printf("Enter quantity : ");
scanf("%d", &qty);
}
char get_item(int choice)
{
int item[30];
switch (choice)
{
case 1: strcpy(item" Pioneer MP3 Player");
break;
case 2: strcpy(item" MOMO Sports Steering");
break;
case 3: strcpy(item" MOMO Gear Knob");
break;
default:
strcpy(item"Error! Try again please\n");
}return item;
}
float get_price(int choice)
{
float price;
switch (choice)
{
case 1: price = 350.00;
break;
case 2: price = 770.00;
break;
case 3: price = 150.00;
break;
default:price=0;
}
return price;
}
float get_pay(int qty,float price)
{
float payment;
payment = qty * price;
return payment;
}
void display(char name,char item , float price, int qty, float payment)
{
printf("\nName : %s", name);
printf("\nItem : %s", item);
printf("\nPrice : RM %.2f", price);
printf("\nQuantity : %d", qty);
printf("\nPayment : RM %.2f\n\n", payment);
}