1 / 2

PRG 421 Week 1 Individual Week One Coding Assignment//tutorfortune.com

PRG 421 Week 1 Individual Week One Coding Assignment//tutorfortune.com<br><br>Click on below link to buy<br>https://tutorfortune.com/products/prg-421-week-1-individual-week-one-coding-assignment<br><br>PRG 421 Week 1 Individual Week One Coding Assignment<br><br>Resources:<br><br> <br><br>u201cLesson: Object-Oriented Programming Conceptsu201d on The Javau2122 Tutorials website<br><br>Downloadable starter code from the Oracleu00ae website: Bicyle class and BicycleDemo class<br><br>For this assignment, you will modify existing code to create a single Javau2122 program named BicycleDemo.java that incorporates the following:<br><br> <br><br>An abstract Bicycle class that contains private data relevant to all types of bicycles (cadence, speed, and gear) in addition to one new static variable: bicycleCount. The private data must be made visible via public getter and setter methods; the static variable must be set/manipulated in the Bicycle constructor and made visible via a public getter method.<br><br>Two concrete classes named MountainBike and RoadBike, both of which derive from the abstract Bicycle class and both of which add their own class-specific data and getter/setter methods.<br><br>Read through the u201cLesson: Object-Oriented Programming Conceptsu201d on The Javau2122 Tutorials website.<br><br> <br><br>Download the linked Bicycle class, or cut-and-paste it at the top of a new Javau2122 project named BicycleDemo.<br><br> <br><br>Download the linked BicycleDemo class, or cut-and-paste it beneath the Bicycle class in the BicycleDemo.java file.<br><br> <br><br>Optionally, review this weeku2019s Individual u201cWeek One Analyze Assignment,u201d to refresh your understanding of how to code derived classes.<br><br> <br><br>Adapt the Bicycle class by cutting and pasting the class into the NetBeans editor and completing the following:<br><br> <br><br>Change the Bicycle class to be an abstract class.<br><br>Add a private variable of type integer named bicycleCount, and initialize this variable to 0.<br><br>Change the Bicycle constructor to add 1 to the bicycleCount each time a new object of type Bicycle is created.<br><br>Add a public getter method to return the current value of bicycleCount.<br><br>Derive two classes from Bicycle: MountainBike and RoadBike. To the MountainBike class, add the private variables tireTread (String) and mountainRating (int). To the RoadBike class, add the private variable maximumMPH (int).<br><br>Using the NetBeans editor, adapt the BicycleDemo class as follows:<br><br> <br><br>Create two instances each of MountainBike and RoadBike.<br><br>Display the value of bicycleCount on the console.<br><br>Comment each line of code you add to explain what you added and why. Be sure to include a header comment that includes the name of the program, your name, PRG/421, and the date.<br><br> <br><br>Rename your JAVA file to have a .txt file extension.<br><br> <br><br>Submit your TXT file to the Assignment Files tab.<br> PRG 421 Week 1 Individual Week One Coding Assignment<br>Click on below link to buy<br>https://tutorfortune.com/products/prg-421-week-1-individual-week-one-coding-assignment<br><br>

tutortip
Download Presentation

