SlideShare a Scribd company logo
1 of 7
Download to read offline
Buy here:
http://studentland8.mybigcommerce.com/cs-151-unit-6-a
ssignment/
Unit 6 Assignment
Grading Information: This Program is due on Date Specified.
Comments are REQUIRED flow charts and pseudocode are NOT REQUIRED.
Directions Points
The file must be called <LastInitialFirstInitialUnit6.java> (driver)
<LastInitialFirstInitialPets.java> (handles variables and methods for the Pet
Class)
Proper coding conventions required the first letter of the class start with a capital
letter and the first letter of each additional word start with a capital letter.
Only submit the .java files needed to make the program run. Do not submit the
.class files or any other files.
5%
Style Components 5%
Include properly formatted prologue, comments, indenting, and other style
elements as shown in Chapter 2 starting page 64 and Appendix 5 page 881-892.
Topics covered in chapter
Topics with * are covered in this assignment. Ensure you use every item listed
below with an * in your completed assignment.
*Object Oriented Programming *Driver Class
Calling Objects, this reference *Instance Variables
Tracing
UML
*Local Variables
*The return statement
*Argument Passing
*Specialized Methods – *Accessor, *Mutator, and Boolean Methods Problem
Solving with Simulation (optional)
Basic Guidelines
You will be making a very basic Pet Tracker. You will be tracking type, name,
age, etc and outputting some information at the end.
LiFiUnit6.java (driver)
Provide a driver class that has the following items:
• Creates 3 instances of your LiFiUnit6Pets class. You may use a loop but it is
not required.
60%
● Gets input for first type, name as String. Notice in the example how the prompts
change once the name has been entered.
● Get input for age as integer.
● Get input for weight as double.
● Get input for isMale as Boolean.
● For the 1st pet, use the default constructor and use proper mutator methods to set all
variables.
● For the 2nd pet, use a single parameter constructor that accepts type as an argument
and use proper mutator methods for all other values.
● For the 3rd pet, use a constructor that accepts all values as arguments.
● Create a class method (in your driver), that counts the number of dogs and the
number of cats. It is recommended you create one method called countPets that
accepts the pet instance, type, and 0 as a constant for number. This method should
return the number of the pet set to it. This method is required but how it works is up to
you.
● After counting the pets, if you have 1 or more dogs and 1 or more cats, output “I sure
hope the cats and dogs get along”.
● Call displayPet method from your Pets class.
LiFiPets.java
Provide a pets class that has accessor/mutator methods for all variables
pertaining to the pets above.
• Create a method called displayPet and output the values for all pets, see
sample below. Ensure to output “Male” or “Female” based on isMale. Cal lthis
method for each pet.
Sample output is provided below. Be sure to mimic it exactly except for values
entered.
30%
NOTE: Complete your activity and upload to assignment.
Total Percentage 100%
Sample
Notice how once the name is input, the name is used in the
following prompts.
The below example has 2 dogs and 1 cat so notice the output
about hoping the pets get along.
Welcome to the Java Pet Tracker.
Please enter the type of Pet #1 (Dog or Cat): Dog
Please enter the name of Pet #1: Max
Please enter the age of Max: 3
Please enter the weight of Max in pounds (example 5.2): 85.2 Is Max Male (true/false): true
Please enter the type of Pet #2 (Dog or Cat): Dog
Please enter the name of Pet #2: Buddy
Please enter the age of Buddy: 4
Please enter the weight of Buddy in pounds (example 5.2): 75.6 Is Buddy Male (true/false): true
Please enter the type of Pet #3 (Dog or Cat): Cat
Please enter the name of Pet #3: CiCi
Please enter the age of CiCi: 10
Please enter the weight of CiCi in pounds (example 5.2): 10.6 Is CiCi Male (true/false): false
Calculating Pet Population and Stuff
I sure hope them cats and dogs get along!
Pet Registration Information: Type: Dog
Name: Max
Age: 3
Weight: 85.2 Sex: Male
Type: Dog Name: Buddy Age: 4 Weight: 75.6 Sex: Male
Type: Cat Name: CiCi Age: 10 Weight: 10.6 Sex: Female
The below examples is of all Cat’s so notice no statement
about hoping they get along.
Welcome to the Java Pet Tracker.
Please enter the type of Pet #1 (Dog or Cat): Cat
Please enter the name of Pet #1: CiCi
Please enter the age of CiCi: 10
Please enter the weight of CiCi in pounds (example 5.2): 10.7 Is CiCi Male (true/false): false
Please enter the type of Pet #2 (Dog or Cat): Cat
Please enter the name of Pet #2: Zeus
Please enter the age of Zeus: 2
Please enter the weight of Zeus in pounds (example 5.2): 7.6 Is Zeus Male (true/false): true
Please enter the type of Pet #3 (Dog or Cat): Cat
Please enter the name of Pet #3: Strawberry
Please enter the age of Strawberry: 2
Please enter the weight of Strawberry in pounds (example 5.2): 11.6 Is Strawberry Male
(true/false): false
Calculating Pet Population and Stuff
Pet Registration Information: Type: Cat
Name: CiCi
Age: 10
Weight: 10.7 Sex: Female
Type: Cat Name: Zeus Age: 2 Weight: 7.6 Sex: Male
Type: Cat
Name: Strawberry Age: 2
Weight: 11.6 Sex: Female
Type a description for this product here...

