Pizza Hub sells pizzas of four sizes, S, M, L,
X. The prices are $6.99, $8.99, $12.50, and $15.00
respectively. For each pizza, there is an optional extra
topping that costs $1.00, $2.00, $3.25, and $4.50
for each size. Write a program to prompt a user to order one pizza
of any size, and then ask if an extra topping is needed. Based on
these, calculate and display the cost of the ordered pizza
accordingly. For this program, you need to use three
parallel arrays to hold the sizes, prices, the topping
costs, and you can use predefined array methods if needed.
Please Write this program in C#
using System;
class HelloWorld {
static void Main() {
char[] sizes={'S','M','L','X'}; //sizes array
double[] prices={6.99,8.99,12.50,15.00}; //prices array
double[] topping={1.00,2.00,3.25,4.50}; //topping array
char size_choice,topping_choice;
double total_cost=0.0;
Console.Write("Enter the size of the pizza(S,M,L,X): ");
size_choice=char.Parse(Console.ReadLine()); //inputting the size of
pizza
Console.Write("Do you want topping(Y/N): ");
topping_choice=char.Parse(Console.ReadLine()); //inputting whether
the customer wants toppings or not
for(int i=0;i<sizes.Length;i++){
if(size_choice==sizes[i]){ //checking the size_match
total_cost+=prices[i]; //adding the cost of the matched size
if(topping_choice=='Y'){ //if topping is choosen then
total_cost+=topping[i]; //add the cost of topping to the total
cost
}
break;
}
}
Console.Write("Total cost: $"+total_cost); //print the cost
}
}
![14. 9 using System; 10 - class HelloWorld { 11 - static void Main() { 12 char[] sizes={ S, M, L,X}; //sizes array 13](http://img.homeworklib.com/questions/2d224b50-8ffa-11eb-bf23-7174b5627fba.png?x-oss-process=image/resize,w_560)
Pizza Hub sells pizzas of four sizes, S, M, L, X. The prices are $6.99, $8.99,...
Part 1: Pizza Price Calculator Size S (10") M(13") L(16") Base Price $6.99 $9.99 $12.99 Each Topping $0.70 $1.00 $1.50 Develop a C++ program that reads in the size of a pizza (S,M, or L) and the number of toppings, and then outputs the total price of the pizza on the screen. The price must be calculated based on the table above. For example, when a customer orders a pizza of size 'M' with three toppings, the total price is...