Creates an object and prompt the user to enter the name, Programming Languages

Design an object definition 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 a Pet is (e.g. "Golden Retriever", "Himalayan", "Budgie")
  • dob: The dob field holds a reference to a JavaScript Date object representing the date of the pet's birth

The Pet object should also have:

  • A constructor that takes values for all fields as parameters
  • Accessors and mutators for all fields
  • A toStringmethod for the object

Once you have programmed the object definition, write a program that creates an object and prompt the user to enter the name, type, and a month (you may ask for this as a number in the range of 0 to 11), day, and year for the date of birth for the Pet. (Use the JavaScript window.prompt() to get this information from the user.) This data should be stored in the object. Use the toString() method to print the object's data to the browser window.

Posted Date: 2/15/2013 5:46:22 AM | Location : United States







Related Discussions:- Creates an object and prompt the user to enter the name, Assignment Help, Ask Question on Creates an object and prompt the user to enter the name, Get Answer, Expert's Help, Creates an object and prompt the user to enter the name Discussions

Write discussion on Creates an object and prompt the user to enter the name
Your posts are moderated
Related Questions
You need to create a Fraction calculator program.You need to create a Fraction class to represent fraction objects and a FractionCalculator class that will perform operations on fr

Question: (a) What do you understand by the term Postback? (b) Describe five benefits of creating virtual directories while developing an ASP.NET application. (c) Exp

Software and sales assingment I keep get a syntax error

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

I need a program that writes the first column of the matrix. The numbers in this column follow the pattern below: 1. Numbers start at 1 and count up to ''nels'' in increments of

Windows Workflow Foundation Microsoft windows Work-flows foundation (WF) is an Enthusiasm technological innovation that provides an API, an in-process workflow website, and a rehos

How to lunch webcame via viusal studio 2012

1. Write a function that converts a character array to a signed decimal integer. Function prototype must be as follows: int asciiToInt( char *str, unsigned char* eflag) YOU MAY NO

i have to make a program that encrypt a text to numbers, i don''t know what is wrong in my code, the example of what i need: text: hi >> number: 17 23

about how to create the program in c