Design a class named pet, which should have following fields

Assignment Help Programming Languages
Reference no: EM13951121

Written Assignment: Pet Class

Design a class named Pet, which should have the following fields:

• Name - The name field holds the name of a pet.

• Type - The type field holds the type of animal that is the pet. Example values are "Dog", "Cat", and "Bird".

• Age - The age field holds the pet's age.

The Pet class should also have the following methods:

• setName - The setName method stores a value in the name field.

• setType - The setType method stores a value in the type field.

• setAge - The setAge method stores a value in the age field.

• getName - The getName method returns the value of the name field.

• getType - The getType method returns the value of the type field.

• getAge - The getAge method returns the value of the age field.

Once you have designed the class, design a program that creates an object of the class and prompts the user to enter the name, type, and age of his pet. This data should be stored in the object. Use the object's accessor methods to retrieve the pet's name, type, and age and display this data on the screen.

You are to submit, as a Microsoft Word Document, the following for this assignment:

1. Flowchart

2. Pseudocode

Remember to follow the guidelines of good program design. Make sure to use meaningful variable names and thoroughly comment each line of your code. You may only use techniques learned in Chapters 1-7.

Reference no: EM13951121

Questions Cloud

Give a flowchart and a pseudocode for the program. : The type field holds the type of animal that is the pet. Example values are "Dog", "Cat", and "Bird".
Different types of prescreening tests : Complete the following for this assignment: Research different types of prescreening tests, and construct a report for the president of the company.
Explain major differences between a motor and a generator : Explain the major differences between a motor and a generator. Explain in detail how the simple motor works and be sure to include the functions of the reed relay and transistor.
Describe a little about the fsa program : Research the social realists who worked under the FSA program during the Great Depression. Write an essay in your own words that addresses the points below: Describe a little about the FSA program
Design a class named pet, which should have following fields : The type field holds the type of animal that is the pet. Example values are "Dog", "Cat", and "Bird".
Function of the forbidden city : All of the cultures that we have looked at this week built architectural monuments, but few have survived intact. Often these monuments embody the social, spiritual, political and religious ideas of the culture that created it. One of the few to h..
Write main ideas of given videos : Watch two videos and write main ideas
Audit procedure to ensure accuracy of property plant : Identify the weaknesses in the stocktake procedures above and identify how they could be improved. Weakness Improvement - Describe audit procedures to ensure the accuracy of the summary of property plant and equipment
Analyze the ways in which you-rationally arrived : Having described these relationships, as you see them, use this explanation to analyze the ways in which you-rationally, experientially, transcendentally etc.-have arrived at your own worldview/beliefs/faith/religious views, etc

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd