Write a C++ program to add and search ItemTypes using an array, and to display whether the itemType is available or not. Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement. Create class ItemType with the following private member variables. Data Type Variable Name string itemName double itemDeposit double costPerDay   Create another class named ItemTypeBO and include the following member functions. Member Function strong> int searchItemTypeByName(ItemType *itemtype,int n,string searchName)                                                                                                                   This function accepts an array of itemtype, size of an array, and itemType to be searched. The function is used to search the itemType from the array of itemType using searchName. If the itemtype is available it returns 1 otherwise returns 0. ItemType createItemType(string itemName,double itemDeposit,double costPerDay)                                                                                                                                                                                                                             It takes itemtype name, deposit amount, cost per day as input. It creates an object of class  ItemType and returns it. Note: Use Array of Objects In the main method, obtain input from the user in the console and create a new ItemType object and assign the values to the object's members using setters. Get the name of the ItemType to be searched and display whether the ItemType is found or not using SearchItemTypeByName method. Input  format: The first line of input consists of an integer that corresponds to the number of item types. The following inputs correspond to item type details. The last line of input consists of a string that corresponds to the item name to be searched.   Output format: The output consists of a string If the given item name is found print "ItemType found" else print "ItemType not found" If the number of item types is less than 1 print "Invalid Number" Refer sample input and output for formatting specifications   [All text in bold corresponds to input and rest corresponds to output] Sample Input and Output 1: Enter the number of Itemtypes: 2 Enter details of item type 1 Enter the Itemtype name: Stationary items Enter the deposit: 5000 Enter cost per day: 5 Enter details of item type 2 Enter the Itemtype name: Electronic items Enter the deposit: 70000 Enter cost per day: 70 Enter the item name to be searched: Stationary items ItemType found   Sample Input and Output 2: Enter the number of Itemtypes: 2 Enter details of item type 1 Enter the Itemtype name: Furnitures Enter the deposit: 100000 Enter cost per day: 1000 Enter details of item type 2 Enter the Itemtype name: Food items Enter the deposit: 5000 Enter cost per day: 50 Enter the item name to be searched: Table ItemType not found   Sample Input and Output 3: Enter the number of Itemtypes: -8 Invalid Number

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

Write a C++ program to add and search ItemTypes using an array, and to display whether the itemType is available or not.

Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement.

Create class ItemType with the following private member variables.

Data Type Variable Name
string itemName
double itemDeposit
double costPerDay

 

Create another class named ItemTypeBO and include the following member functions.

Member Function strong>
int searchItemTypeByName(ItemType *itemtype,int n,string searchName)                                                                                                                   This function accepts an array of itemtype,
size of an array, and itemType to be searched.
The function is used to search the itemType
from the array of itemType using searchName.
If the itemtype is available it returns 1 otherwise returns 0.
ItemType createItemType(string itemName,double itemDeposit,double costPerDay)                                                                                                                                                                                                                             It takes itemtype name, deposit amount,
cost per day as input. It creates an object of class  ItemType
and returns it.


Note:
Use Array of Objects

In the main method, obtain input from the user in the console and create a new ItemType object and assign the values to the object's members using setters.

Get the name of the ItemType to be searched and display whether the ItemType is found or not using SearchItemTypeByName method.

Input  format:
The first line of input consists of an integer that corresponds to the number of item types.
The following inputs correspond to item type details.
The last line of input consists of a string that corresponds to the item name to be searched.
 

Output format:
The output consists of a string
If the given item name is found print "ItemType found" else print "ItemType not found"
If the number of item types is less than 1 print "Invalid Number"
Refer sample input and output for formatting specifications
 

[All text in bold corresponds to input and rest corresponds to output]

Sample Input and Output 1:
Enter the number of Itemtypes:
2
Enter details of item type 1
Enter the Itemtype name:
Stationary items
Enter the deposit:
5000
Enter cost per day:
5
Enter details of item type 2
Enter the Itemtype name:
Electronic items
Enter the deposit:
70000
Enter cost per day:
70
Enter the item name to be searched:
Stationary items
ItemType found
 
Sample Input and Output 2:
Enter the number of Itemtypes:
2
Enter details of item type 1
Enter the Itemtype name:
Furnitures
Enter the deposit:
100000
Enter cost per day:
1000
Enter details of item type 2
Enter the Itemtype name:
Food items
Enter the deposit:
5000
Enter cost per day:
50
Enter the item name to be searched:
Table
ItemType not found
 
Sample Input and Output 3:
Enter the number of Itemtypes:
-8
Invalid Number

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 3 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