SlideShare a Scribd company logo
1 of 2
public class Rice extends Item {
double weight;
double price;
public Rice(String name, double weight, double price) {
super(name);
this.weight = weight;
this.price = price;
}
@Override
public int getCost() {
return (int) Math.
ceil
(weight * price);
}
@Override
public String toString() {
return "rice" + weight + "lbs @" + GroceryStore.
cents2dollarsAndCents
(getCost());
}
}

More Related Content

More from Abhinav816839

CHAPTER 5Risk Response and MitigationIn this chapter, you will.docx
CHAPTER 5Risk Response and MitigationIn this chapter, you will.docxCHAPTER 5Risk Response and MitigationIn this chapter, you will.docx
CHAPTER 5Risk Response and MitigationIn this chapter, you will.docxAbhinav816839
 
BiopsychologySensation and PerceptionInstructionsTake a mom.docx
BiopsychologySensation and PerceptionInstructionsTake a mom.docxBiopsychologySensation and PerceptionInstructionsTake a mom.docx
BiopsychologySensation and PerceptionInstructionsTake a mom.docxAbhinav816839
 
Chapter 2Historical Perspectives on Case ManagementChapter In.docx
Chapter 2Historical Perspectives on Case ManagementChapter In.docxChapter 2Historical Perspectives on Case ManagementChapter In.docx
Chapter 2Historical Perspectives on Case ManagementChapter In.docxAbhinav816839
 