PRG 421 Week 1 Individual Week One Coding Assignment//tutorfortune.com

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PRG 421 Week 1 Individual Week One Coding Assignment//tutorfortune.com Click on below link to buy https://tutorfortune.com/products/prg-421-week-1-individual-week-one-coding- assignment P R G 4 2 1 We e k 1 I n d i v i d u a l We e k O n e C o d i n g A s s i g n me n t R e s o u r c e s :   “ L e s s o n : O b j e c t - O r i e n t e d P r o g r a mmi n g C o n c e p t s ” o n T h e J a v a ™ T u t o r i a l s w e b s i t e D o w n l o a d a b l e s t a r t e r c o d e f r o m t h e O r a c l e ® w e b s i t e : B i c y l e c l a s s a n d B i c y c l e D e mo c l a s s F o r t h i s a s s i g n me n t , y o u w i l l mo d i f y e x i s t i n g c o d e t o c r e a t e a s i n g l e J a v a ™ p r o g r a m n a me d B i c y c l e D e mo . j a v a t h a t i n c o r p o r a t e s t h e f o l l o w i n g :   A n a b s t r a c t B i c y c l e c l a s s t h a t c o n t a i n s p r i v a t e d a t a r e l e v a n t t o a l l t y p e s o f b i c y c l e s ( c a d e n c e , s p e e d , a n d g e a r ) i n a d d i t i o n t o o n e n e w s t a t i c v a r i a b l e : b i c y c l e C o u n t . T h e p r i v a t e d a t a mu s t b e ma d e v i s i b l e v i a p u b l i c g e t t e r a n d s e t t e r me t h o d s ; t h e s t a t i c v a r i a b l e mu s t b e s e t / ma n i p u l a t e d i n t h e B i c y c l e c o n s t r u c t o r a n d ma d e v i s i b l e v i a a p u b l i c g e t t e r me t h o d . T w o c o n c r e t e c l a s s e s n a me d Mo u n t a i n B i k e a n d R o a d B i k e , b o t h o f w h i c h d e r i v e f r o m t h e a b s t r a c t B i c y c l e c l a s s a n d b o t h o f w h i c h a d d t h e i r o w n c l a s s - s p e c i fi c d a t a a n d g e t t e r / s e t t e r me t h o d s . R e a d t h r o u g h t h e “ L e s s o n : O b j e c t - O r i e n t e d P r o g r a mmi n g C o n c e p t s ” o n T h e J a v a ™ T u t o r i a l s w e b s i t e .   D o w n l o a d t h e l i n k e d B i c y c l e c l a s s , o r c u t - a n d - p a s t e i t a t t h e t o p o f a n e w J a v a ™ p r o j e c t n a me d B i c y c l e D e mo .   D o w n l o a d t h e l i n k e d B i c y c l e D e mo c l a s s , o r c u t - a n d - p a s t e i t b e n e a t h t h e B i c y c l e c l a s s i n t h e B i c y c l e D e mo . j a v a fi l e .   O p t i o n a l l y , r e v i e w t h i s w e e k ’ s I n d i v i d u a l “ We e k O n e A n a l y z e A s s i g n me n t , ” t o r e f r e s h y o u r u n d e r s t a n d i n g o f h o w t o c o d e d e r i v e d c l a s s e s .   A d a p t t h e B i c y c l e c l a s s b y c u t t i n g a n d p a s t i n g t h e c l a s s i n t o t h e N e t B e a n s e d i t o r a n d c o mp l e t i n g t h e

  2. f o l l o w i n g :   C h a n g e t h e B i c y c l e c l a s s t o b e a n a b s t r a c t c l a s s . A d d a p r i v a t e v a r i a b l e o f t y p e i n t e g e r n a me d b i c y c l e C o u n t , a n d i n i t i a l i z e t h i s v a r i a b l e t o 0 . C h a n g e t h e B i c y c l e c o n s t r u c t o r t o a d d 1 t o t h e b i c y c l e C o u n t e a c h t i me a n e w o b j e c t o f t y p e B i c y c l e i s c r e a t e d . A d d a p u b l i c g e t t e r me t h o d t o r e t u r n t h e c u r r e n t v a l u e o f b i c y c l e C o u n t . D e r i v e t w o c l a s s e s f r o m B i c y c l e : Mo u n t a i n B i k e a n d R o a d B i k e . T o t h e Mo u n t a i n B i k e c l a s s , a d d t h e p r i v a t e v a r i a b l e s t i r e T r e a d ( S t r i n g ) a n d mo u n t a i n R a t i n g ( i n t ) . T o t h e R o a d B i k e c l a s s , a d d t h e p r i v a t e v a r i a b l e ma x i mu mMP H ( i n t ) . U s i n g t h e N e t B e a n s e d i t o r , a d a p t t h e B i c y c l e D e mo c l a s s a s f o l l o w s :   C r e a t e t w o i n s t a n c e s e a c h o f Mo u n t a i n B i k e a n d R o a d B i k e . D i s p l a y t h e v a l u e o f b i c y c l e C o u n t o n t h e c o n s o l e . C o mme n t e a c h l i n e o f c o d e y o u a d d t o e x p l a i n w h a t y o u a d d e d a n d w h y . B e s u r e t o i n c l u d e a h e a d e r c o mme n t t h a t i n c l u d e s t h e n a me o f t h e p r o g r a m, y o u r n a me , P R G / 4 2 1 , a n d t h e d a t e .   R e n a me y o u r J A V A fi l e t o h a v e a . t x t fi l e e x t e n s i o n .   S u b mi t y o u r T X T fi l e t o t h e A s s i g n me n t F i l e s t a b .   P R G 4 2 1 We e k 1 I n d i v i d u a l We e k O n e C o d i n g A s s i g n me n t Click on below link to buy https://tutorfortune.com/products/prg-421-week-1-individual-week-one-coding- assignment

More Related