The class Item has the following private member variables Data Type Variable Name string itemId string itemName string itemType string itemVendor Include appropriate setters and getters for the above class.   Include the following constructors in the Item class Constructor Name Description Item( )                                                                                                                                                                          This default constructor used to initialize the itemType as “Electricals” and itemVendor as “Arun electricals”                                                                                            Item(string itemId,string itemName,string itemType,string itemVendor)                                                                                                                                                                                                                                                                      This Parameterized constructor is used to assign values as entered by the user. In the main method, obtain input from the user in the console and create a new Item object and assign the values to the object's members using constructors. Display the item details in the main method.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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.

The class Item has the following private member variables

Data Type Variable Name
string itemId
string itemName
string itemType
string itemVendor

Include appropriate setters and getters for the above class.

 

Include the following constructors in the Item class

Constructor Name Description
Item( )                                                                                                                                                                          This default constructor used to initialize the itemType as “Electricals” and itemVendor as “Arun electricals”                                                                                           
Item(string itemId,string itemName,string itemType,string itemVendor)                                                                                                                                                                                                                                                                      This Parameterized constructor is used to assign values as entered by the user.


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

Display the item details in the main method.

 

Input  format:

The first line of input consists of an integer that corresponds to the choice 1 or 2

The next following inputs correspond to item details

 

Output  format:

Display the Item details

If the choice entered is not 1 or 2 print "Invalid choice"

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:

Menu:

1.Electronics

2.Others

Enter your choice:

1

Enter details of the item

Enter item id:

Item001

Enter the item name:

Switch

Item details

Item id:Item001

Item name:Switch

Item type:Electricals

Item vendor:Arun electricals


Sample Input and Output 2:

Menu:

1.Electronics

2.Others

Enter your choice:

2

Enter details of the item

Enter item id:

Item002

Enter the item name:

Table

Enter the item type:

Furniture

Enter the item vendor:

Modern furniture

Item details

Item id: Item002

Item name: Table

Item type: Furniture

Item vendor: Modern furniture

 

Sample Input and Output 3:

M

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.

The class Item has the following private member variables

Data Type Variable Name
string itemId
string itemName
string itemType
string itemVendor

Include appropriate setters and getters for the above class.

 

Include the following constructors in the Item class

Constructor Name Description
Item( )                                                                                                                                                                          This default constructor used to initialize the itemType as “Electricals” and itemVendor as “Arun electricals”                                                                                           
Item(string itemId,string itemName,string itemType,string itemVendor)                                                                                                                                                                                                                                                                      This Parameterized constructor is used to assign values as entered by the user.


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

Display the item details in the main method.

 

Input  format:

The first line of input consists of an integer that corresponds to the choice 1 or 2

The next following inputs correspond to item details

 

Output  format:

Display the Item details

If the choice entered is not 1 or 2 print "Invalid choice"

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:

Menu:

1.Electronics

2.Others

Enter your choice:

1

Enter details of the item

Enter item id:

Item001

Enter the item name:

Switch

Item details

Item id:Item001

Item name:Switch

Item type:Electricals

Item vendor:Arun electricals


Sample Input and Output 2:

Menu:

1.Electronics

2.Others

Enter your choice:

2

Enter details of the item

Enter item id:

Item002

Enter the item name:

Table

Enter the item type:

Furniture

Enter the item vendor:

Modern furniture

Item details

Item id: Item002

Item name: Table

Item type: Furniture

Item vendor: Modern furniture

 

Sample Input and Output 3:

Menu:

1.Electronics

2.Others

Enter your choice:

4

Invalid choice

enu:

1.Electronics

2.Others

Enter your choice:

4

Invalid choice

Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education