More Related Content

Similar to CS 151 Unit 6 Assignment

The purpose of this project is to give students more exposure to obje.pdf
The purpose of this project is to give students more exposure to obje.pdfThe purpose of this project is to give students more exposure to obje.pdf
The purpose of this project is to give students more exposure to obje.pdfforwardcom41
 
Can someoen help me to write c++ program including C++ inheritance, .pdf
Can someoen help me to write c++ program including C++ inheritance, .pdfCan someoen help me to write c++ program including C++ inheritance, .pdf
Can someoen help me to write c++ program including C++ inheritance, .pdfarrowvisionoptics
 
1_1_python-course-notes-sections-1-7.pdf
1_1_python-course-notes-sections-1-7.pdf1_1_python-course-notes-sections-1-7.pdf
1_1_python-course-notes-sections-1-7.pdfJavier Crisostomo
 
All programming assignments should include the name, or names, of th.pdf
All programming assignments should include the name, or names, of th.pdfAll programming assignments should include the name, or names, of th.pdf
All programming assignments should include the name, or names, of th.pdffashioncollection2
 
My Program below this is supposed to do the following below here but.pdf
My Program below this is supposed to do the following below here but.pdfMy Program below this is supposed to do the following below here but.pdf
My Program below this is supposed to do the following below here but.pdfarihantelehyb
 
Hub102 - JS - Lesson3
Hub102 - JS - Lesson3Hub102 - JS - Lesson3
Hub102 - JS - Lesson3Tiểu Hổ
 
DOES NOT NEED TO BE ANSWERED UNTIL NOV 13thWords AssignmentRober.pdf
DOES NOT NEED TO BE ANSWERED UNTIL NOV 13thWords AssignmentRober.pdfDOES NOT NEED TO BE ANSWERED UNTIL NOV 13thWords AssignmentRober.pdf
DOES NOT NEED TO BE ANSWERED UNTIL NOV 13thWords AssignmentRober.pdfarchanaemporium
 
Polymorphism.ppt
Polymorphism.pptPolymorphism.ppt
Polymorphism.pptEmanAsem4
 
UNIT 1- RELATIONAL DATABASE DESIGN USING PLSQL.pdf
UNIT 1- RELATIONAL DATABASE DESIGN USING PLSQL.pdfUNIT 1- RELATIONAL DATABASE DESIGN USING PLSQL.pdf
UNIT 1- RELATIONAL DATABASE DESIGN USING PLSQL.pdfKavitaShinde26
 
