Answer to Question #291864 in C++ for reethu

Question #291864

Best selling refrigerator

Mrs.Roselin, a homemaker wished to buy a refrigerator with all new features in order to preserve and store the vegetables, fruits, and food items more efficiently.

Write a C++ program to display the Best-Selling refrigerator Manufacturer and various models manufactured by them to Roselin.

Types of refrigerators manufactured by "Whirlpool" are as follows:

1.Single Door

2.Double Door

Input and Output Format:

The refrigerator types manufactured by Whirlpool

1.SingleDoor

2.DoubleDoor

Refrigerator type of your choice?

SingleDoor

The refrigerator models manufactured by Whirlpool

1.Whirlpool_Royal

2.Whirlpool_ELT

3.Whirlpool_Icemagic

4.Whirlpool_Protton

5.Whirlpool_Powercool

Refrigerator of your choice?

Whirlpool_Icemagic

Refrigerator Details

Manufacturer : Whirlpool

Type : SingleDoor

Model : Whirlpool_Icemagic


1
Expert's answer
2022-01-29T06:24:54-0500
#include <iostream>


bool in_range(int a1,int a2 , int res)
{
    if (a1 >= res && res <= a2)
    {
        return 1;
    }
    else
    {
        return 0;
    }
}


int main()
{
    std::string door = "";
    std::string model = "";






    std::cout << "The refrigerator types manufactured by Whirlpool\n1.SingleDoor\n2.DoubleDoor\nRefrigerator type of your choice?\n";


    std::cin >> door;
    while (1)
    {
        if (door == "SingleDoor")
        {
            break;
        }
        else if (door == "DoubleDoor")
        {
            break;
        }
        std::cout << "Enter correct value : ";
        std::cin >> door;
    }


    ////


    std::cout << "\nThe refrigerator models manufactured by Whirlpool\n1.Whirlpool_Royal\n2.Whirlpool_ELT\n3.Whirlpool_Icemagic\n4.Whirlpool_Protton\n5.Whirlpool_Powercool\nRefrigerator type of your choice?\n";


    std::cin >> model;
    while (1)
    {
        if (model == "Whirlpool_Royal")
        {
            break;
        }
        else if (model == "Whirlpool_ELT")
        {
            break;
        }
        else if (model == "Whirlpool_Icemagic")
        {
            break;
        }
        else if (model == "Whirlpool_Protton")
        {
            break;
        }
        else if (model == "Whirlpool_Powercool")
        {
            break;
        }
        std::cout << "Enter correct value : ";
        std::cin >> model;
    }


    ////


    std::cout << "\nRefrigerator Details\nManufacturer : Whirlpool\nType : "<<door<<"\nModel : "<<model<<"\n\n";
    system("Pause");
    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