Create a program that makes an object

Assignment Help Theory of Computation
Reference no: EM1380790

Create 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.

After creating the class, create a program that makes 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 access or methods to retrieve the pet's name, type, and age and display this data on the screen.

Give a flowchart and a pseudocode for the program.

Reference no: EM1380790

Questions Cloud

Creating an oracle : The clique problem itself is NP-hard. Thus you may not wish to have an oracle that runs in exponential time. Consider approach to approximate the solution.
Boreki reviews the classification and then places item : How can Boreki use this information? Boreki reviews the classification and then places item A2 into the A category. Why might he do so?
Do you think you can stay competitive in business : Do you think you can stay competitive in business, get acceptable bottom-line results, and still operate in an honest and ethical manner? Why, or why not?
Front end and back end processes of office automation : Discuss the difference between the front end and back-end processes of office automation? Provide some examples in your workplace or that you come into contact with?
Create a program that makes an object : Create a class named Pet, after creating the class, create a program that makes an object of the class and prompts the user to enter the name, type, and age of his pet.
Create a method that perform a division operation : Create a method that will perform a division operation on the numbers passed to it in two variables and outputs the results. Use a try catch pair to output an error message if the illegal operation of divide through zero occurs.
Four hospitals located in one county are cooperating : Four hospitals located in one county are cooperating to establish a centralized blood- bank facility to serve them all. On an xy coordinate grid of the county, the hospitals are found at the following locations
Describe how you will use your distance learning unit : Describe how you will use your distance learning unit and how that use will complement your traditional training program. Explain how you will present material to the trainees.
Create a program that reads integers : Create a program that reads integers in range 0 .. 9999. The event stops reading if -99 is entered. Your event should use Stack to store those numbers then it used Priority Queue to print out those numbers in ascending order.

Reviews

Write a Review

Theory of Computation Questions & Answers

  Create a program that reads integers

Create a program that reads integers in range 0 .. 9999. The event stops reading if -99 is entered. Your event should use Stack to store those numbers then it used Priority Queue to print out those numbers in ascending order.

  Argue that the problem is np complete

Argue that the following prob is NP Complete. Given list of positive integers, u1,u2,...un (in binary representation) and asked if there is partition of this set into 3 subsets, each of which has same sum.

  Use algorithm np completeness of any of the problems

Use any algorithm we without writing out details of algorithm. In proving problem NP-complete, you may utilize NP completeness of any of the problems.

  Create a recursive java method maximum

Create a recursive java method maximum that calculate the maximum element of a linked list of integers.The solution must be simplified and should not use class Node or head

  Turing machine model

Think about the following Turing-machine model, A tape that is infinitely long in both directions and is divided into cells; at any given step, each cell either is blank or contains a 1.

  Explain monotone instance of satisfiability

Given monotone instance of Satisfiability, together with number k, problem of Monotone Satisfiability with Few True Variables asks: is there satisfying assignment for instance in which at most k variables are set to 1.

  Rice-s theorem for enumerable or non-re

We know by rice's theorem that none of the following problems are decidable. However,are they recursively enumerable,or non-RE? IS L(M) infinite?

  Prove that l is not regular using pumping theorem

Prove that L is not regular. (Be particularly careful if you use the Pumping Theorem. You must choose a w that is actually in L.)

  Problem encountered in statements in predicate logic

How the problem would be encountered in attempting to represent the following statements in Predicate logic. it should be possible to: John only likes to see French movies.

  Write grammar for language consisting of strings

Write a grammar for the language consisting of strings that have n copies of the letter a followed by same number of copies of the letter b, where n>0

  Interpreting the regular expressions as languages

Show that the following identities hold for regular expressions over any alphabet: epsilon + R*R = R*. These should be done by interpreting the regular expressions as languages.

  Explaining syntactically legal boolean expression

In this problem, we consider a very restricted subset of Boolean expressions. Define an operator to be one of  the four symbols: ¬, ∧, ∨, and →. Define a variable to be one of the five symbols

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