Answer to Question #183028 in C++ for Vincenzo Santoro

Question #183028

Instructions

Define a struct menuItemType with two components: menuItem of type string and menuPrice of type double.


1
Expert's answer
2021-05-03T01:20:02-0400


#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);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS