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

Assignment Help:

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.


Related Discussions:- Creates an object and prompt the user to enter the name

Implement the control mechanism for the robot, You must implement the contr...

You must implement the control mechanism for the robot arm so that it can safely move the blocks from the source pile to their destination, without colliding with any obstacles or

Er diagram, I need someone to make an ER diagram.

I need someone to make an ER diagram.

Explain the break statement - computer programming, Explain the Break State...

Explain the Break Statement - Computer Programming? The break statement is used as an interrupt to the normal flow of control this statement causes as exit from the switch stat

Corba multiple clients, I have an assignment that requires from me to run ...

I have an assignment that requires from me to run multiple clients and one server ( Corba)

Advance operating systems, Project2: A Simple Distributed Computing Platfor...

Project2: A Simple Distributed Computing Platform (Due at 11:59:59pm on 04/12/2012 (EST)) Description: You are asked to develop a replicator (client) that distributes a large job

Differences between user and kernel level threads, Question : (a) Many ...

Question : (a) Many systems provide support for both user threads and kernel threads, resulting in different multithreading models. What are the two differences between user

Design a mobile web browser..., HOW CAN I DESIGN A MOBILE WEB BROWSER LIKE ...

HOW CAN I DESIGN A MOBILE WEB BROWSER LIKE OPERA MINI. USING VISUAL BASIC? HELP ME.

Advance microprocessor, Write a program to mask bits D3D2D1D0 and to set bi...

Write a program to mask bits D3D2D1D0 and to set bits D5D4 and to invert bits D7D6 of the AX register.

Java.., create a program that can determine the number of students that are...

create a program that can determine the number of students that are doing their final year for a particular program (e.g. BCOM Information Systems), calculate the required credits

Program for deleting nodes from the binary search tree, Problem: This...

Problem: This assignment is about deleting nodes from the binary search tree. You need to use given sequence to construct a binary search tree and then delete some nodes from

Write Your Message!

Captcha
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