PLEASE HELP IN C++For this test, you will need to create the follo.pdf
PLEASE HELP IN C++For this test, you will need to create the follo.pdfPLEASE HELP IN C++For this test, you will need to create the follo.pdf
PLEASE HELP IN C++For this test, you will need to create the follo.pdfaioils
 
1)When describing my ethnicity, I have a tendency to describe myse.docx
1)When describing my ethnicity, I have a tendency to describe myse.docx1)When describing my ethnicity, I have a tendency to describe myse.docx
1)When describing my ethnicity, I have a tendency to describe myse.docxmonicafrancis71118
 
READ BEFORE YOU START You are given a partially completed pr.pdf
READ BEFORE YOU START  You are given a partially completed pr.pdfREAD BEFORE YOU START  You are given a partially completed pr.pdf
READ BEFORE YOU START You are given a partially completed pr.pdfarkurkuri
 
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docxCMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docxmary772
 
The Java Script Programming Language
The  Java Script  Programming  LanguageThe  Java Script  Programming  Language
The Java Script Programming Languagezone
 
Les origines de Javascript
Les origines de JavascriptLes origines de Javascript
Les origines de JavascriptBernard Loire
 
Javascript by Yahoo
Javascript by YahooJavascript by Yahoo
Javascript by Yahoobirbal
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming LanguageRaghavan Mohan
 

Similar to CS 151 Unit 6 Assignment (20)

The purpose of this project is to give students more exposure to obje.pdf
The purpose of this project is to give students more exposure to obje.pdfThe purpose of this project is to give students more exposure to obje.pdf
The purpose of this project is to give students more exposure to obje.pdf
 
Can someoen help me to write c++ program including C++ inheritance, .pdf
Can someoen help me to write c++ program including C++ inheritance, .pdfCan someoen help me to write c++ program including C++ inheritance, .pdf
Can someoen help me to write c++ program including C++ inheritance, .pdf
 
1_1_python-course-notes-sections-1-7.pdf
1_1_python-course-notes-sections-1-7.pdf1_1_python-course-notes-sections-1-7.pdf
1_1_python-course-notes-sections-1-7.pdf
 
All programming assignments should include the name, or names, of th.pdf
All programming assignments should include the name, or names, of th.pdfAll programming assignments should include the name, or names, of th.pdf
All programming assignments should include the name, or names, of th.pdf
 
My Program below this is supposed to do the following below here but.pdf
My Program below this is supposed to do the following below here but.pdfMy Program below this is supposed to do the following below here but.pdf
My Program below this is supposed to do the following below here but.pdf
 
Hub102 - JS - Lesson3
Hub102 - JS - Lesson3Hub102 - JS - Lesson3
Hub102 - JS - Lesson3
 
PHP Classes and OOPS Concept
PHP Classes and OOPS ConceptPHP Classes and OOPS Concept
PHP Classes and OOPS Concept
 
DOES NOT NEED TO BE ANSWERED UNTIL NOV 13thWords AssignmentRober.pdf
DOES NOT NEED TO BE ANSWERED UNTIL NOV 13thWords AssignmentRober.pdfDOES NOT NEED TO BE ANSWERED UNTIL NOV 13thWords AssignmentRober.pdf
DOES NOT NEED TO BE ANSWERED UNTIL NOV 13thWords AssignmentRober.pdf
 
Ma3696 lecture 4
Ma3696 lecture 4Ma3696 lecture 4
Ma3696 lecture 4
 
Polymorphism.ppt
Polymorphism.pptPolymorphism.ppt
Polymorphism.ppt
 
UNIT 1- RELATIONAL DATABASE DESIGN USING PLSQL.pdf
UNIT 1- RELATIONAL DATABASE DESIGN USING PLSQL.pdfUNIT 1- RELATIONAL DATABASE DESIGN USING PLSQL.pdf
UNIT 1- RELATIONAL DATABASE DESIGN USING PLSQL.pdf
 
