SlideShare a Scribd company logo
1 of 1
Please Help Need ASAP
JAVA
Write a class named Food with the following specifications:
Name the class Food
Create the following instance variables: String name, double weight, and String taste
Create a constructor that will be blank
Create another constructor that will take in three arguments: name, weight and taste . Use the
this keyword to assign the instance variables values based on the arguments passed in by the
constructor. HINT: public Food(String name, int weight, String taste)
Create an accessor (aka get) and a mutator (aka set) method which will get and set the weight
and taste instance variables of the Food class. (Total of 4 methods)
Create a method called "public String data()". This method will return a String which will
contain the name, weight, and taste of the fruit.

More Related Content

More from kathrynj2

More from kathrynj2 (10)

Please help me draw this chart The City of Lethbridge has decided to b.docx
Please help me draw this chart The City of Lethbridge has decided to b.docxPlease help me draw this chart The City of Lethbridge has decided to b.docx
Please help me draw this chart The City of Lethbridge has decided to b.docx
 
Please help in writing these in OCaml functional programming language.docx
Please help in writing these in OCaml functional programming language.docxPlease help in writing these in OCaml functional programming language.docx
Please help in writing these in OCaml functional programming language.docx
 
please show all work Assume we are using the simple model for floating.docx
please show all work Assume we are using the simple model for floating.docxplease show all work Assume we are using the simple model for floating.docx
please show all work Assume we are using the simple model for floating.docx
 
please help esp on the first one 3- Bacteriophages have lytic and lys.docx
please help esp on the first one  3- Bacteriophages have lytic and lys.docxplease help esp on the first one  3- Bacteriophages have lytic and lys.docx
please help esp on the first one 3- Bacteriophages have lytic and lys.docx
 
Please review the Trade agreement between the North American Countries.docx
Please review the Trade agreement between the North American Countries.docxPlease review the Trade agreement between the North American Countries.docx
Please review the Trade agreement between the North American Countries.docx
 
Please provide 1 explanation and 1 example for each of the points abov.docx
Please provide 1 explanation and 1 example for each of the points abov.docxPlease provide 1 explanation and 1 example for each of the points abov.docx
Please provide 1 explanation and 1 example for each of the points abov.docx
 
PLEASE PROVIDE ME WITH DETAILED INFORMATION ON A RESEARCH INTERESTS F.docx
PLEASE PROVIDE ME WITH DETAILED INFORMATION ON A  RESEARCH INTERESTS F.docxPLEASE PROVIDE ME WITH DETAILED INFORMATION ON A  RESEARCH INTERESTS F.docx
PLEASE PROVIDE ME WITH DETAILED INFORMATION ON A RESEARCH INTERESTS F.docx
 
Please place the following events in transcription in the correct orde.docx
Please place the following events in transcription in the correct orde.docxPlease place the following events in transcription in the correct orde.docx
Please place the following events in transcription in the correct orde.docx
 
please match the processes below with the correct description Match th.docx
please match the processes below with the correct description Match th.docxplease match the processes below with the correct description Match th.docx
please match the processes below with the correct description Match th.docx
 
Please look up the Terri Schiavo case I- Introduction- Describe the p.docx
Please look up the Terri Schiavo case  I- Introduction- Describe the p.docxPlease look up the Terri Schiavo case  I- Introduction- Describe the p.docx
Please look up the Terri Schiavo case I- Introduction- Describe the p.docx
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Recently uploaded (20)

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
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...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
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
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

Please Help Need ASAP JAVA Write a class named Food with the followin.docx

  • 1. Please Help Need ASAP JAVA Write a class named Food with the following specifications: Name the class Food Create the following instance variables: String name, double weight, and String taste Create a constructor that will be blank Create another constructor that will take in three arguments: name, weight and taste . Use the this keyword to assign the instance variables values based on the arguments passed in by the constructor. HINT: public Food(String name, int weight, String taste) Create an accessor (aka get) and a mutator (aka set) method which will get and set the weight and taste instance variables of the Food class. (Total of 4 methods) Create a method called "public String data()". This method will return a String which will contain the name, weight, and taste of the fruit.