Question: TED UNIVERSITY Computer Engineering Department Lab Assignment 11 2017 Fall, CMPE 112 Fundamentals of Programming Question 1 Write a class called Product with the following
TED UNIVERSITY Computer Engineering Department Lab Assignment 11 2017 Fall, CMPE 112 Fundamentals of Programming Question 1 Write a class called Product with the following variables and methods Variables (5 points) (All variables should be declared as private.) name > String * price double * quantity >int type-> String Methods (20 points) . get and set methods for all variables. . setProductinformation method gets name, price and quantity as parameter and sets related variables. printinfo method prints the product information as given in the sample output Question2 Write a class called ShoppingCart which has a main method. First create an array of taken products with an initial size of O. (Productl products new Producto:) Your program should perform four different operations and it should ask for an operation until user enters 5 1-Add product (20 points) . Ask for product name, price and quantity of the product Create a new Product object and set related information by using setProductinformation method . Increase the size of products array and add the new product to the array Let's remember how to increase size of an array o create a new temporary array of size+ 1 o copy all items of the original array to temporary array and add the new item to the last slot of temporary array o assign temporary array to the original array 2-Enter tyee (15 points) Ask for name ofthe product (You may assume that an existing product wil be entered.) *
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
