SlideShare ist ein Scribd-Unternehmen logo
1 von 7
Prg421.com
PRG 421 ENTIRE CLASS
PRG 421 Week 1 Individual Assignment Analyzing a Program Containing Abstract
and Derived Classes
Resource:
 "Analyzing a Java™ Program Contaiing Abstract and Derived Classes"
The purpose of creating an abstract class is to model an abstract situation.
Example:
You work for a company that has different types of customers: domestic, international,
business partners, individuals, and so on. It well may be useful for you to "abstract out"
all the information that is common to all of your customers, such as name, customer
number, order history, etc., but also keep track of the information that is specific to
different classes of customer. For example, you may want to keep track of additional
information for international customers so that you can handle exchange rates and
customs-related activities, or you may want to keep track of additional tax-, company-,
and department-related information for business customers.
Modeling all these customers as one abstract class ("Customer") from which many
specialized customer classes derive or inherit ("International Customer," "Business
Customer," etc.) will allow you to define all of that information your customers have in
common and put it in the "Customer" class, and when you derive your specialized
customer classes from the abstract Customer class you will be able to reuse all of those
abstract data/methods.This approach reduces the coding you have to do which, in turn,
reduces the probability of errors you will make. It also allows you, as a programmer, to
reduce the cost of producing and maintaining the program.
In this assignment, you will analyze Java™ code that declares one abstract class and
derives three concrete classes from that one abstract class. You will read through the
code and predict the output of the program.
Read through the linked Java™ code carefully.
Predict the result of running the Java™ code. Writeyour prediction into a
Microsoft® Word document, focusing specifically on what text you think will appear on
the console after running the Java™ code.
In the same Word document, answer the following question:
 Why would a programmer choose to define a method in an abstract class, such as
the Animal constructor method or the getName() method in the linked code example, as
opposed to defining a method as abstract, such as the makeSound() method in the
linked example?
Supporting Material: Week One Analyze Assignment Text File
Prg421.com
PRG 421 Week 1 Individual Assignment Coding a Program Containing Abstract
and Derived Classes
Resources:
 "Lesson: Object-Oriented Programming Concepts" on The Java™ Tutorials website
 Downloadable starter code from the Oracle® website: Bicyle class and BicycleDemo
class
For this assignment, you will modify existing code to create a single Java™ program
named BicycleDemo.java that incorporates the following:
 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.
 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.
Read through the "Lesson: Object-Oriented Programming Concepts" on The Java™
Tutorials website.
Download the linked Bicycle class, or cut-and-paste it at the top of a new Java™ project
named BicycleDemo.
Download the linked BicycleDemo class, or cut-and-paste it beneath the Bicycle class in
the BicycleDemo.java file.
Optionally, review this week's Individual "Week One Analyze Assignment," to refresh
your understanding of how to code derived classes.
Adapt the Bicycle class by cutting and pasting the class into the NetBeans editor and
completing the following:
 Change the Bicycle class to be an abstract class.
 Add a private variable of type integer named bicycleCount, and initialize this variable to
0.
 Change the Bicycle constructor to add 1 to the bicycleCount each time a new object of
type Bicycle is created.
 Add a public getter method to return the current value of bicycleCount.
 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).
Using the NetBeans editor, adapt the BicycleDemo class as follows:
 Create two instances each of MountainBike and RoadBike.
 Display the value of bicycleCount on the console.
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.
Rename your JAVA file to have a .txt file extension.
Submit your TXT file to the Assignment Files tab.
PRG 421 Week 2 Individual Assignment Coding a Program Containing Console/file
input and output
Resource:
 "Console/File Input and Output" text file
For this assignment, you will build on "starter" code to create a Java™ program that
prompts the user for input, accepts user input, and produces both console and file
output.
Copy the linked code to a JAVA file.
Add Java® code based on the comments inside the code.
Note: Refer to this week's Individual "Week Two Analyze Assignment" for model code
you can adapt to meet this assignment's requirements.
Test, debug, and run your code using the NetBeans editor to make sure it meets the
program requirements.
Save your JAVA file with a .txt extension.
Submit your TXT file to the Assignment Files tab.
PRG 421 ENTIRE CLASS
PRG 421 Week 2 Individual Assignment Analyzing a Program Containing
Console/file input and output
Resource:
 "Demonstrate the Coding to Produce Output to a File" text file
