ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 24 May 2017 My Price 9.00

Microsoft Word - CS 219 Unit 6 Ch 15 Assignment

Please help with writing this code.

Microsoft Word - CS 219 Unit 6 Ch 15 Assignment.doc

 

Unit 6 Chapter 15 Assignment Grading Information: This Program is due on Date Specified.

Comments are REQUIRED; flow charts and pseudocode are NOT REQUIRED. 

Directions 

Points 

The files must be called <LiFiUnit6Ch15.java> LiFiSaleCheck.java (Sale Checker Class File) 

The files must be called as specified above, (LiFi = Your Last Initial Your First Initial) 

Proper coding conventions required the first letter of the class start with a capital letter and the first letter of each additional word start with a capital letter. 

Only submit the .java files needed to make the program run. Do not submit the .class files or any other files. 

5% 

Style Components 

Include properly formatted prologue, comments, indenting, and other style elements as shown in Chapter 2 starting page 64 and Appendix 5 page 881-892. 

5% 

Topics covered in chapter 

Topics with * are covered in this assignment. Ensure you use every item listed below in your completed assignment. 

*Exceptions and Exception Messages *try / catch
*checked and unchecked exceptions *generic catch block 

*throws 

Basic Requirements 

Write a program that validates a sale in dollars and cents with a $ and a .(period). See sample output below. 

20% 

LiFiUnit6Ch15.java 

  • Driver class should loop until "q" is entered to quit 
  • If enter is not "q", then create an instance of the LiFiSaleCheck object passing the entry as an argument 
  • If no error 

20% 

 

o Print amount by calling: 

  •  print numeric from LiFiSaleCheck class 
  •  print alphabetic from LiFiSaleCheck class 

• If error
o Call the getError() method on this LiFiSaleCheck object and print the 

error message (see sample) 

LiFiSaleCheck.java class 

Sales object should store the sale in 2 integer instance variables, dollars and cents, and include a string variable to hold the error. This should be initialized with null. 

LiFiSaleCheck Constructor: 

  • Receive sale as a string 
  • Perform error checking to ensure amount was entered in proper format to include a period (.) between the dollars and cents and a $ at the start of the string. 
  • Use indexOf and substring to separate the sale string into the appropriate instance variables 
  • Use try/catch to catch format errors of dollars and cents as shown in example 
  • If an error occurs, change the error instance variable to reflect the error (see sample) 
  • If more than one error occurs in the format of the dollars and cents, show both. print numeric method: 

• Print in the format $123.45 using both dollars and cents instance variables (if 

amounts like $4.2 is entered, should print $4.20) 

print alphabetic method:
• Print in the format 123 dollars and 45 cents using both dollars and cents 

instance variables (if amounts like $4.2 is entered, should print 4 dollars and 20 cents) 

getError method:
• returns the error instance variable (String type) 

50% 

NOTE: Complete your activity and submit it by clicking "Submit Assignment" 

Total Percentage 

100% 

Sample 

 

 

Directions 

Points 

The files must be called <LiFiUnit6Ch15.java> LiFiSaleCheck.java (Sale Checker Class File) 

The files must be called as specified above, (LiFi = Your Last Initial Your First Initial) 

Proper coding conventions required the first letter of the class start with a capital letter and the first letter of each additional word start with a capital letter. 

Only submit the .java files needed to make the program run. Do not submit the .class files or any other files. 

5% 

Style Components 

Include properly formatted prologue, comments, indenting, and other style elements as shown in Chapter 2 starting page 64 and Appendix 5 page 881-892. 

5% 

Topics covered in chapter 

Topics with * are covered in this assignment. Ensure you use every item listed below in your completed assignment. 

*Exceptions and Exception Messages *try / catch
*checked and unchecked exceptions *generic catch block 

*throws 

Basic Requirements 

Write a program that validates a sale in dollars and cents with a $ and a .(period). See sample output below. 

20% 

LiFiUnit6Ch15.java 

  • Driver class should loop until "q" is entered to quit 
  • If enter is not "q", then create an instance of the LiFiSaleCheck object passing the entry as an argument 
  • If no error 

20% 

 

o Print amount by calling: 

  •  print numeric from LiFiSaleCheck class 
  •  print alphabetic from LiFiSaleCheck class 

• If error
o Call the getError() method on this LiFiSaleCheck object and print the 

error message (see sample) 

LiFiSaleCheck.java class 

Sales object should store the sale in 2 integer instance variables, dollars and cents, and include a string variable to hold the error. This should be initialized with null. 

LiFiSaleCheck Constructor: 

  • Receive sale as a string 
  • Perform error checking to ensure amount was entered in proper format to include a period (.) between the dollars and cents and a $ at the start of the string. 
  • Use indexOf and substring to separate the sale string into the appropriate instance variables 
  • Use try/catch to catch format errors of dollars and cents as shown in example 
  • If an error occurs, change the error instance variable to reflect the error (see sample) 
  • If more than one error occurs in the format of the dollars and cents, show both. print numeric method: 

• Print in the format $123.45 using both dollars and cents instance variables (if 

amounts like $4.2 is entered, should print $4.20) 

print alphabetic method:
• Print in the format 123 dollars and 45 cents using both dollars and cents 

instance variables (if amounts like $4.2 is entered, should print 4 dollars and 20 cents) 

getError method:
• returns the error instance variable (String type) 

50% 

NOTE: Complete your activity and submit it by clicking "Submit Assignment" 

Total Percentage 

100% 

 

 

Unit 6 Chapter 15 AssignmentGrading Information:This Program isdueonDate Specified.Comments areREQUIRED; flow charts and pseudocode areNOT REQUIRED.DirectionsPointsThe files must be called <LiFiUnit6Ch15.java>LiFiSaleCheck.java(Sale Checker Class File)The files must be called as specified above, (LiFi = Your Last Initial Your First Initial)Proper coding conventions required the first letter of the class start with a capitalletter and the first letter of each additional word start with a capital letter.Only submit the .javafiles needed to make the program run. Do not submit the.classfiles or any other files.5%Style ComponentsInclude properly formatted prologue, comments, indenting, and other style elementsas shown in Chapter 2 starting page 64 and Appendix 5 page 881-892.5%Topics covered in chapterTopics with * are covered in this assignment. Ensure you use every item listed below in yourcompleted assignment.*Exceptions and Exception Messages*try / catch*checked and unchecked exceptions*generic catch block*throwsBasic RequirementsWrite a program that validates a sale in dollars and cents with a $ and a .(period).See sample output below.20%LiFiUnit6Ch15.java•Driver class should loop until “q” is entered to quit•If enter is not “q”, then create an instance of the LiFiSaleCheck object passingthe entry as an argument•If no error20%

Attachments:

Answers

(11)
Status NEW Posted 24 May 2017 07:05 AM My Price 9.00

-----------

Attachments

file 1495612662-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)