Write the Vending Machine program in C? - TCS NQT 2020

            Here comes the easy and longest program asked in TCS NQT 2020.

Problem Statement

FULLY AUTOMATIC VENDING MACHINE - dispenses your cup on just press of button. A vending machine can serve range of products as follows:

Coffee

  1. Espresso Coffee
  2. Cappuccino Coffee
  3. Latte Coffee

Tea

  1. Plain Tea
  2. Assam Tea
  3. Ginger Tea
  4. Cardamom Tea
  5. Masala Tea
  6. Lemon Tea
  7. Green Tea
  8. Organic Darjeeling Tea

Soups

  1. Hot and Sour Soup
  2. Veg Corn Soup
  3. Tomato Soup
  4. Spicy Tomato Soup

Beverages

  1. Hot Chocolate
  2. Badam Drink
  3. Badam-Pista Drink


Write a program to take input for main menu & sub menu and display the name of sub menu selected in following format(Enter the first letter to select main menu):

Welcome to CCD

Enjoy your < name of sub menu >


Test Case 1

Input :

c

1

Output :

Welcome to CCD!

Enjoy your Espresso Coffee!


Test Case 2

Input :

t

9

Output :

INVALID OPTION!

Program:


Output:


    

Hope it helps you

Post a Comment

0 Comments