For this assignment, you will analyze Java™ that presents instructional text on the
console, accepts user input, and then creates a file based on that user input.
Read the linked Java™ code carefully.
Then, answer the following questions in a Microsoft® Word file:
 As you run the program in NetBeans the first time, at the prompt (the program will pause
for input) type abc Return def Return ghi Ctrl+Shift+Del. What is the result?
 As you run the program in NetBeans the second time, at the prompt (the program will
pause for input) type 123 Ctrl+Shift +Del. What is the result?
 What happens if the file Data.txt already exists when you run the program?
 What happens if the file Data.txt does not already exist when you run the program?
Submit your Word file to the Assignment Files tab.
Prg421.com
PRG 421 Week 3 Individual Assignment Analyzing a
Program Containing Manipulating Data with the Java™ Stream API
Resource:
 "Java Code That Sorts, Extracts Data and Saves It To a Collection" text file
For this assignment, you will analyze code that uses a file input stream and a file output
stream.
Read through the linked Java™ code.
In a Microsoft® Word document, answer the following questions:
 Could this program be run as is? If not, what is it lacking?
 Does this program modify the contents of an input stream? In what way?
 What are the results of running this code?
Submit your completed Word document to the Assignment Files tab.
PRG 421 Week 3 Individual Assignment Coding a Program Containing
Manipulating Data with the Java™ Stream API
For this assignment, you will develop "starter" code. After you finish, your code should
access an existing text file that you have created, create an input stream, read the
contents of the text flie, sort and store the contents of the text file into an ArrayList, then
write the sorted contents via an ouput stream to a separate output text file.
Copy and paste the following Java™ code into a JAVA source file in NetBeans:
import java.io.BufferedReader;
import java.io.BufferedWriter;
public class Datasort {
public static void main (String [] args) {
File fin = // input file
File fout = // create an out file
// Java FileInputStream class obtains input bytes from a file
FileInputStream fis = new FileInputStream(fin);
// buffering characters so as to provide for the efficient reading of characters, arrays, and
lines
BufferedReader in = new BufferedReader(new InputStreamReader(fis));
// declare an array in-line, ready for the sort
String aLine;
ArrayList<String> al = new ArrayList<String> ();
int i = 0;
while ((aLine = in.readLine()) != null) {
// set the sort for values is greater than 0
Collections.sort(al); // sorted content to the output file
{
System.out.println(s);
}
// close the 2 files
}
}
Add code as indicated in the comments.
Note: Refer to this week's Individual assignment, "Week Three Analyze Assignment,"
and to Ch. 8, "IO," in OCP: Oracle® Certified Professional Java® SE 8 Programmer II
Study Guide.
Run and debug your modified program in NetBeans until it satisfies the requirements
described above.
Save your finalized JAVA file with a .txt extension.
Submit your TXT file to the Assignment Files tab.
PRG 421 Week 4 Individual Assignment Coding a Program Containing Locale
Object
Resource:
 "The Locale Object" text file
For this assignment, you will develop Java™ code that relies on localization to format
currencies and dates.
In NetBeans, copy the linked code to a
PRG 421 ENTIRE CLASS
Prg421.com

Weitere ähnliche Inhalte

Was ist angesagt?

Hibernate tutorial for beginners
Hibernate tutorial for beginnersHibernate tutorial for beginners
Hibernate tutorial for beginnersRahul Jain
 
3.java database connectivity
3.java database connectivity3.java database connectivity
3.java database connectivityweb360
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Pooja Talreja
 
6.2\9 SSIS 2008R2_Training - DataFlow Transformations
6.2\9 SSIS 2008R2_Training - DataFlow Transformations6.2\9 SSIS 2008R2_Training - DataFlow Transformations
6.2\9 SSIS 2008R2_Training - DataFlow TransformationsPramod Singla
 
Java IO, Serialization
Java IO, Serialization Java IO, Serialization
Java IO, Serialization Hitesh-Java
 
Hibernate Developer Reference
Hibernate Developer ReferenceHibernate Developer Reference
Hibernate Developer ReferenceMuthuselvam RS
 
Java database connectivity with MYSQL
Java database connectivity with MYSQLJava database connectivity with MYSQL
Java database connectivity with MYSQLAdil Mehmoood
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc driversmyrajendra
 

Was ist angesagt? (20)

Data access
Data accessData access
Data access
 
Hibernate tutorial for beginners
Hibernate tutorial for beginnersHibernate tutorial for beginners
Hibernate tutorial for beginners
 
Technical Interview
Technical InterviewTechnical Interview
Technical Interview
 
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
 
Jdbc
JdbcJdbc
Jdbc
 
Struts notes
Struts notesStruts notes
Struts notes
 
3.java database connectivity
3.java database connectivity3.java database connectivity
3.java database connectivity
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)
 