PLEASE HELP IN C++For this test, you will need to create the follo.pdf
PLEASE HELP IN C++For this test, you will need to create the follo.pdfPLEASE HELP IN C++For this test, you will need to create the follo.pdf
PLEASE HELP IN C++For this test, you will need to create the follo.pdf
 
1)When describing my ethnicity, I have a tendency to describe myse.docx
1)When describing my ethnicity, I have a tendency to describe myse.docx1)When describing my ethnicity, I have a tendency to describe myse.docx
1)When describing my ethnicity, I have a tendency to describe myse.docx
 
READ BEFORE YOU START You are given a partially completed pr.pdf
READ BEFORE YOU START  You are given a partially completed pr.pdfREAD BEFORE YOU START  You are given a partially completed pr.pdf
READ BEFORE YOU START You are given a partially completed pr.pdf
 
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docxCMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
CMPS 5P Assignment 3 Spring 19Instructions1. The aim o.docx
 
The Java Script Programming Language
The  Java Script  Programming  LanguageThe  Java Script  Programming  Language
The Java Script Programming Language
 
Les origines de Javascript
Les origines de JavascriptLes origines de Javascript
Les origines de Javascript
 
Javascript by Yahoo
Javascript by YahooJavascript by Yahoo
Javascript by Yahoo
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Language
 
Javascript
JavascriptJavascript
Javascript
 

Recently uploaded

Elevate Your Online Presence with SEO Services
Elevate Your Online Presence with SEO ServicesElevate Your Online Presence with SEO Services
Elevate Your Online Presence with SEO ServicesHaseebBashir5
 
SCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjw
SCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjwSCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjw
SCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjwadimosmejiaslendon
 
Thompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptx
Thompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptxThompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptx
Thompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptxtmthompson1
 
#Mtp-Kit Prices » Qatar. Doha (+27737758557) Abortion Pills For Sale In Doha,...
#Mtp-Kit Prices » Qatar. Doha (+27737758557) Abortion Pills For Sale In Doha,...#Mtp-Kit Prices » Qatar. Doha (+27737758557) Abortion Pills For Sale In Doha,...
#Mtp-Kit Prices » Qatar. Doha (+27737758557) Abortion Pills For Sale In Doha,...drm1699
 
The Art of Decision-Making: Navigating Complexity and Uncertainty
The Art of Decision-Making: Navigating Complexity and UncertaintyThe Art of Decision-Making: Navigating Complexity and Uncertainty
The Art of Decision-Making: Navigating Complexity and Uncertaintycapivisgroup
 
MichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdfMichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdfmstarkes24
 
Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...
Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...
Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...ssuserf63bd7
 
Should Law Firms Outsource their Bookkeeping
Should Law Firms Outsource their BookkeepingShould Law Firms Outsource their Bookkeeping
Should Law Firms Outsource their BookkeepingYourLegal Accounting
 
Space Tech Expo Exhibitor List 2024 - Exhibitors Data
Space Tech Expo Exhibitor List 2024 - Exhibitors DataSpace Tech Expo Exhibitor List 2024 - Exhibitors Data
Space Tech Expo Exhibitor List 2024 - Exhibitors DataExhibitors Data
 
wagamamaLab presentation @MIT 20240509 IRODORI
wagamamaLab presentation @MIT 20240509 IRODORIwagamamaLab presentation @MIT 20240509 IRODORI
wagamamaLab presentation @MIT 20240509 IRODORIIRODORI inc.
 
Powerpoint showing results from tik tok metrics
Powerpoint showing results from tik tok metricsPowerpoint showing results from tik tok metrics
Powerpoint showing results from tik tok metricsCaitlinCummins3
 
Mastering The Art Of 'Closing The Sale'.
Mastering The Art Of 'Closing The Sale'.Mastering The Art Of 'Closing The Sale'.
Mastering The Art Of 'Closing The Sale'.SNSW group8
 