Compare and Contrast Systems Development Life Cycle (SDLC Mo.docx
Compare and Contrast Systems Development Life Cycle (SDLC Mo.docxCompare and Contrast Systems Development Life Cycle (SDLC Mo.docx
Compare and Contrast Systems Development Life Cycle (SDLC Mo.docxAbhinav816839
 
C H A P T E R F O U R PROBLEMS OF COMMUNICATIONCri.docx
C H A P T E R  F O U R  PROBLEMS OF COMMUNICATIONCri.docxC H A P T E R  F O U R  PROBLEMS OF COMMUNICATIONCri.docx
C H A P T E R F O U R PROBLEMS OF COMMUNICATIONCri.docxAbhinav816839
 
By Day 6 of Week Due 917Respond to at least two of your c.docx
By Day 6 of Week Due 917Respond to at least two of your c.docxBy Day 6 of Week Due 917Respond to at least two of your c.docx
By Day 6 of Week Due 917Respond to at least two of your c.docxAbhinav816839
 
ASSIGNMENT 3 (CHAPTERS 8-9) QUESTIONS Name .docx
ASSIGNMENT 3 (CHAPTERS 8-9) QUESTIONS Name                .docxASSIGNMENT 3 (CHAPTERS 8-9) QUESTIONS Name                .docx
ASSIGNMENT 3 (CHAPTERS 8-9) QUESTIONS Name .docxAbhinav816839
 
3 pages excluding the title and reference page.Describe how Ph.docx
3 pages excluding the title and reference page.Describe how Ph.docx3 pages excluding the title and reference page.Describe how Ph.docx
3 pages excluding the title and reference page.Describe how Ph.docxAbhinav816839
 
91422, 1134 AM Printhttpscontent.uagc.eduprintMcNe.docx
91422, 1134 AM Printhttpscontent.uagc.eduprintMcNe.docx91422, 1134 AM Printhttpscontent.uagc.eduprintMcNe.docx
91422, 1134 AM Printhttpscontent.uagc.eduprintMcNe.docxAbhinav816839
 
All details are posted in the documentPlease use this topics for.docx
All details are posted in the documentPlease use this topics for.docxAll details are posted in the documentPlease use this topics for.docx
All details are posted in the documentPlease use this topics for.docxAbhinav816839
 
1, Describe the mind as a stream of consciousness, and what it revea.docx
1, Describe the mind as a stream of consciousness, and what it revea.docx1, Describe the mind as a stream of consciousness, and what it revea.docx
1, Describe the mind as a stream of consciousness, and what it revea.docxAbhinav816839
 
2Some of the ways that students are diverse in todays schools .docx
2Some of the ways that students are diverse in todays schools .docx2Some of the ways that students are diverse in todays schools .docx
2Some of the ways that students are diverse in todays schools .docxAbhinav816839
 
40 CHAPTER 18 THE NEW SOUTH AND THE NEW WEST, 1865-1900 .docx
 40 CHAPTER 18 THE NEW SOUTH AND THE NEW WEST, 1865-1900 .docx 40 CHAPTER 18 THE NEW SOUTH AND THE NEW WEST, 1865-1900 .docx
40 CHAPTER 18 THE NEW SOUTH AND THE NEW WEST, 1865-1900 .docxAbhinav816839
 
1Milestone 1Deanna BuchananSouthern New Hampsh.docx
1Milestone 1Deanna BuchananSouthern New Hampsh.docx1Milestone 1Deanna BuchananSouthern New Hampsh.docx
1Milestone 1Deanna BuchananSouthern New Hampsh.docxAbhinav816839
 
Assignment 7 Sexual Tolerance The Times They Are Achanging.docx
Assignment 7 Sexual Tolerance The Times They Are Achanging.docxAssignment 7 Sexual Tolerance The Times They Are Achanging.docx
Assignment 7 Sexual Tolerance The Times They Are Achanging.docxAbhinav816839
 
Areas for reflectionDescribe how you achieved each course com.docx
Areas for reflectionDescribe how you achieved each course com.docxAreas for reflectionDescribe how you achieved each course com.docx
Areas for reflectionDescribe how you achieved each course com.docxAbhinav816839
 
1. Write Cornell notes after reading materials, Cornell Notes are de.docx
1. Write Cornell notes after reading materials, Cornell Notes are de.docx1. Write Cornell notes after reading materials, Cornell Notes are de.docx
1. Write Cornell notes after reading materials, Cornell Notes are de.docxAbhinav816839
 
1    How to B rief a Case Prepared for the L eg.docx
1    How to B rief a Case  Prepared for the L eg.docx1    How to B rief a Case  Prepared for the L eg.docx
1    How to B rief a Case Prepared for the L eg.docxAbhinav816839
 
4Green Supply Chain Management Effects Outline.docx
4Green Supply Chain Management Effects Outline.docx4Green Supply Chain Management Effects Outline.docx
4Green Supply Chain Management Effects Outline.docxAbhinav816839
 
1. Identify the authors and audience of each of your documents. .docx
1. Identify the authors and audience of each of your documents. .docx1. Identify the authors and audience of each of your documents. .docx
1. Identify the authors and audience of each of your documents. .docxAbhinav816839
 

More from Abhinav816839 (20)

CHAPTER 5Risk Response and MitigationIn this chapter, you will.docx
CHAPTER 5Risk Response and MitigationIn this chapter, you will.docxCHAPTER 5Risk Response and MitigationIn this chapter, you will.docx
CHAPTER 5Risk Response and MitigationIn this chapter, you will.docx
 
BiopsychologySensation and PerceptionInstructionsTake a mom.docx
BiopsychologySensation and PerceptionInstructionsTake a mom.docxBiopsychologySensation and PerceptionInstructionsTake a mom.docx
BiopsychologySensation and PerceptionInstructionsTake a mom.docx
 
Chapter 2Historical Perspectives on Case ManagementChapter In.docx
Chapter 2Historical Perspectives on Case ManagementChapter In.docxChapter 2Historical Perspectives on Case ManagementChapter In.docx
Chapter 2Historical Perspectives on Case ManagementChapter In.docx
 
Compare and Contrast Systems Development Life Cycle (SDLC Mo.docx
Compare and Contrast Systems Development Life Cycle (SDLC Mo.docxCompare and Contrast Systems Development Life Cycle (SDLC Mo.docx
Compare and Contrast Systems Development Life Cycle (SDLC Mo.docx
 
C H A P T E R F O U R PROBLEMS OF COMMUNICATIONCri.docx
C H A P T E R  F O U R  PROBLEMS OF COMMUNICATIONCri.docxC H A P T E R  F O U R  PROBLEMS OF COMMUNICATIONCri.docx
C H A P T E R F O U R PROBLEMS OF COMMUNICATIONCri.docx
 
By Day 6 of Week Due 917Respond to at least two of your c.docx
By Day 6 of Week Due 917Respond to at least two of your c.docxBy Day 6 of Week Due 917Respond to at least two of your c.docx
By Day 6 of Week Due 917Respond to at least two of your c.docx
 
ASSIGNMENT 3 (CHAPTERS 8-9) QUESTIONS Name .docx
ASSIGNMENT 3 (CHAPTERS 8-9) QUESTIONS Name                .docxASSIGNMENT 3 (CHAPTERS 8-9) QUESTIONS Name                .docx
ASSIGNMENT 3 (CHAPTERS 8-9) QUESTIONS Name .docx
 
3 pages excluding the title and reference page.Describe how Ph.docx
3 pages excluding the title and reference page.Describe how Ph.docx3 pages excluding the title and reference page.Describe how Ph.docx
3 pages excluding the title and reference page.Describe how Ph.docx
 
91422, 1134 AM Printhttpscontent.uagc.eduprintMcNe.docx
91422, 1134 AM Printhttpscontent.uagc.eduprintMcNe.docx91422, 1134 AM Printhttpscontent.uagc.eduprintMcNe.docx
91422, 1134 AM Printhttpscontent.uagc.eduprintMcNe.docx
 
All details are posted in the documentPlease use this topics for.docx
All details are posted in the documentPlease use this topics for.docxAll details are posted in the documentPlease use this topics for.docx
All details are posted in the documentPlease use this topics for.docx
 
1, Describe the mind as a stream of consciousness, and what it revea.docx
1, Describe the mind as a stream of consciousness, and what it revea.docx1, Describe the mind as a stream of consciousness, and what it revea.docx
1, Describe the mind as a stream of consciousness, and what it revea.docx
 
2Some of the ways that students are diverse in todays schools .docx
2Some of the ways that students are diverse in todays schools .docx2Some of the ways that students are diverse in todays schools .docx
2Some of the ways that students are diverse in todays schools .docx
 
40 CHAPTER 18 THE NEW SOUTH AND THE NEW WEST, 1865-1900 .docx
 40 CHAPTER 18 THE NEW SOUTH AND THE NEW WEST, 1865-1900 .docx 40 CHAPTER 18 THE NEW SOUTH AND THE NEW WEST, 1865-1900 .docx
40 CHAPTER 18 THE NEW SOUTH AND THE NEW WEST, 1865-1900 .docx
 
1Milestone 1Deanna BuchananSouthern New Hampsh.docx
1Milestone 1Deanna BuchananSouthern New Hampsh.docx1Milestone 1Deanna BuchananSouthern New Hampsh.docx
1Milestone 1Deanna BuchananSouthern New Hampsh.docx
 
Assignment 7 Sexual Tolerance The Times They Are Achanging.docx
Assignment 7 Sexual Tolerance The Times They Are Achanging.docxAssignment 7 Sexual Tolerance The Times They Are Achanging.docx
Assignment 7 Sexual Tolerance The Times They Are Achanging.docx
 
Areas for reflectionDescribe how you achieved each course com.docx
Areas for reflectionDescribe how you achieved each course com.docxAreas for reflectionDescribe how you achieved each course com.docx
Areas for reflectionDescribe how you achieved each course com.docx
 
1. Write Cornell notes after reading materials, Cornell Notes are de.docx
1. Write Cornell notes after reading materials, Cornell Notes are de.docx1. Write Cornell notes after reading materials, Cornell Notes are de.docx
1. Write Cornell notes after reading materials, Cornell Notes are de.docx
 
1    How to B rief a Case Prepared for the L eg.docx
1    How to B rief a Case  Prepared for the L eg.docx1    How to B rief a Case  Prepared for the L eg.docx
1    How to B rief a Case Prepared for the L eg.docx
 
4Green Supply Chain Management Effects Outline.docx
4Green Supply Chain Management Effects Outline.docx4Green Supply Chain Management Effects Outline.docx
4Green Supply Chain Management Effects Outline.docx
 
1. Identify the authors and audience of each of your documents. .docx
1. Identify the authors and audience of each of your documents. .docx1. Identify the authors and audience of each of your documents. .docx
1. Identify the authors and audience of each of your documents. .docx
 

Recently uploaded

NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 

Recently uploaded (20)

NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 

public class Rice extends Item {double weight;double pri.docx

  • 1. public class Rice extends Item { double weight; double price; public Rice(String name, double weight, double price) { super(name); this.weight = weight; this.price = price; } @Override public int getCost() { return (int) Math. ceil (weight * price); } @Override public String toString() { return "rice" + weight + "lbs @" + GroceryStore. cents2dollarsAndCents (getCost());
  • 2. } }