Overview of JEE Technology
Overview of JEE TechnologyOverview of JEE Technology
Overview of JEE Technology
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
6.2\9 SSIS 2008R2_Training - DataFlow Transformations
6.2\9 SSIS 2008R2_Training - DataFlow Transformations6.2\9 SSIS 2008R2_Training - DataFlow Transformations
6.2\9 SSIS 2008R2_Training - DataFlow Transformations
 
Java IO, Serialization
Java IO, Serialization Java IO, Serialization
Java IO, Serialization
 
Hibernate Developer Reference
Hibernate Developer ReferenceHibernate Developer Reference
Hibernate Developer Reference
 
Java database connectivity with MYSQL
Java database connectivity with MYSQLJava database connectivity with MYSQL
Java database connectivity with MYSQL
 
Jdbc
JdbcJdbc
Jdbc
 
Spring & hibernate
Spring & hibernateSpring & hibernate
Spring & hibernate
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Hibernate I
Hibernate IHibernate I
Hibernate I
 

Ähnlich wie Prg421

PRG 421 Creative and Effective/newtonhelp.com
PRG 421 Creative and Effective/newtonhelp.comPRG 421 Creative and Effective/newtonhelp.com
PRG 421 Creative and Effective/newtonhelp.commyblue101
 
PRG 421 Inspiring Innovation / tutorialrank.com
PRG 421 Inspiring Innovation / tutorialrank.comPRG 421 Inspiring Innovation / tutorialrank.com
PRG 421 Inspiring Innovation / tutorialrank.comBromleyz24
 
CIS 406 Entire Course NEW
CIS 406 Entire Course NEWCIS 406 Entire Course NEW
CIS 406 Entire Course NEWshyamuopfive
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answersKrishnaov
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newshyaminfo16
 
PRG/421 ENTIRE CLASS UOP TUTORIALS
PRG/421 ENTIRE CLASS UOP TUTORIALSPRG/421 ENTIRE CLASS UOP TUTORIALS
PRG/421 ENTIRE CLASS UOP TUTORIALSSharon Reynolds
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newdixonbakerr
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newcharlesangles123
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newchanduruc123
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newshyaminfo40
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newuopassignment
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newlroselyn
 
PRG 420 Education for Service--prg420.com
PRG 420 Education for Service--prg420.comPRG 420 Education for Service--prg420.com
PRG 420 Education for Service--prg420.comwilliamwordsworth25
 
PRG 420 Education Counseling / prg420.com
PRG 420 Education Counseling / prg420.comPRG 420 Education Counseling / prg420.com
PRG 420 Education Counseling / prg420.comkopiko76
 
PRG 420 Inspiring Innovation--prg420.com
PRG 420 Inspiring Innovation--prg420.comPRG 420 Inspiring Innovation--prg420.com
PRG 420 Inspiring Innovation--prg420.comkopiko112
 
PRG 420 NERD Education Counseling--prg420nerd.com
PRG 420 NERD Education Counseling--prg420nerd.comPRG 420 NERD Education Counseling--prg420nerd.com
PRG 420 NERD Education Counseling--prg420nerd.comvenkat60044
 
PRG 420 NERD Become Exceptional--prg420nerd.com
PRG 420 NERD Become Exceptional--prg420nerd.comPRG 420 NERD Become Exceptional--prg420nerd.com
PRG 420 NERD Become Exceptional--prg420nerd.comagathachristie127
 
Cis 406 Technology levels--snaptutorial.com
Cis 406 Technology levels--snaptutorial.comCis 406 Technology levels--snaptutorial.com
Cis 406 Technology levels--snaptutorial.comsholingarjosh58
 
Cis 406 Success Begins / snaptutorial.com
Cis 406 Success Begins / snaptutorial.comCis 406 Success Begins / snaptutorial.com
Cis 406 Success Begins / snaptutorial.comRobinson071
 

Ähnlich wie Prg421 (20)

PRG 421 Creative and Effective/newtonhelp.com
PRG 421 Creative and Effective/newtonhelp.comPRG 421 Creative and Effective/newtonhelp.com
PRG 421 Creative and Effective/newtonhelp.com
 
PRG 421 Inspiring Innovation / tutorialrank.com
PRG 421 Inspiring Innovation / tutorialrank.comPRG 421 Inspiring Innovation / tutorialrank.com
PRG 421 Inspiring Innovation / tutorialrank.com
 
CIS 406 Entire Course NEW
CIS 406 Entire Course NEWCIS 406 Entire Course NEW
CIS 406 Entire Course NEW
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answers
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade new
 
