Prints out a summary for a list of prescriptions

Assignment Help JAVA Programming
Reference no: EM13166598

Create a class that prints out a summary for a list of prescriptions. Using your Prescription class and some if statements you will read in 3 prescriptions and print out an appropriate summary with a list of the prescriptions, the total price, and any warnings associated with those medicines. You will also create a small test class to validate your work.

Example

So, the input to the class may be something like (3 sets of name, supply, price):

Tylenol 14 8.95 Diflucan 3 14.50 Pseudoephedrine 20 13.45

This would produce an output similar to:

Name Supply Price
Tylenol 14 $8.50
With your discount, you saved $0.45! Diflucan 3 $14.50 Pseudoephedrine 20 $12.78 With your discount, you saved $0.67! Total: $35.78

Reference no: EM13166598

Questions Cloud

Filling all the positions of his cabinet : How many ways are there of filling all the positions of his cabinet if we assume that each position be filled by a different person and do not take into account which position each been has been assigned?
Modify the btod procedure : Modify the BTOD procedure so that leading zeros are replaced by blanks. For example, if the result is "0" - "5" - "9," the leading 0 in the hundreds position gets replaced by a blank, giving " " - "5" - "9."
Non-finitely-describable languages closed underconcatenation : Are the non-finitely-describable languages closed under concatenation? Kleene closure? Complementation? Union?
Use a loop to allow a user to enter a series of numbers : Use a loop to allow a user to enter a series of numbers and then print out the series of numbers when the user is done. The user stops the lseries program by entering -1 (or any negative number).
Prints out a summary for a list of prescriptions : Create a class that prints out a summary for a list of prescriptions. Using your Prescription class and some if statements you will read in 3 prescriptions and print out an appropriate summary with a list of the prescriptions
Has this network been sub-netted : Assume a host computer has the following configuration: IP Address: 145.20.110.176 Subnet Mask: 255.255.0.0 Default Gateway: 145.20.1.1 a. What is the Class of this network?
Extended grep for regular expressions : That contain the word "as" exactly onceb) that contain the word "sa" more than once
What ip range would an isp provide to a customer : Using the IP ranges below: 245.0.0.0/8 225.113.9.0/25 169.254.137.0/25 192.168.0.0/16 172.16.0.0/24 10.0.0.0/8 245.125.1378.0/24 215.154.10.0/24 225.113.8.0/24 127.0.0.0/8 10.0.0.0/24 a)
Program that evaluates a infix expression : Program that evaluates a infix expression using stacks terminated by an equal sign. for example: (4-2)-5)/(2+1)-2))=the expression will contain single digit and the operators +, -, *,/. Make sure to consider the operator precedence.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Multiplexors whose control bit allows you

Design a 4-bit up/down counter that has 2 to 1 multiplexors whose control bit allows you to select between one of two counting modes up or down

  Utilizes a good design process

Analyze, design, and document a simple program that utilizes a good design process and incorporates sequential, selection and repetitive programming statements as well as at least one function call and the use of at least one array.

  Create and implement class called date to store month

Create and Implement the class called Date which has data members to store month (as a number), day, year, and name of month.

  Common to perform loops that vary the loop control

When an application contains an array and you want to use every element of the array in some task, it is common to perform loops that vary the loop control variable from 0 to one less than the size of the array.

  Implement simple java program to input syllabus grades

To implement simple Java program to input (hypothetical) syllabus grades, computing and displaying both normal Mean and Harmonic Mean.

  Write a program that simulate n rolls of six-sided die

Write a program that simulate n rolls of six-sided die and displays the frequency of occurrence of each side and What is the most likely method signature of the "parseInt() - TNE60003

  Java application to display multiple choice questions

Write down the application which displays series of TEN(10) multiple choice questions: questions must cover all the Java. Each question must have four possible answers and only one answer must be correct.

  Java program that will prompt the user to input a file

Write a Java program that will prompt the user to input a file (document) in order to count the frequency of each word. This program will display the frequency of each word sorted alphabetically or by frequency (depending on the preference of the use..

  Construct java program named collegelist

Construct a set of classes for a college to use in many student service and personnel applications. Classes you require to design include following:

  Java program for line item application

This exercise explains you the process of testing and enhancing Line Item application. Open LineItemApp, Validator, Product, LineItem, and ProductDB classes that are in the c:java1.6ch06LineItem directory and review this code.

  Write a java program to implement the finite field

Write a program called "GF2.java" to implement the finite field GF(p n ) where p is a prime number and n is a positive integer.  You also need to write four methods to realize "+", "-", "´", and "/".

  Write java program to find calories-conditional operator

Write down the answer for this program? Write down Java program (use Conditional (? Operator) which suggests number of calories a person must eat each day.

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