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

  Java applet to find how much federal tax we need to pay

Write a java applet to determine how much federal tax we need to pay assuming the tax rate is 12%.  Ask the taxable income.

  Reads in up to 1000 non-negative integers

Write a program that reads in up to 1000 non-negative integers and displays distinct numbers (i.e., if a number appears multiple times, it is displayed only once). (Hint: Read each number and store it in an array if it is new. If the number is alread..

  Develop view for order number and order total in file

Develop a view named OrdTot. It comprises of order number and order total for each order currently on file. Order total is the sum of number ordered.

  Loops and files

Convert an algorithm using control structures into Java and write a while loop

  Create and code a program that uses three parallel numeric

Create and code a program that uses three parallel numeric arrays of size 6. The program searches one of the arrays and then displays the corresponding values from the other two arrays.

  Method that receives an array and returns with no duplicate

Write a program that contrains a method that receives an array and returns a new array with no duplicates.

  Data structures and algorithms

Code analysis and programming.

  Write java program prints strings given at command line

Write down the program Average.java which just prints strings which it is given at command line, one per line. If nothing is given at command line, print "No arguments".

  The ai player will not be asking

The AI player will not be asking the user for any input. This means that placeShips() and fire() should not ask the user for locations. The AI player should choose locations of ships and automatically place them

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Write a java program that accepts a positive long integer

Write a Java program that accepts a positive long integer between 2 to 15, and then using the number, calculate its factorial (n!). Using do-while statement, make sure it only accepts a valid number (between 2 and 15) - if an invalid number is ent..

  The string class and/or the stringbuffer class in java

Create a simple Java application that uses the String class and/or the StringBuffer class and at least 4 of the class methods. Show the code, demonstrate it works properly and describe what it is doing.

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