Define a struct menuItemType with two components: menuItem of type string and menuPrice of type double.
#include<iostream>
#include <stdio.h>
#include <string>
using namespace std;
struct menuItem
{
string Item;
double menuPrice;
};
main(void)
{
struct menuItem M1,M2;
M1.Item = "Pizza";
M1.menuPrice = 10;
M2.Item = "Cold Drink";
M2.menuPrice = 5;
cout<<"\nMenu Item-1: "<<M1.Item<<"\tPrice: US $ "<<M1.menuPrice;
cout<<"\nMenu Item-2: "<<M2.Item<<"\tPrice: US $ "<<M2.menuPrice;
return(0);
}
Comments
Leave a comment