I have a problem with this code can please fix it and explain it for me: //header files #include #include #include //main body int main() { std::string pizza_type; char size; std::cout<<"Welcome to Freddy's Pizza\n\n"; std::cout<<"Pizza Menu:\n"; std::cout<<"\t1- Vegetarian Pizza\n"; std::cout<<"\t2- Chicken Dynamite Pizza\n"; std::cout<<"\t3- Vegetarian Lovers Pizza\n";

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

I have a problem with this code can please fix it and explain it for me:

 

//header files

#include<iostream>

#include<conio.h>

#include<string.h>

//main body

int main()

{

        std::string pizza_type;

        char size;

       

        std::cout<<"Welcome to Freddy's Pizza\n\n";

        std::cout<<"Pizza Menu:\n";

        std::cout<<"\t1- Vegetarian Pizza\n";

        std::cout<<"\t2- Chicken Dynamite Pizza\n";

        std::cout<<"\t3- Vegetarian Lovers Pizza\n";

       

        std::cout<<"\nWhich Pizza would you like to try?\t";

        getline(std::cin,pizza_type);

       

        std::cout<<"\nWhat size of pizza would you like (L,M,S)?\t\t";

        std::cin>>size;

       

       

        if(size=='L'||size=='M'||size=='S') //checking the selection order of pizza size

        {

              

        if(strcmp(pizza_type.c_str(),"Vegetarian")==0)  //chceking the selection order of pizza type

        {   std::cout<<"\n\nPizza Order:\n";

               std::cout<<"\nPizza Name:"<<pizza_type;

               std::cout<<"\nPreparation Time:20 Minutes\n";

               std::cout<<"\nCalories:25\n";

               if(size=='L')

                 std::cout<<"\nPizza Price:4 OMR\n";

               else if(size=='M')

                 std::cout<<"\nPizza Price:3 OMR\n";

               else

                 std::cout<<"\nPizza Price:2 OMR\n";

               std::cout<<"\nToppings:\n";

               std::cout<<"\nOnion,Green paper,Olives,Sweet Corn and Mushrooms";

        }

       

        else if(strcmp(pizza_type.c_str(),"Chicken Dynamite")==0) //chceking the selection order of pizza type

      {

            std::cout<<"\n\nPizza Order:\n";

        std::cout<<"\nPizza Name:"<<pizza_type;

               std::cout<<"\nPreparation Time:20 Minutes\n";

               std::cout<<"\nCalories:150\n";

               if(size=='L')

                 std::cout<<"\nPizza Price:7 OMR\n";

               else if(size=='M')

                 std::cout<<"\nPizza Price:5 OMR\n";

               else

                 std::cout<<"\nPizza Price:3 OMR\n";

               std::cout<<"\nToppings:\n";

               std::cout<<"\nGrilled Chicken,Cheese,Raunch Sauce,Jalapenos";

          }

 

    else if(strcmp(pizza_type.c_str(),"Meat Lovers")==0) //chceking the selection order of pizza type

    {   std::cout<<"\n\nPizza Order:\n";

        std::cout<<"\nPizza Name:"<<pizza_type;

               std::cout<<"\nPreparation Time:20 Minutes\n";

               std::cout<<"\nCalories:250\n";

               if(size=='L')

                 std::cout<<"\nPizza Price:8 OMR\n";

               else if(size=='M')

                 std::cout<<"\nPizza Price:6 OMR\n";

               else

                 std::cout<<"\nPizza Price:4 OMR\n";

               std::cout<<"\nToppings:\n";

               std::cout<<"\nMinced Meat,Cheese,BBQ Sauce,Fresh Tomatos";

        }

       

        else                         //if the selection order is wrong

         std::cout<<"wrong selection";

        }

       

       

        else                 //if the selection order is wrong

         std::cout<<"wrong selection";

   

        getch();

        return 0;

}

   

> clang++-7 -pthread -std=c++17 -o main main.cpp
main.cpp:5:9: fatal error:
'conio.h' file not found
#include<conio.h>
1 error generated.
compiler exit status 1
Transcribed Image Text:> clang++-7 -pthread -std=c++17 -o main main.cpp main.cpp:5:9: fatal error: 'conio.h' file not found #include<conio.h> 1 error generated. compiler exit status 1
> clang++-7 -pthread -std=c++17 -o main main.cpp
> ./main
Welcome to Freddy's Pizza
Pizza Menu:
1- Vegetarian Pizza
2- Chicken Dynamite Pizza
3- Vegetarian Lovers Pizza
Which Pizza would you like to try?
2
What size of pizza would you like (L,M, S) ?
wrong selection: L
bash: L: command not found
Transcribed Image Text:> clang++-7 -pthread -std=c++17 -o main main.cpp > ./main Welcome to Freddy's Pizza Pizza Menu: 1- Vegetarian Pizza 2- Chicken Dynamite Pizza 3- Vegetarian Lovers Pizza Which Pizza would you like to try? 2 What size of pizza would you like (L,M, S) ? wrong selection: L bash: L: command not found
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY