GithubHelp home page GithubHelp logo

aaronclong / java2javascript-lab-2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zipcoder/cr-mesolabs-javascript-javatojavascript.lab2

0.0 1.0 0.0 74 KB

Convert Java lab to JavaScript #2

CSS 45.33% HTML 19.37% JavaScript 35.31%

java2javascript-lab-2's Introduction

Instructions

Use the provided html/css/js files and folders to implement the following instructions.

Part 1:

Create a program that asks the user how many pets they have. Once you know how many pets they have, ask them what kind of pet each one is, along with each pet's name. For now your program should just hold onto the user input and print out the list at the end; we'll modify this in part 3.

Part 2:

Create a Pet class, and a subclass for each type of pet that you want your program to support. Your classes should follow the following requirements:

  • You must support at least three types of pets.
  • Dog must be one of the types you support.
  • Cat must be one of the types you support.
  • The Pet class must have a speak method that each subclass overrides.
  • The Pet class must have a name field with setters and getters.

Part 3:

Modify your program from part 1 to use the Pet class and its subclasses. Keep a list of the pets your user lists and at the end of the program print out a list of their names and what they say when they speak.

java2javascript-lab-2's People

Contributors

froilan-miranda avatar aaronclong avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.