PRG/421 ENTIRE CLASS UOP TUTORIALS
PRG/421 ENTIRE CLASS UOP TUTORIALSPRG/421 ENTIRE CLASS UOP TUTORIALS
PRG/421 ENTIRE CLASS UOP TUTORIALS
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade new
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade new
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade new
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade new
 
PRG 421 Entire Course NEW
PRG 421 Entire Course NEWPRG 421 Entire Course NEW
PRG 421 Entire Course NEW
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade new
 
Strayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade newStrayer cis 406 week 10 assignment 2 u grade new
Strayer cis 406 week 10 assignment 2 u grade new
 
PRG 420 Education for Service--prg420.com
PRG 420 Education for Service--prg420.comPRG 420 Education for Service--prg420.com
PRG 420 Education for Service--prg420.com
 
PRG 420 Education Counseling / prg420.com
PRG 420 Education Counseling / prg420.comPRG 420 Education Counseling / prg420.com
PRG 420 Education Counseling / prg420.com
 
PRG 420 Inspiring Innovation--prg420.com
PRG 420 Inspiring Innovation--prg420.comPRG 420 Inspiring Innovation--prg420.com
PRG 420 Inspiring Innovation--prg420.com
 
PRG 420 NERD Education Counseling--prg420nerd.com
PRG 420 NERD Education Counseling--prg420nerd.comPRG 420 NERD Education Counseling--prg420nerd.com
PRG 420 NERD Education Counseling--prg420nerd.com
 
PRG 420 NERD Become Exceptional--prg420nerd.com
PRG 420 NERD Become Exceptional--prg420nerd.comPRG 420 NERD Become Exceptional--prg420nerd.com
PRG 420 NERD Become Exceptional--prg420nerd.com
 
Cis 406 Technology levels--snaptutorial.com
Cis 406 Technology levels--snaptutorial.comCis 406 Technology levels--snaptutorial.com
Cis 406 Technology levels--snaptutorial.com
 
Cis 406 Success Begins / snaptutorial.com
Cis 406 Success Begins / snaptutorial.comCis 406 Success Begins / snaptutorial.com
Cis 406 Success Begins / snaptutorial.com
 

Kürzlich hochgeladen

Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 

Kürzlich hochgeladen (20)

Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 

