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

Find out starting address of stack segment, For the following Code answer t...

For the following Code answer the following questions-: .STACK 100H .DATA COUNT DB 10 TOTAL DW 4126H .CODE MAIN PROC MOV BX, 3F20H MOV AL, BL MOV BL, COUNT MOV

Python, How does a program provide "input" to one of its functions?

How does a program provide "input" to one of its functions?

Jquery, i am stuck on array part from getting response of jquery. anyone co...

i am stuck on array part from getting response of jquery. anyone could help?

Pl sql project, create a small database for a company, require at least 4 t...

create a small database for a company, require at least 4 tables. also, have 4 business report, oracle built-in function, 5 string, 5 number or math functions, 5 date and time func

C# not c++ programing help, Please write a program declaring a variable x a...

Please write a program declaring a variable x as the type int, and use the scanf function to input an integer to initialize the value of x. Then, your program will print the follow

Program for hold details of all the cabins for travellers, Scenario A ca...

Scenario A campsite provides cabins for travellers to stay in overnight. A 'cabin' is a small wooden hut, containing bunk beds, table and chairs, a heater, and a small cookin

3-Tier Architecture in asp.net, I am getting error at business layer object...

I am getting error at business layer object in code behind page.

Prolog predicate to remove nth element, Write a Prolog predicate remove_nth...

Write a Prolog predicate remove_nth(N,L1,L2) that is true if list L2 is just list L1 with its Nth element removed. If L1 does not have an Nth element then the predicate should fail

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

What are the Functions in Computer Programming, What are the Functions in C...

What are the Functions in Computer Programming? A program is completed up of one or more functions, with one of these being main(). Function is a self-contained block of progra

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