00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![© ر
00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![©  ر00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![©  ر
00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![© رnafizanafzal
 
Progress Report - UKG Analyst Summit 2024 - A lot to do - Good Progress1-1.pdf
Progress Report - UKG Analyst Summit 2024 - A lot to do - Good Progress1-1.pdfProgress Report - UKG Analyst Summit 2024 - A lot to do - Good Progress1-1.pdf
Progress Report - UKG Analyst Summit 2024 - A lot to do - Good Progress1-1.pdfHolger Mueller
 
Presentation4 (2) survey responses clearly labelled
Presentation4 (2) survey responses clearly labelledPresentation4 (2) survey responses clearly labelled
Presentation4 (2) survey responses clearly labelledCaitlinCummins3
 
NewBase 17 May 2024 Energy News issue - 1725 by Khaled Al Awadi_compresse...
NewBase   17 May  2024  Energy News issue - 1725 by Khaled Al Awadi_compresse...NewBase   17 May  2024  Energy News issue - 1725 by Khaled Al Awadi_compresse...
NewBase 17 May 2024 Energy News issue - 1725 by Khaled Al Awadi_compresse...Khaled Al Awadi
 
如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证ogawka
 
Shots fired Budget Presentation.pdf12312
Shots fired Budget Presentation.pdf12312Shots fired Budget Presentation.pdf12312
Shots fired Budget Presentation.pdf12312LR1709MUSIC
 
Pay after result spell caster (,$+27834335081)@ bring back lost lover same da...
Pay after result spell caster (,$+27834335081)@ bring back lost lover same da...Pay after result spell caster (,$+27834335081)@ bring back lost lover same da...
Pay after result spell caster (,$+27834335081)@ bring back lost lover same da...BabaJohn3
 

Recently uploaded (20)

Elevate Your Online Presence with SEO Services
Elevate Your Online Presence with SEO ServicesElevate Your Online Presence with SEO Services
Elevate Your Online Presence with SEO Services
 
SCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjw
SCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjwSCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjw
SCI9-Q4-MOD8.1.pdfjttstwjwetw55k5wwtwrjw
 
Thompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptx
Thompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptxThompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptx
Thompson_Taylor_MBBS_PB1_2024-03 (1)- Project & Portfolio 2.pptx
 
#Mtp-Kit Prices » Qatar. Doha (+27737758557) Abortion Pills For Sale In Doha,...
#Mtp-Kit Prices » Qatar. Doha (+27737758557) Abortion Pills For Sale In Doha,...#Mtp-Kit Prices » Qatar. Doha (+27737758557) Abortion Pills For Sale In Doha,...
#Mtp-Kit Prices » Qatar. Doha (+27737758557) Abortion Pills For Sale In Doha,...
 
The Art of Decision-Making: Navigating Complexity and Uncertainty
The Art of Decision-Making: Navigating Complexity and UncertaintyThe Art of Decision-Making: Navigating Complexity and Uncertainty
The Art of Decision-Making: Navigating Complexity and Uncertainty
 
MichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdfMichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdf
 
Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...
Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...
Understanding Financial Accounting 3rd Canadian Edition by Christopher D. Bur...
 
Should Law Firms Outsource their Bookkeeping
Should Law Firms Outsource their BookkeepingShould Law Firms Outsource their Bookkeeping
Should Law Firms Outsource their Bookkeeping
 
Obat Aborsi Depok 0851\7696\3835 Jual Obat Cytotec Di Depok
Obat Aborsi Depok 0851\7696\3835 Jual Obat Cytotec Di DepokObat Aborsi Depok 0851\7696\3835 Jual Obat Cytotec Di Depok
Obat Aborsi Depok 0851\7696\3835 Jual Obat Cytotec Di Depok
 
Space Tech Expo Exhibitor List 2024 - Exhibitors Data
Space Tech Expo Exhibitor List 2024 - Exhibitors DataSpace Tech Expo Exhibitor List 2024 - Exhibitors Data
Space Tech Expo Exhibitor List 2024 - Exhibitors Data
 
wagamamaLab presentation @MIT 20240509 IRODORI
wagamamaLab presentation @MIT 20240509 IRODORIwagamamaLab presentation @MIT 20240509 IRODORI
wagamamaLab presentation @MIT 20240509 IRODORI
 
Powerpoint showing results from tik tok metrics
Powerpoint showing results from tik tok metricsPowerpoint showing results from tik tok metrics
Powerpoint showing results from tik tok metrics
 
Mastering The Art Of 'Closing The Sale'.
Mastering The Art Of 'Closing The Sale'.Mastering The Art Of 'Closing The Sale'.
Mastering The Art Of 'Closing The Sale'.
 
00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![© ر
00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![©  ر00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![©  ر
00971508021841 حبوب الإجهاض في دبي | أبوظبي | الشارقة | السطوة |❇ ❈ ((![© ر
 
Progress Report - UKG Analyst Summit 2024 - A lot to do - Good Progress1-1.pdf
Progress Report - UKG Analyst Summit 2024 - A lot to do - Good Progress1-1.pdfProgress Report - UKG Analyst Summit 2024 - A lot to do - Good Progress1-1.pdf
Progress Report - UKG Analyst Summit 2024 - A lot to do - Good Progress1-1.pdf
 
Presentation4 (2) survey responses clearly labelled
Presentation4 (2) survey responses clearly labelledPresentation4 (2) survey responses clearly labelled
Presentation4 (2) survey responses clearly labelled
 
NewBase 17 May 2024 Energy News issue - 1725 by Khaled Al Awadi_compresse...
NewBase   17 May  2024  Energy News issue - 1725 by Khaled Al Awadi_compresse...NewBase   17 May  2024  Energy News issue - 1725 by Khaled Al Awadi_compresse...
NewBase 17 May 2024 Energy News issue - 1725 by Khaled Al Awadi_compresse...
 
如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(SUT毕业证书)斯威本科技大学毕业证成绩单本科硕士学位证留信学历认证
 
Shots fired Budget Presentation.pdf12312
Shots fired Budget Presentation.pdf12312Shots fired Budget Presentation.pdf12312
Shots fired Budget Presentation.pdf12312
 
Pay after result spell caster (,$+27834335081)@ bring back lost lover same da...
Pay after result spell caster (,$+27834335081)@ bring back lost lover same da...Pay after result spell caster (,$+27834335081)@ bring back lost lover same da...
Pay after result spell caster (,$+27834335081)@ bring back lost lover same da...
 

CS 151 Unit 6 Assignment

  • 1. Buy here: http://studentland8.mybigcommerce.com/cs-151-unit-6-a ssignment/ Unit 6 Assignment Grading Information: This Program is due on Date Specified. Comments are REQUIRED flow charts and pseudocode are NOT REQUIRED. Directions Points The file must be called <LastInitialFirstInitialUnit6.java> (driver) <LastInitialFirstInitialPets.java> (handles variables and methods for the Pet Class) Proper coding conventions required the first letter of the class start with a capital letter and the first letter of each additional word start with a capital letter. Only submit the .java files needed to make the program run. Do not submit the .class files or any other files. 5% Style Components 5%
  • 2. Include properly formatted prologue, comments, indenting, and other style elements as shown in Chapter 2 starting page 64 and Appendix 5 page 881-892. Topics covered in chapter Topics with * are covered in this assignment. Ensure you use every item listed below with an * in your completed assignment. *Object Oriented Programming *Driver Class Calling Objects, this reference *Instance Variables Tracing UML *Local Variables *The return statement *Argument Passing
  • 3. *Specialized Methods – *Accessor, *Mutator, and Boolean Methods Problem Solving with Simulation (optional) Basic Guidelines You will be making a very basic Pet Tracker. You will be tracking type, name, age, etc and outputting some information at the end. LiFiUnit6.java (driver) Provide a driver class that has the following items: • Creates 3 instances of your LiFiUnit6Pets class. You may use a loop but it is not required. 60% ● Gets input for first type, name as String. Notice in the example how the prompts change once the name has been entered. ● Get input for age as integer. ● Get input for weight as double. ● Get input for isMale as Boolean. ● For the 1st pet, use the default constructor and use proper mutator methods to set all variables.
  • 4. ● For the 2nd pet, use a single parameter constructor that accepts type as an argument and use proper mutator methods for all other values. ● For the 3rd pet, use a constructor that accepts all values as arguments. ● Create a class method (in your driver), that counts the number of dogs and the number of cats. It is recommended you create one method called countPets that accepts the pet instance, type, and 0 as a constant for number. This method should return the number of the pet set to it. This method is required but how it works is up to you. ● After counting the pets, if you have 1 or more dogs and 1 or more cats, output “I sure hope the cats and dogs get along”. ● Call displayPet method from your Pets class. LiFiPets.java Provide a pets class that has accessor/mutator methods for all variables pertaining to the pets above. • Create a method called displayPet and output the values for all pets, see sample below. Ensure to output “Male” or “Female” based on isMale. Cal lthis method for each pet. Sample output is provided below. Be sure to mimic it exactly except for values entered. 30% NOTE: Complete your activity and upload to assignment.
  • 5. Total Percentage 100% Sample Notice how once the name is input, the name is used in the following prompts. The below example has 2 dogs and 1 cat so notice the output about hoping the pets get along. Welcome to the Java Pet Tracker. Please enter the type of Pet #1 (Dog or Cat): Dog Please enter the name of Pet #1: Max Please enter the age of Max: 3 Please enter the weight of Max in pounds (example 5.2): 85.2 Is Max Male (true/false): true Please enter the type of Pet #2 (Dog or Cat): Dog Please enter the name of Pet #2: Buddy Please enter the age of Buddy: 4 Please enter the weight of Buddy in pounds (example 5.2): 75.6 Is Buddy Male (true/false): true Please enter the type of Pet #3 (Dog or Cat): Cat
  • 6. Please enter the name of Pet #3: CiCi Please enter the age of CiCi: 10 Please enter the weight of CiCi in pounds (example 5.2): 10.6 Is CiCi Male (true/false): false Calculating Pet Population and Stuff I sure hope them cats and dogs get along! Pet Registration Information: Type: Dog Name: Max Age: 3 Weight: 85.2 Sex: Male Type: Dog Name: Buddy Age: 4 Weight: 75.6 Sex: Male Type: Cat Name: CiCi Age: 10 Weight: 10.6 Sex: Female The below examples is of all Cat’s so notice no statement about hoping they get along. Welcome to the Java Pet Tracker. Please enter the type of Pet #1 (Dog or Cat): Cat Please enter the name of Pet #1: CiCi Please enter the age of CiCi: 10 Please enter the weight of CiCi in pounds (example 5.2): 10.7 Is CiCi Male (true/false): false Please enter the type of Pet #2 (Dog or Cat): Cat
  • 7. Please enter the name of Pet #2: Zeus Please enter the age of Zeus: 2 Please enter the weight of Zeus in pounds (example 5.2): 7.6 Is Zeus Male (true/false): true Please enter the type of Pet #3 (Dog or Cat): Cat Please enter the name of Pet #3: Strawberry Please enter the age of Strawberry: 2 Please enter the weight of Strawberry in pounds (example 5.2): 11.6 Is Strawberry Male (true/false): false Calculating Pet Population and Stuff Pet Registration Information: Type: Cat Name: CiCi Age: 10 Weight: 10.7 Sex: Female Type: Cat Name: Zeus Age: 2 Weight: 7.6 Sex: Male Type: Cat Name: Strawberry Age: 2 Weight: 11.6 Sex: Female Type a description for this product here...