Prg421

  • 1. Prg421.com PRG 421 ENTIRE CLASS PRG 421 Week 1 Individual Assignment Analyzing a Program Containing Abstract and Derived Classes Resource:  "Analyzing a Java™ Program Contaiing Abstract and Derived Classes" The purpose of creating an abstract class is to model an abstract situation. Example: You work for a company that has different types of customers: domestic, international, business partners, individuals, and so on. It well may be useful for you to "abstract out" all the information that is common to all of your customers, such as name, customer number, order history, etc., but also keep track of the information that is specific to different classes of customer. For example, you may want to keep track of additional information for international customers so that you can handle exchange rates and customs-related activities, or you may want to keep track of additional tax-, company-, and department-related information for business customers. Modeling all these customers as one abstract class ("Customer") from which many specialized customer classes derive or inherit ("International Customer," "Business Customer," etc.) will allow you to define all of that information your customers have in common and put it in the "Customer" class, and when you derive your specialized customer classes from the abstract Customer class you will be able to reuse all of those abstract data/methods.This approach reduces the coding you have to do which, in turn, reduces the probability of errors you will make. It also allows you, as a programmer, to reduce the cost of producing and maintaining the program. In this assignment, you will analyze Java™ code that declares one abstract class and derives three concrete classes from that one abstract class. You will read through the code and predict the output of the program. Read through the linked Java™ code carefully. Predict the result of running the Java™ code. Writeyour prediction into a Microsoft® Word document, focusing specifically on what text you think will appear on the console after running the Java™ code. In the same Word document, answer the following question:  Why would a programmer choose to define a method in an abstract class, such as the Animal constructor method or the getName() method in the linked code example, as opposed to defining a method as abstract, such as the makeSound() method in the linked example? Supporting Material: Week One Analyze Assignment Text File
  • 2. Prg421.com PRG 421 Week 1 Individual Assignment Coding a Program Containing Abstract and Derived Classes Resources:  "Lesson: Object-Oriented Programming Concepts" on The Java™ Tutorials website  Downloadable starter code from the Oracle® website: Bicyle class and BicycleDemo class For this assignment, you will modify existing code to create a single Java™ program named BicycleDemo.java that incorporates the following:  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.  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. Read through the "Lesson: Object-Oriented Programming Concepts" on The Java™ Tutorials website. Download the linked Bicycle class, or cut-and-paste it at the top of a new Java™ project named BicycleDemo. Download the linked BicycleDemo class, or cut-and-paste it beneath the Bicycle class in the BicycleDemo.java file. Optionally, review this week's Individual "Week One Analyze Assignment," to refresh your understanding of how to code derived classes.
  • 3. Adapt the Bicycle class by cutting and pasting the class into the NetBeans editor and completing the following:  Change the Bicycle class to be an abstract class.  Add a private variable of type integer named bicycleCount, and initialize this variable to 0.  Change the Bicycle constructor to add 1 to the bicycleCount each time a new object of type Bicycle is created.  Add a public getter method to return the current value of bicycleCount.  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). Using the NetBeans editor, adapt the BicycleDemo class as follows:  Create two instances each of MountainBike and RoadBike.  Display the value of bicycleCount on the console. 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. Rename your JAVA file to have a .txt file extension. Submit your TXT file to the Assignment Files tab. PRG 421 Week 2 Individual Assignment Coding a Program Containing Console/file input and output Resource:  "Console/File Input and Output" text file For this assignment, you will build on "starter" code to create a Java™ program that prompts the user for input, accepts user input, and produces both console and file output. Copy the linked code to a JAVA file. Add Java® code based on the comments inside the code. Note: Refer to this week's Individual "Week Two Analyze Assignment" for model code you can adapt to meet this assignment's requirements. Test, debug, and run your code using the NetBeans editor to make sure it meets the program requirements. Save your JAVA file with a .txt extension.
  • 4. Submit your TXT file to the Assignment Files tab. PRG 421 ENTIRE CLASS PRG 421 Week 2 Individual Assignment Analyzing a Program Containing Console/file input and output Resource:  "Demonstrate the Coding to Produce Output to a File" text file For this assignment, you will analyze Java™ that presents instructional text on the console, accepts user input, and then creates a file based on that user input. Read the linked Java™ code carefully. Then, answer the following questions in a Microsoft® Word file:  As you run the program in NetBeans the first time, at the prompt (the program will pause for input) type abc Return def Return ghi Ctrl+Shift+Del. What is the result?  As you run the program in NetBeans the second time, at the prompt (the program will pause for input) type 123 Ctrl+Shift +Del. What is the result?  What happens if the file Data.txt already exists when you run the program?  What happens if the file Data.txt does not already exist when you run the program? Submit your Word file to the Assignment Files tab. Prg421.com PRG 421 Week 3 Individual Assignment Analyzing a Program Containing Manipulating Data with the Java™ Stream API Resource:
  • 5.  "Java Code That Sorts, Extracts Data and Saves It To a Collection" text file For this assignment, you will analyze code that uses a file input stream and a file output stream. Read through the linked Java™ code. In a Microsoft® Word document, answer the following questions:  Could this program be run as is? If not, what is it lacking?  Does this program modify the contents of an input stream? In what way?  What are the results of running this code? Submit your completed Word document to the Assignment Files tab. PRG 421 Week 3 Individual Assignment Coding a Program Containing Manipulating Data with the Java™ Stream API For this assignment, you will develop "starter" code. After you finish, your code should access an existing text file that you have created, create an input stream, read the contents of the text flie, sort and store the contents of the text file into an ArrayList, then write the sorted contents via an ouput stream to a separate output text file. Copy and paste the following Java™ code into a JAVA source file in NetBeans: import java.io.BufferedReader; import java.io.BufferedWriter; public class Datasort { public static void main (String [] args) { File fin = // input file File fout = // create an out file
  • 6. // Java FileInputStream class obtains input bytes from a file FileInputStream fis = new FileInputStream(fin); // buffering characters so as to provide for the efficient reading of characters, arrays, and lines BufferedReader in = new BufferedReader(new InputStreamReader(fis)); // declare an array in-line, ready for the sort String aLine; ArrayList<String> al = new ArrayList<String> (); int i = 0; while ((aLine = in.readLine()) != null) { // set the sort for values is greater than 0 Collections.sort(al); // sorted content to the output file { System.out.println(s); } // close the 2 files } } Add code as indicated in the comments. Note: Refer to this week's Individual assignment, "Week Three Analyze Assignment," and to Ch. 8, "IO," in OCP: Oracle® Certified Professional Java® SE 8 Programmer II Study Guide. Run and debug your modified program in NetBeans until it satisfies the requirements described above.
  • 7. Save your finalized JAVA file with a .txt extension. Submit your TXT file to the Assignment Files tab. PRG 421 Week 4 Individual Assignment Coding a Program Containing Locale Object Resource:  "The Locale Object" text file For this assignment, you will develop Java™ code that relies on localization to format currencies and dates. In NetBeans, copy the linked code to a PRG 421 ENTIRE CLASS Prg421.com