The Secondhand Rose Resale Shop is having a seven-day sale during which the price of any unsold item drops 10 percent each day. Design an Inventory class that contains an item number and the original price of the item. A default constructor that initializes each attribute to some reasonable default value for a non-existent inventory item. Another constructor that has a parameter for each data member. This constructor initializes each attribute to the value provided when an object of this type is instantiated. Accessor and mutator methods for each attribute. Be sure to incorporate adequate error checking for all numeric attributes. Design an application program that contains a getInput() and a printSaleData() function. The user should enter the item number and the original price of the item. This should continue until the user indicates that they have no more items to enter. For each item entered by the user, an object of Inventory class is created and then is sent to the printSaleData() function for processing. The printSaleData() must accept an Inventory object and produce a report that shows the item number and the price of an inventory item on each day of the sale, one through seven, using a loop. For example, an item with an original price of $10.00 costs 10 percent less, or $9.00, on the first day of the sale. On the second day of the sale, the same item is 10 percent less than $9.00, or $8.10.
import java.util.Scanner; //for Scanner class to read
input
class Inventory{ //Inventory class definition
//attributes declaration
private int item_number;
private double item_price;
//default constructor
public Inventory(){
item_number = 1;
item_price = 10;
}
//parameterized constructor
public Inventory(int number,double price){
item_number = number;
item_price = price;
}
//mutators
public void setItemNumber(int number){
item_number = number;
}
public void setItemPrice(double price){
item_price = price;
}
//accessors
public int getItemNumber(){
return item_number;
}
public double getItemPrice(){
return item_price;
}
}
//driver class named Test
class Test{
static Scanner keyboard; //reference variable of
Scanner class
//getInput method reads item number and price then
returns Inverntory object
public static Inventory getInput(){
int number;
double price;
System.out.print("Enter Item
number: ");
number = keyboard.nextInt();
System.out.print("Enter Item price:
");
price =
keyboard.nextDouble();
return new Inventory(number,
price);
}
//printSalesData method takes Inventory object and
prints the prices day-by-day
public static void printSaleData(Inventory inv){
System.out.println("\nItem Number:
"+inv.getItemNumber());
double price =
inv.getItemPrice();
System.out.println("Original Price:
"+price);
for(int i=1;i<=7;i++){
price = price -
0.1*price;
System.out.printf("Day%d: %.2f\n",i,price);
}
System.out.print("\n");
}
//main method
public static void main(String[] args) {
keyboard = new Scanner(System.in);
//creates object for Scanner class
Inventory inventory[] = new
Inventory[100]; //creates Inventory array of size 100
int len = 0;
char choice; //to store user
choice
while(true){ //loop executes until
user enters other than y
System.out.print("Do you want to enter another item(y/n): ");
choice =
keyboard.next().charAt(0);
if(choice!='y')
break;
inventory[len++]
= getInput(); //calls getInput method
}
for(int i=0;i<len;i++){ //loops
through inventory array and calls printSalesData method
printSaleData(inventory[i]);
}
}
}
//output screenshot

//any query, post in the comment section
The Secondhand Rose Resale Shop is having a seven-day sale during which the price of any...
The RSC Bookstore is having a three-day sale during which the price of any unsold t-shirt drops 15 percent each day. For example, t-shirt that costs $15.00 on the first day costs 15 percent less, or $12.75, on the second day. On the third day, the same item is 15 percent less than $12.75, or $10.84. Design a python script that will input 5 different t-shirt prices. Output is the original price of each item first day, discounted on day2...
The Drive‑Rite Insurance Company provides automobile insurance policies for drivers. Design a single class diagram showing the class, the application program, the relationship between the two, and multiplicity. Insert the completed class diagram into a Word document. Then write the pseudocode as described below. Be sure to follow the CSI 117 Style Criteria (Links to an external site.)Links to an external site. for naming conventions, class diagrams, pseudocode, keywords, and operators. a. Create a PolicyHolder class that contains a policy number,...
MAKE IT DIFFERENT WAYS TO RUN IT: Design an application for each of the following problems writing the pseudocode for each; include a UML diagram if appropriate. Be sure to follow the CSI 117 Style Criteria for naming conventions, class diagrams, pseudocode, keywords, and operators. 1. Wood Trim, Inc. wants a program that will allow its sales clerks to enter the length (in feet) of the trim ordered by a customer and the price of one foot of trim. Design...
Showy Shiny Shoe Store The Showy Shiny Shoe Store sells different styles of shoes, such as sandals and walking shoes. Each style of shoe is offered in different colors, such as brown and black. Available shoe sizes range from size 5 to size 11, in both whole and half sizes. Design an object-oriented computer program by doing the following: Create a class diagram (a UML diagram) for the Shoes class that contains the style of the shoes, the color of...
C++ ONLY This is your first ever program using object oriented methodology. In this assignment you will need to instantiate (create) object(s) and invoke their member functions to perform different tasks. The program is to keep track of customer orders and to create reports as needed. At minimum you will need several objects to be instantiated throughout the program such as: An OrderProcessor object Order objects (stored in an array) Let’s get to class design now. Class Design class Order:...
Write a Gui programming by using JavaFx menus, stage and screen
concepts to the RetailItem class,
Write a class named Retailltem that holds data about an item in a retail store. The class should have the following fields description: The description field is a String object that holds a brief description of the item . unitsOnHand: The unitsOnHand field is an int variable that holds the number of units currently in inventory Price: The price field is a double that...
This is a C++ program Instructions Design a class named PersonData with the following member variables declared as strings: lastName firstName address city state zip phone Create 3 constructors; a default constructor, a constructor that accepts the first and last name member variables, and a constructor that accepts all member variables. Write the appropriate accessor/getter and mutator/setter functions for these member variables. Create a method within this class called getFullName() that returns the person's first and last names as a...
Programming Assignment 6: Object Oriented Programming Due date: Check Syllabus and Canvas Objectives: After successfully completing this assignment, students will practice Object Oriented design and programming by creating a Java program that will implement Object Oriented basic concepts. RetailItem Class: Part 1: Write a class named RetailItem that holds data about an item in a retail store. The class should have the following fields: • description. The description field references a String object that holds a brief description of the...
8.7 LAB*: Program: Online shopping cart (Part 2)Note: Creating multiple Scanner objects for the same input stream yields unexpected behavior. Thus, good practice is to use a single Scanner object for reading input from System.in. That Scanner object can be passed as an argument to any methods that read input.This program extends the earlier "Online shopping cart" program. (Consider first saving your earlier program).(1) Extend the ItemToPurchase class per the following specifications:Private fieldsstring itemDescription - Initialized in default constructor to "none"Parameterized...
DESCRIPTION You have to design an e-commerce shopping cart. These require classes Item, Electronics, Food, Dress, Cart and Main. ITEM CLASS Your Item class should contain: Attributes (protected) String name - name of the Item double price - price of the item Methods (public) void setName(String n) - sets the name of Item void setPrice(double p) - sets the price of Item String getName() - retrieves name double getPrice() - retrieves price String formattedOutput() returns a string containing detail of...